2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc.
|
2008-06-17 19:39:26 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2008-06-17 19:39:26 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2008-06-17 19:39:26 +04:00
|
|
|
|
|
|
|
#ifndef cmCPackComponentGroup_h
|
|
|
|
#define cmCPackComponentGroup_h
|
|
|
|
|
2016-09-01 21:05:48 +03:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
|
2008-07-10 00:30:53 +04:00
|
|
|
#include "cmStandardIncludes.h"
|
2008-06-17 19:39:26 +04:00
|
|
|
|
|
|
|
class cmCPackComponentGroup;
|
|
|
|
|
|
|
|
/** \class cmCPackInstallationType
|
2012-08-13 21:42:58 +04:00
|
|
|
* \brief A certain type of installation, which encompasses a
|
2008-06-17 19:39:26 +04:00
|
|
|
* set of components.
|
|
|
|
*/
|
|
|
|
class cmCPackInstallationType
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// The name of the installation type (used to reference this
|
|
|
|
/// installation type).
|
|
|
|
std::string Name;
|
|
|
|
|
|
|
|
/// The name of the installation type as displayed to the user.
|
|
|
|
std::string DisplayName;
|
|
|
|
|
|
|
|
/// The index number of the installation type. This is an arbitrary
|
|
|
|
/// numbering from 1 to the number of installation types.
|
|
|
|
unsigned Index;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** \class cmCPackComponent
|
|
|
|
* \brief A single component to be installed by CPack.
|
|
|
|
*/
|
|
|
|
class cmCPackComponent
|
|
|
|
{
|
|
|
|
public:
|
2016-05-16 17:34:04 +03:00
|
|
|
cmCPackComponent()
|
2016-06-27 23:44:16 +03:00
|
|
|
: Group(CM_NULLPTR)
|
2016-05-16 17:34:04 +03:00
|
|
|
, IsRequired(true)
|
|
|
|
, IsHidden(false)
|
|
|
|
, IsDisabledByDefault(false)
|
|
|
|
, IsDownloaded(false)
|
|
|
|
, TotalSize(0)
|
|
|
|
{
|
|
|
|
}
|
2008-06-17 19:39:26 +04:00
|
|
|
|
|
|
|
/// The name of the component (used to reference the component).
|
|
|
|
std::string Name;
|
|
|
|
|
|
|
|
/// The name of the component as displayed to the user.
|
|
|
|
std::string DisplayName;
|
|
|
|
|
|
|
|
/// The component group that contains this component (if any).
|
2016-05-16 17:34:04 +03:00
|
|
|
cmCPackComponentGroup* Group;
|
2008-06-17 19:39:26 +04:00
|
|
|
|
|
|
|
/// Whether this component group must always be installed.
|
|
|
|
bool IsRequired : 1;
|
|
|
|
|
|
|
|
/// Whether this component group is hidden. A hidden component group
|
|
|
|
/// is always installed. However, it may still be shown to the user.
|
|
|
|
bool IsHidden : 1;
|
|
|
|
|
|
|
|
/// Whether this component defaults to "disabled".
|
|
|
|
bool IsDisabledByDefault : 1;
|
|
|
|
|
2008-07-08 19:52:25 +04:00
|
|
|
/// Whether this component should be downloaded on-the-fly. If false,
|
|
|
|
/// the component will be a part of the installation package.
|
|
|
|
bool IsDownloaded : 1;
|
|
|
|
|
2008-06-17 19:39:26 +04:00
|
|
|
/// A description of this component.
|
|
|
|
std::string Description;
|
|
|
|
|
|
|
|
/// The installation types that this component is a part of.
|
2016-05-16 17:34:04 +03:00
|
|
|
std::vector<cmCPackInstallationType*> InstallationTypes;
|
2008-06-17 19:39:26 +04:00
|
|
|
|
2008-07-08 19:52:25 +04:00
|
|
|
/// If IsDownloaded is true, the name of the archive file that
|
|
|
|
/// contains the files that are part of this component.
|
|
|
|
std::string ArchiveFile;
|
|
|
|
|
2008-06-17 19:39:26 +04:00
|
|
|
/// The components that this component depends on.
|
2016-05-16 17:34:04 +03:00
|
|
|
std::vector<cmCPackComponent*> Dependencies;
|
2008-06-17 19:39:26 +04:00
|
|
|
|
|
|
|
/// The components that depend on this component.
|
2016-05-16 17:34:04 +03:00
|
|
|
std::vector<cmCPackComponent*> ReverseDependencies;
|
2008-06-17 19:39:26 +04:00
|
|
|
|
|
|
|
/// The list of installed files that are part of this component.
|
|
|
|
std::vector<std::string> Files;
|
|
|
|
|
|
|
|
/// The list of installed directories that are part of this component.
|
|
|
|
std::vector<std::string> Directories;
|
2008-07-09 21:38:56 +04:00
|
|
|
|
|
|
|
/// Get the total installed size of all of the files in this
|
2012-08-13 21:42:58 +04:00
|
|
|
/// component, in bytes. installDir is the directory into which the
|
2008-07-09 21:38:56 +04:00
|
|
|
/// component was installed.
|
2014-02-22 04:05:55 +04:00
|
|
|
unsigned long GetInstalledSize(const std::string& installDir) const;
|
2008-07-09 21:38:56 +04:00
|
|
|
|
|
|
|
/// Identical to GetInstalledSize, but returns the result in
|
|
|
|
/// kilobytes.
|
2014-02-22 04:05:55 +04:00
|
|
|
unsigned long GetInstalledSizeInKbytes(const std::string& installDir) const;
|
2008-07-09 21:38:56 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
private:
|
2008-07-09 21:38:56 +04:00
|
|
|
mutable unsigned long TotalSize;
|
2008-06-17 19:39:26 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/** \class cmCPackComponentGroup
|
|
|
|
* \brief A component group to be installed by CPack.
|
|
|
|
*/
|
|
|
|
class cmCPackComponentGroup
|
|
|
|
{
|
|
|
|
public:
|
2016-05-16 17:34:04 +03:00
|
|
|
cmCPackComponentGroup()
|
2016-06-27 23:44:16 +03:00
|
|
|
: ParentGroup(CM_NULLPTR)
|
2016-05-16 17:34:04 +03:00
|
|
|
{
|
|
|
|
}
|
2008-07-08 19:52:25 +04:00
|
|
|
|
2008-06-17 19:39:26 +04:00
|
|
|
/// The name of the group (used to reference the group).
|
|
|
|
std::string Name;
|
|
|
|
|
|
|
|
/// The name of the component as displayed to the user.
|
|
|
|
std::string DisplayName;
|
|
|
|
|
|
|
|
/// The description of this component group.
|
|
|
|
std::string Description;
|
|
|
|
|
|
|
|
/// Whether the name of the component will be shown in bold.
|
|
|
|
bool IsBold : 1;
|
|
|
|
|
|
|
|
/// Whether the section should be expanded by default
|
|
|
|
bool IsExpandedByDefault : 1;
|
|
|
|
|
|
|
|
/// The components within this group.
|
|
|
|
std::vector<cmCPackComponent*> Components;
|
2008-07-08 19:52:25 +04:00
|
|
|
|
|
|
|
/// The parent group of this component group (if any).
|
2016-05-16 17:34:04 +03:00
|
|
|
cmCPackComponentGroup* ParentGroup;
|
2008-07-08 19:52:25 +04:00
|
|
|
|
|
|
|
/// The subgroups of this group.
|
|
|
|
std::vector<cmCPackComponentGroup*> Subgroups;
|
2008-06-17 19:39:26 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|