1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCPackComponentGroup.h,v $
6 Date: $Date: 2008-07-09 20:30:53 $
7 Version: $Revision: 1.4 $
9 Copyright (c) 2002 Kitware, Inc. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
18 #ifndef cmCPackComponentGroup_h
19 #define cmCPackComponentGroup_h
21 #include "cmStandardIncludes.h"
23 class cmCPackComponentGroup
;
25 /** \class cmCPackInstallationType
26 * \brief A certain type of installation, which encompasses a
29 class cmCPackInstallationType
32 /// The name of the installation type (used to reference this
33 /// installation type).
36 /// The name of the installation type as displayed to the user.
37 std::string DisplayName
;
39 /// The index number of the installation type. This is an arbitrary
40 /// numbering from 1 to the number of installation types.
44 /** \class cmCPackComponent
45 * \brief A single component to be installed by CPack.
47 class cmCPackComponent
50 cmCPackComponent() : Group(0), TotalSize(0) { }
52 /// The name of the component (used to reference the component).
55 /// The name of the component as displayed to the user.
56 std::string DisplayName
;
58 /// The component group that contains this component (if any).
59 cmCPackComponentGroup
*Group
;
61 /// Whether this component group must always be installed.
64 /// Whether this component group is hidden. A hidden component group
65 /// is always installed. However, it may still be shown to the user.
68 /// Whether this component defaults to "disabled".
69 bool IsDisabledByDefault
: 1;
71 /// Whether this component should be downloaded on-the-fly. If false,
72 /// the component will be a part of the installation package.
73 bool IsDownloaded
: 1;
75 /// A description of this component.
76 std::string Description
;
78 /// The installation types that this component is a part of.
79 std::vector
<cmCPackInstallationType
*> InstallationTypes
;
81 /// If IsDownloaded is true, the name of the archive file that
82 /// contains the files that are part of this component.
83 std::string ArchiveFile
;
85 /// The components that this component depends on.
86 std::vector
<cmCPackComponent
*> Dependencies
;
88 /// The components that depend on this component.
89 std::vector
<cmCPackComponent
*> ReverseDependencies
;
91 /// The list of installed files that are part of this component.
92 std::vector
<std::string
> Files
;
94 /// The list of installed directories that are part of this component.
95 std::vector
<std::string
> Directories
;
97 /// Get the total installed size of all of the files in this
98 /// component, in bytes. installDir is the directory into which the
99 /// component was installed.
100 unsigned long GetInstalledSize(const char* installDir
) const;
102 /// Identical to GetInstalledSize, but returns the result in
104 unsigned long GetInstalledSizeInKbytes(const char* installDir
) const;
107 mutable unsigned long TotalSize
;
110 /** \class cmCPackComponentGroup
111 * \brief A component group to be installed by CPack.
113 class cmCPackComponentGroup
116 cmCPackComponentGroup() : ParentGroup(0) { }
118 /// The name of the group (used to reference the group).
121 /// The name of the component as displayed to the user.
122 std::string DisplayName
;
124 /// The description of this component group.
125 std::string Description
;
127 /// Whether the name of the component will be shown in bold.
130 /// Whether the section should be expanded by default
131 bool IsExpandedByDefault
: 1;
133 /// The components within this group.
134 std::vector
<cmCPackComponent
*> Components
;
136 /// The parent group of this component group (if any).
137 cmCPackComponentGroup
*ParentGroup
;
139 /// The subgroups of this group.
140 std::vector
<cmCPackComponentGroup
*> Subgroups
;