1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc.
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
13 #ifndef cmCPackComponentGroup_h
14 #define cmCPackComponentGroup_h
16 #include "cmStandardIncludes.h"
18 class cmCPackComponentGroup;
20 /** \class cmCPackInstallationType
21 * \brief A certain type of installation, which encompasses a
24 class cmCPackInstallationType
27 /// The name of the installation type (used to reference this
28 /// installation type).
31 /// The name of the installation type as displayed to the user.
32 std::string DisplayName;
34 /// The index number of the installation type. This is an arbitrary
35 /// numbering from 1 to the number of installation types.
39 /** \class cmCPackComponent
40 * \brief A single component to be installed by CPack.
42 class cmCPackComponent
45 cmCPackComponent() : Group(0), IsRequired(true), IsHidden(false),
46 IsDisabledByDefault(false), IsDownloaded(false),
49 /// The name of the component (used to reference the component).
52 /// The name of the component as displayed to the user.
53 std::string DisplayName;
55 /// The component group that contains this component (if any).
56 cmCPackComponentGroup *Group;
58 /// Whether this component group must always be installed.
61 /// Whether this component group is hidden. A hidden component group
62 /// is always installed. However, it may still be shown to the user.
65 /// Whether this component defaults to "disabled".
66 bool IsDisabledByDefault : 1;
68 /// Whether this component should be downloaded on-the-fly. If false,
69 /// the component will be a part of the installation package.
70 bool IsDownloaded : 1;
72 /// A description of this component.
73 std::string Description;
75 /// The installation types that this component is a part of.
76 std::vector<cmCPackInstallationType *> InstallationTypes;
78 /// If IsDownloaded is true, the name of the archive file that
79 /// contains the files that are part of this component.
80 std::string ArchiveFile;
82 /// The components that this component depends on.
83 std::vector<cmCPackComponent *> Dependencies;
85 /// The components that depend on this component.
86 std::vector<cmCPackComponent *> ReverseDependencies;
88 /// The list of installed files that are part of this component.
89 std::vector<std::string> Files;
91 /// The list of installed directories that are part of this component.
92 std::vector<std::string> Directories;
94 /// Get the total installed size of all of the files in this
95 /// component, in bytes. installDir is the directory into which the
96 /// component was installed.
97 unsigned long GetInstalledSize(const char* installDir) const;
99 /// Identical to GetInstalledSize, but returns the result in
101 unsigned long GetInstalledSizeInKbytes(const char* installDir) const;
104 mutable unsigned long TotalSize;
107 /** \class cmCPackComponentGroup
108 * \brief A component group to be installed by CPack.
110 class cmCPackComponentGroup
113 cmCPackComponentGroup() : ParentGroup(0) { }
115 /// The name of the group (used to reference the group).
118 /// The name of the component as displayed to the user.
119 std::string DisplayName;
121 /// The description of this component group.
122 std::string Description;
124 /// Whether the name of the component will be shown in bold.
127 /// Whether the section should be expanded by default
128 bool IsExpandedByDefault : 1;
130 /// The components within this group.
131 std::vector<cmCPackComponent*> Components;
133 /// The parent group of this component group (if any).
134 cmCPackComponentGroup *ParentGroup;
136 /// The subgroups of this group.
137 std::vector<cmCPackComponentGroup*> Subgroups;