Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CPack/IFW/cmCPackIFWPackage.h
5020 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 <map>
8
#include <set>
9
#include <string>
10
#include <vector>
11
12
#include "cmCPackIFWCommon.h"
13
14
class cmCPackComponent;
15
class cmCPackComponentGroup;
16
class cmCPackIFWInstaller;
17
18
/** \class cmCPackIFWPackage
19
* \brief A single component to be installed by CPack IFW generator
20
*/
21
class cmCPackIFWPackage : public cmCPackIFWCommon
22
{
23
public:
24
// Types
25
26
enum CompareTypes
27
{
28
CompareNone = 0x0,
29
CompareEqual = 0x1,
30
CompareLess = 0x2,
31
CompareLessOrEqual = 0x3,
32
CompareGreater = 0x4,
33
CompareGreaterOrEqual = 0x5
34
};
35
36
struct CompareStruct
37
{
38
CompareStruct();
39
40
unsigned int Type;
41
std::string Value;
42
};
43
44
struct DependenceStruct
45
{
46
DependenceStruct();
47
explicit DependenceStruct(std::string const& dependence);
48
49
std::string Name;
50
CompareStruct Compare;
51
52
std::string NameWithCompare() const;
53
54
bool operator<(DependenceStruct const& other) const
55
{
56
return this->Name < other.Name;
57
}
58
};
59
60
public:
61
// [Con|De]structor
62
63
/**
64
* Construct package
65
*/
66
cmCPackIFWPackage();
67
68
public:
69
// Configuration
70
71
/// Human-readable name of the component
72
std::map<std::string, std::string> DisplayName;
73
74
/// Human-readable description of the component
75
std::map<std::string, std::string> Description;
76
77
/// Version number of the component
78
std::string Version;
79
80
/// Date when this component version was released
81
std::string ReleaseDate;
82
83
/// Domain-like identification for this component
84
std::string Name;
85
86
/// File name of a script being loaded
87
std::string Script;
88
89
/// List of license agreements to be accepted by the installing user
90
std::vector<std::string> Licenses;
91
92
/// List of pages to load
93
std::vector<std::string> UserInterfaces;
94
95
/// List of translation files to load
96
std::vector<std::string> Translations;
97
98
/// Priority of the component in the tree
99
std::string SortingPriority;
100
101
/// Description added to the component description
102
std::string UpdateText;
103
104
/// Set to true to preselect the component in the installer
105
std::string Default;
106
107
/// Marks the package as essential to force a restart of the MaintenanceTool
108
std::string Essential;
109
110
/// Set to true to hide the component from the installer
111
std::string Virtual;
112
113
/// Determines that the package must always be installed
114
std::string ForcedInstallation;
115
116
/// List of components to replace
117
std::vector<std::string> Replaces;
118
119
/// Package needs to be installed with elevated permissions
120
std::string RequiresAdminRights;
121
122
/// Set to false if you want to hide the checkbox for an item
123
std::string Checkable;
124
125
public:
126
// Internal implementation
127
128
std::string GetComponentName(cmCPackComponent* component);
129
130
void DefaultConfiguration();
131
132
int ConfigureFromOptions();
133
int ConfigureFromComponent(cmCPackComponent* component);
134
int ConfigureFromGroup(cmCPackComponentGroup* group);
135
int ConfigureFromGroup(std::string const& groupName);
136
int ConfigureFromPrefix(std::string const& prefix);
137
138
void GeneratePackageFile();
139
140
// Pointer to installer
141
cmCPackIFWInstaller* Installer;
142
// Collection of dependencies
143
std::set<cmCPackIFWPackage*> Dependencies;
144
// Collection of unresolved dependencies
145
std::set<DependenceStruct*> AlienDependencies;
146
// Collection of unresolved automatic dependency on
147
std::set<DependenceStruct*> AlienAutoDependOn;
148
// Patch to package directory
149
std::string Directory;
150
};
151
152