CMake/Source/CPack/cmCPackComponentGroup.h

141 lines
4.2 KiB
C
Raw Normal View History

/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc.
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
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.
============================================================================*/
#ifndef cmCPackComponentGroup_h
#define cmCPackComponentGroup_h
#include "cmStandardIncludes.h"
class cmCPackComponentGroup;
/** \class cmCPackInstallationType
* \brief A certain type of installation, which encompasses a
* 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:
cmCPackComponent() : Group(0), IsRequired(true), IsHidden(false),
IsDisabledByDefault(false), IsDownloaded(false),
TotalSize(0) { }
/// 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).
cmCPackComponentGroup *Group;
/// 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;
ENH: Further refinement of the CPack components functionality from Doug Gregor. Details: ========== - New cpack_add_component, cpack_add_component_group, and cpack_add_install_type "commands" defined as macros in the CPack module. - Documentation for all of the variables and commands in the CPack module. - Added get_cmake_property(... COMPONENTS) to CMake to ask for the names of all components. Used in the CPack module to automatically build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to turn off component-based installation). - A group can declare its PARENT_GROUP, to build an arbitrary hierarchy of groups. - New CPack command cpack_configure_downloads, which creates an installer that downloads only the selected components on-the-fly. Those components marked DOWNLOADED will be separate packages downloaded on-the-fly (or, all packages can be marked as such with the ALL option to cpack_configure_downloads). Individual components are compressed with ZIP at installer-creation time and downloaded/uncompressed by the installer as needed. This feature is only available on Windows with NSIS at the moment. - NSIS installers can install themselves and enable the "Change" button in Add/Remove programs, allowing users to go back and install or remove components. This can be disabled through cpack_configure_downloads, because it's only really useful is most of the application's functionality is in downloaded components. - Bug fix: automatically install everything whose COMPONENT was not specified (it's a hidden, required group) - Bug fix: fixed removal of components when re-running the NSIS installer and unchecking components - Bug fix: NSIS installers now only install/remove the minimal number of files when re-run to update the installation (or by clicking "Change" in Add/Remove programs)
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;
/// A description of this component.
std::string Description;
/// The installation types that this component is a part of.
std::vector<cmCPackInstallationType *> InstallationTypes;
ENH: Further refinement of the CPack components functionality from Doug Gregor. Details: ========== - New cpack_add_component, cpack_add_component_group, and cpack_add_install_type "commands" defined as macros in the CPack module. - Documentation for all of the variables and commands in the CPack module. - Added get_cmake_property(... COMPONENTS) to CMake to ask for the names of all components. Used in the CPack module to automatically build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to turn off component-based installation). - A group can declare its PARENT_GROUP, to build an arbitrary hierarchy of groups. - New CPack command cpack_configure_downloads, which creates an installer that downloads only the selected components on-the-fly. Those components marked DOWNLOADED will be separate packages downloaded on-the-fly (or, all packages can be marked as such with the ALL option to cpack_configure_downloads). Individual components are compressed with ZIP at installer-creation time and downloaded/uncompressed by the installer as needed. This feature is only available on Windows with NSIS at the moment. - NSIS installers can install themselves and enable the "Change" button in Add/Remove programs, allowing users to go back and install or remove components. This can be disabled through cpack_configure_downloads, because it's only really useful is most of the application's functionality is in downloaded components. - Bug fix: automatically install everything whose COMPONENT was not specified (it's a hidden, required group) - Bug fix: fixed removal of components when re-running the NSIS installer and unchecking components - Bug fix: NSIS installers now only install/remove the minimal number of files when re-run to update the installation (or by clicking "Change" in Add/Remove programs)
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;
/// The components that this component depends on.
std::vector<cmCPackComponent *> Dependencies;
/// The components that depend on this component.
std::vector<cmCPackComponent *> ReverseDependencies;
/// 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;
/// Get the total installed size of all of the files in this
/// component, in bytes. installDir is the directory into which the
/// component was installed.
unsigned long GetInstalledSize(const char* installDir) const;
/// Identical to GetInstalledSize, but returns the result in
/// kilobytes.
unsigned long GetInstalledSizeInKbytes(const char* installDir) const;
private:
mutable unsigned long TotalSize;
};
/** \class cmCPackComponentGroup
* \brief A component group to be installed by CPack.
*/
class cmCPackComponentGroup
{
public:
ENH: Further refinement of the CPack components functionality from Doug Gregor. Details: ========== - New cpack_add_component, cpack_add_component_group, and cpack_add_install_type "commands" defined as macros in the CPack module. - Documentation for all of the variables and commands in the CPack module. - Added get_cmake_property(... COMPONENTS) to CMake to ask for the names of all components. Used in the CPack module to automatically build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to turn off component-based installation). - A group can declare its PARENT_GROUP, to build an arbitrary hierarchy of groups. - New CPack command cpack_configure_downloads, which creates an installer that downloads only the selected components on-the-fly. Those components marked DOWNLOADED will be separate packages downloaded on-the-fly (or, all packages can be marked as such with the ALL option to cpack_configure_downloads). Individual components are compressed with ZIP at installer-creation time and downloaded/uncompressed by the installer as needed. This feature is only available on Windows with NSIS at the moment. - NSIS installers can install themselves and enable the "Change" button in Add/Remove programs, allowing users to go back and install or remove components. This can be disabled through cpack_configure_downloads, because it's only really useful is most of the application's functionality is in downloaded components. - Bug fix: automatically install everything whose COMPONENT was not specified (it's a hidden, required group) - Bug fix: fixed removal of components when re-running the NSIS installer and unchecking components - Bug fix: NSIS installers now only install/remove the minimal number of files when re-run to update the installation (or by clicking "Change" in Add/Remove programs)
2008-07-08 19:52:25 +04:00
cmCPackComponentGroup() : ParentGroup(0) { }
/// 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;
ENH: Further refinement of the CPack components functionality from Doug Gregor. Details: ========== - New cpack_add_component, cpack_add_component_group, and cpack_add_install_type "commands" defined as macros in the CPack module. - Documentation for all of the variables and commands in the CPack module. - Added get_cmake_property(... COMPONENTS) to CMake to ask for the names of all components. Used in the CPack module to automatically build component-based installers. (Set CPACK_MONOLITHIC_INSTALL to turn off component-based installation). - A group can declare its PARENT_GROUP, to build an arbitrary hierarchy of groups. - New CPack command cpack_configure_downloads, which creates an installer that downloads only the selected components on-the-fly. Those components marked DOWNLOADED will be separate packages downloaded on-the-fly (or, all packages can be marked as such with the ALL option to cpack_configure_downloads). Individual components are compressed with ZIP at installer-creation time and downloaded/uncompressed by the installer as needed. This feature is only available on Windows with NSIS at the moment. - NSIS installers can install themselves and enable the "Change" button in Add/Remove programs, allowing users to go back and install or remove components. This can be disabled through cpack_configure_downloads, because it's only really useful is most of the application's functionality is in downloaded components. - Bug fix: automatically install everything whose COMPONENT was not specified (it's a hidden, required group) - Bug fix: fixed removal of components when re-running the NSIS installer and unchecking components - Bug fix: NSIS installers now only install/remove the minimal number of files when re-run to update the installation (or by clicking "Change" in Add/Remove programs)
2008-07-08 19:52:25 +04:00
/// The parent group of this component group (if any).
cmCPackComponentGroup *ParentGroup;
/// The subgroups of this group.
std::vector<cmCPackComponentGroup*> Subgroups;
};
#endif