Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CPack/cmCPackComponentGroup.h
4998 views
1
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
file LICENSE.rst or https://cmake.org/licensing for details. */
3
#pragma once
4
5
#include "cmConfigure.h" // IWYU pragma: keep
6
7
#include <string>
8
#include <vector>
9
10
class cmCPackComponentGroup;
11
12
/** \class cmCPackInstallationType
13
* \brief A certain type of installation, which encompasses a
14
* set of components.
15
*/
16
class cmCPackInstallationType
17
{
18
public:
19
/// The name of the installation type (used to reference this
20
/// installation type).
21
std::string Name;
22
23
/// The name of the installation type as displayed to the user.
24
std::string DisplayName;
25
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;
29
};
30
31
/** \class cmCPackComponent
32
* \brief A single component to be installed by CPack.
33
*/
34
class cmCPackComponent
35
{
36
public:
37
cmCPackComponent()
38
: IsRequired(true)
39
, IsHidden(false)
40
, IsDisabledByDefault(false)
41
, IsDownloaded(false)
42
{
43
}
44
45
/// The name of the component (used to reference the component).
46
std::string Name;
47
48
/// The name of the component as displayed to the user.
49
std::string DisplayName;
50
51
/// The component group that contains this component (if any).
52
cmCPackComponentGroup* Group = nullptr;
53
54
/// Whether this component group must always be installed.
55
bool IsRequired : 1;
56
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;
60
61
/// Whether this component defaults to "disabled".
62
bool IsDisabledByDefault : 1;
63
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;
67
68
/// A description of this component.
69
std::string Description;
70
71
/// The installation types that this component is a part of.
72
std::vector<cmCPackInstallationType*> InstallationTypes;
73
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;
77
78
/// The file to pass to --component-plist when using the
79
/// productbuild generator.
80
std::string Plist;
81
82
/// The components that this component depends on.
83
std::vector<cmCPackComponent*> Dependencies;
84
85
/// The components that depend on this component.
86
std::vector<cmCPackComponent*> ReverseDependencies;
87
88
/// The list of installed files that are part of this component.
89
std::vector<std::string> Files;
90
91
/// The list of installed directories that are part of this component.
92
std::vector<std::string> Directories;
93
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(std::string const& installDir) const;
98
99
/// Identical to GetInstalledSize, but returns the result in
100
/// kilobytes.
101
unsigned long GetInstalledSizeInKbytes(std::string const& installDir) const;
102
103
private:
104
mutable unsigned long TotalSize = 0;
105
};
106
107
/** \class cmCPackComponentGroup
108
* \brief A component group to be installed by CPack.
109
*/
110
class cmCPackComponentGroup
111
{
112
public:
113
cmCPackComponentGroup()
114
: IsBold(false)
115
, IsExpandedByDefault(false)
116
{
117
}
118
119
/// The name of the group (used to reference the group).
120
std::string Name;
121
122
/// The name of the component as displayed to the user.
123
std::string DisplayName;
124
125
/// The description of this component group.
126
std::string Description;
127
128
/// Whether the name of the component will be shown in bold.
129
bool IsBold : 1;
130
131
/// Whether the section should be expanded by default
132
bool IsExpandedByDefault : 1;
133
134
/// The components within this group.
135
std::vector<cmCPackComponent*> Components;
136
137
/// The parent group of this component group (if any).
138
cmCPackComponentGroup* ParentGroup = nullptr;
139
140
/// The subgroups of this group.
141
std::vector<cmCPackComponentGroup*> Subgroups;
142
};
143
144
/** \class cmCPackInstallCMakeProject
145
* \brief A single quadruplet from the CPACK_INSTALL_CMAKE_PROJECTS variable.
146
*/
147
class cmCPackInstallCMakeProject
148
{
149
public:
150
/// The directory of the CMake project.
151
std::string Directory;
152
153
/// The name of the CMake project.
154
std::string ProjectName;
155
156
/// The name of the component (or component set) to install.
157
std::string Component;
158
159
/// The subdirectory to install into.
160
std::string SubDirectory;
161
162
/// The list of installation types.
163
std::vector<cmCPackInstallationType*> InstallationTypes;
164
165
/// The list of components.
166
std::vector<cmCPackComponent*> Components;
167
};
168
169