Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CPack/IFW/cmCPackIFWGenerator.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 "cmCPackGenerator.h"
13
#include "cmCPackIFWCommon.h"
14
#include "cmCPackIFWInstaller.h"
15
#include "cmCPackIFWPackage.h"
16
#include "cmCPackIFWRepository.h"
17
18
class cmCPackComponent;
19
class cmCPackComponentGroup;
20
21
/** \class cmCPackIFWGenerator
22
* \brief A generator for Qt Installer Framework tools
23
*
24
* http://qt-project.org/doc/qtinstallerframework/index.html
25
*/
26
class cmCPackIFWGenerator
27
: public cmCPackGenerator
28
, public cmCPackIFWCommon
29
{
30
public:
31
cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator);
32
33
using PackagesMap = std::map<std::string, cmCPackIFWPackage>;
34
using RepositoriesMap = std::map<std::string, cmCPackIFWRepository>;
35
using DependenceMap =
36
std::map<std::string, cmCPackIFWPackage::DependenceStruct>;
37
38
using cmCPackIFWCommon::GetOption;
39
using cmCPackIFWCommon::IsOn;
40
using cmCPackIFWCommon::IsSetToOff;
41
using cmCPackIFWCommon::IsSetToEmpty;
42
43
/**
44
* Construct IFW generator
45
*/
46
cmCPackIFWGenerator();
47
48
/**
49
* Destruct IFW generator
50
*/
51
~cmCPackIFWGenerator() override;
52
53
protected:
54
// cmCPackGenerator reimplementation
55
56
/**
57
* @brief Initialize generator
58
* @return 0 on failure
59
*/
60
int InitializeInternal() override;
61
int PackageFiles() override;
62
char const* GetPackagingInstallPrefix() override;
63
64
/**
65
* @brief Target binary extension
66
* @return Executable suffix or disk image format
67
*/
68
char const* GetOutputExtension() override;
69
70
std::string GetComponentInstallSuffix(
71
std::string const& componentName) override;
72
std::string GetComponentInstallDirNameSuffix(
73
std::string const& componentName) override;
74
75
/**
76
* @brief Get Component
77
* @param projectName Project name
78
* @param componentName Component name
79
*
80
* This method calls the base implementation.
81
*
82
* @return Pointer to component
83
*/
84
cmCPackComponent* GetComponent(std::string const& projectName,
85
std::string const& componentName) override;
86
87
/**
88
* @brief Get group of component
89
* @param projectName Project name
90
* @param groupName Component group name
91
*
92
* This method calls the base implementation.
93
*
94
* @return Pointer to component group
95
*/
96
cmCPackComponentGroup* GetComponentGroup(
97
std::string const& projectName, std::string const& groupName) override;
98
99
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir()
100
const override;
101
bool SupportsAbsoluteDestination() const override;
102
bool SupportsComponentInstallation() const override;
103
104
protected:
105
// Methods
106
107
bool IsOnePackage() const;
108
109
std::string GetRootPackageName();
110
111
std::string GetGroupPackageName(cmCPackComponentGroup* group) const;
112
std::string GetComponentPackageName(cmCPackComponent* component) const;
113
114
cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup* group) const;
115
cmCPackIFWPackage* GetComponentPackage(cmCPackComponent* component) const;
116
117
cmCPackIFWRepository* GetRepository(std::string const& repositoryName);
118
119
protected:
120
// Data
121
122
friend class cmCPackIFWPackage;
123
friend class cmCPackIFWCommon;
124
friend class cmCPackIFWInstaller;
125
friend class cmCPackIFWRepository;
126
127
// Installer
128
cmCPackIFWInstaller Installer;
129
// Repository
130
cmCPackIFWRepository Repository;
131
// Collection of packages
132
PackagesMap Packages;
133
// Collection of repositories
134
RepositoriesMap Repositories;
135
// Collection of binary packages
136
std::set<cmCPackIFWPackage*> BinaryPackages;
137
// Collection of downloaded packages
138
std::set<cmCPackIFWPackage*> DownloadedPackages;
139
// Dependent packages
140
DependenceMap DependentPackages;
141
std::map<cmCPackComponent*, cmCPackIFWPackage*> ComponentPackages;
142
std::map<cmCPackComponentGroup*, cmCPackIFWPackage*> GroupPackages;
143
144
private:
145
std::vector<std::string> BuildRepogenCommand();
146
int RunRepogen(std::string const& ifwTmpFile);
147
148
std::vector<std::string> BuildBinaryCreatorCommand();
149
int RunBinaryCreator(std::string const& ifwTmpFile);
150
151
std::string RepoGen;
152
std::string BinCreator;
153
std::string FrameworkVersion;
154
std::string ExecutableSuffix;
155
std::string OutputExtension;
156
std::string ArchiveFormat;
157
std::string ArchiveCompression;
158
159
bool OnlineOnly{};
160
bool ResolveDuplicateNames{};
161
std::vector<std::string> PkgsDirsVector;
162
std::vector<std::string> RepoDirsVector;
163
};
164
165