Merge topic 'vs-framework-references'
[kiteware-cmake.git] / Source / CPack / cmCPackComponentGroup.h
blob6a47b6d157caf7ef915396d0e626af8bc35e7327
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <string>
8 #include <vector>
10 class cmCPackComponentGroup;
12 /** \class cmCPackInstallationType
13 * \brief A certain type of installation, which encompasses a
14 * set of components.
16 class cmCPackInstallationType
18 public:
19 /// The name of the installation type (used to reference this
20 /// installation type).
21 std::string Name;
23 /// The name of the installation type as displayed to the user.
24 std::string DisplayName;
26 /// The index number of the installation type. This is an arbitrary
27 /// numbering from 1 to the number of installation types.
28 unsigned Index;
31 /** \class cmCPackComponent
32 * \brief A single component to be installed by CPack.
34 class cmCPackComponent
36 public:
37 cmCPackComponent()
38 : IsRequired(true)
39 , IsHidden(false)
40 , IsDisabledByDefault(false)
41 , IsDownloaded(false)
45 /// The name of the component (used to reference the component).
46 std::string Name;
48 /// The name of the component as displayed to the user.
49 std::string DisplayName;
51 /// The component group that contains this component (if any).
52 cmCPackComponentGroup* Group = nullptr;
54 /// Whether this component group must always be installed.
55 bool IsRequired : 1;
57 /// Whether this component group is hidden. A hidden component group
58 /// is always installed. However, it may still be shown to the user.
59 bool IsHidden : 1;
61 /// Whether this component defaults to "disabled".
62 bool IsDisabledByDefault : 1;
64 /// Whether this component should be downloaded on-the-fly. If false,
65 /// the component will be a part of the installation package.
66 bool IsDownloaded : 1;
68 /// A description of this component.
69 std::string Description;
71 /// The installation types that this component is a part of.
72 std::vector<cmCPackInstallationType*> InstallationTypes;
74 /// If IsDownloaded is true, the name of the archive file that
75 /// contains the files that are part of this component.
76 std::string ArchiveFile;
78 /// The file to pass to --component-plist when using the
79 /// productbuild generator.
80 std::string Plist;
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 std::string& installDir) const;
99 /// Identical to GetInstalledSize, but returns the result in
100 /// kilobytes.
101 unsigned long GetInstalledSizeInKbytes(const std::string& installDir) const;
103 private:
104 mutable unsigned long TotalSize = 0;
107 /** \class cmCPackComponentGroup
108 * \brief A component group to be installed by CPack.
110 class cmCPackComponentGroup
112 public:
113 cmCPackComponentGroup()
114 : IsBold(false)
115 , IsExpandedByDefault(false)
119 /// The name of the group (used to reference the group).
120 std::string Name;
122 /// The name of the component as displayed to the user.
123 std::string DisplayName;
125 /// The description of this component group.
126 std::string Description;
128 /// Whether the name of the component will be shown in bold.
129 bool IsBold : 1;
131 /// Whether the section should be expanded by default
132 bool IsExpandedByDefault : 1;
134 /// The components within this group.
135 std::vector<cmCPackComponent*> Components;
137 /// The parent group of this component group (if any).
138 cmCPackComponentGroup* ParentGroup = nullptr;
140 /// The subgroups of this group.
141 std::vector<cmCPackComponentGroup*> Subgroups;
144 /** \class cmCPackInstallCMakeProject
145 * \brief A single quadruplet from the CPACK_INSTALL_CMAKE_PROJECTS variable.
147 class cmCPackInstallCMakeProject
149 public:
150 /// The directory of the CMake project.
151 std::string Directory;
153 /// The name of the CMake project.
154 std::string ProjectName;
156 /// The name of the component (or component set) to install.
157 std::string Component;
159 /// The subdirectory to install into.
160 std::string SubDirectory;
162 /// The list of installation types.
163 std::vector<cmCPackInstallationType*> InstallationTypes;
165 /// The list of components.
166 std::vector<cmCPackComponent*> Components;