cmake/Source/CPack/IFW/cmCPackIFWPackage.h

151 lines
3.5 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2015-04-27 22:25:09 +02:00
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
2017-07-20 19:35:53 +02:00
#include <map>
2016-10-30 18:24:19 +01:00
#include <set>
#include <string>
#include <vector>
2015-04-27 22:25:09 +02:00
2020-02-01 23:06:01 +01:00
#include "cmCPackIFWCommon.h"
2015-04-27 22:25:09 +02:00
class cmCPackComponent;
class cmCPackComponentGroup;
2016-10-30 18:24:19 +01:00
class cmCPackIFWInstaller;
2015-04-27 22:25:09 +02:00
/** \class cmCPackIFWPackage
* \brief A single component to be installed by CPack IFW generator
*/
2017-07-20 19:35:53 +02:00
class cmCPackIFWPackage : public cmCPackIFWCommon
2015-04-27 22:25:09 +02:00
{
2016-07-09 11:21:54 +02:00
public:
// Types
2015-04-27 22:25:09 +02:00
enum CompareTypes
{
2016-07-09 11:21:54 +02:00
CompareNone = 0x0,
CompareEqual = 0x1,
CompareLess = 0x2,
CompareLessOrEqual = 0x3,
CompareGreater = 0x4,
2015-04-27 22:25:09 +02:00
CompareGreaterOrEqual = 0x5
};
struct CompareStruct
{
CompareStruct();
unsigned int Type;
std::string Value;
};
struct DependenceStruct
{
DependenceStruct();
2022-03-29 21:10:50 +02:00
explicit DependenceStruct(const std::string& dependence);
2015-04-27 22:25:09 +02:00
std::string Name;
CompareStruct Compare;
std::string NameWithCompare() const;
2016-07-09 11:21:54 +02:00
bool operator<(const DependenceStruct& other) const
{
2021-09-14 00:13:48 +02:00
return this->Name < other.Name;
2016-07-09 11:21:54 +02:00
}
2015-04-27 22:25:09 +02:00
};
2016-07-09 11:21:54 +02:00
public:
// [Con|De]structor
2015-04-27 22:25:09 +02:00
/**
* Construct package
*/
cmCPackIFWPackage();
2016-07-09 11:21:54 +02:00
public:
// Configuration
2015-04-27 22:25:09 +02:00
/// Human-readable name of the component
2017-07-20 19:35:53 +02:00
std::map<std::string, std::string> DisplayName;
2015-04-27 22:25:09 +02:00
/// Human-readable description of the component
2017-07-20 19:35:53 +02:00
std::map<std::string, std::string> Description;
2015-04-27 22:25:09 +02:00
/// Version number of the component
std::string Version;
/// Date when this component version was released
std::string ReleaseDate;
/// Domain-like identification for this component
std::string Name;
/// File name of a script being loaded
std::string Script;
/// List of license agreements to be accepted by the installing user
std::vector<std::string> Licenses;
2016-10-30 18:24:19 +01:00
/// List of pages to load
std::vector<std::string> UserInterfaces;
2017-04-14 19:02:05 +02:00
/// List of translation files to load
std::vector<std::string> Translations;
2015-04-27 22:25:09 +02:00
/// Priority of the component in the tree
std::string SortingPriority;
2017-04-14 19:02:05 +02:00
/// Description added to the component description
std::string UpdateText;
2015-04-27 22:25:09 +02:00
/// Set to true to preselect the component in the installer
std::string Default;
2016-07-09 11:21:54 +02:00
/// Marks the package as essential to force a restart of the MaintenanceTool
std::string Essential;
2015-04-27 22:25:09 +02:00
/// Set to true to hide the component from the installer
std::string Virtual;
/// Determines that the package must always be installed
std::string ForcedInstallation;
2018-01-26 17:06:56 +01:00
/// List of components to replace
std::vector<std::string> Replaces;
2017-04-14 19:02:05 +02:00
/// Package needs to be installed with elevated permissions
std::string RequiresAdminRights;
2018-01-26 17:06:56 +01:00
/// Set to false if you want to hide the checkbox for an item
std::string Checkable;
2016-07-09 11:21:54 +02:00
public:
// Internal implementation
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
std::string GetComponentName(cmCPackComponent* component);
2015-04-27 22:25:09 +02:00
void DefaultConfiguration();
int ConfigureFromOptions();
2016-07-09 11:21:54 +02:00
int ConfigureFromComponent(cmCPackComponent* component);
int ConfigureFromGroup(cmCPackComponentGroup* group);
int ConfigureFromGroup(const std::string& groupName);
2017-04-14 19:02:05 +02:00
int ConfigureFromPrefix(const std::string& prefix);
2015-04-27 22:25:09 +02:00
void GeneratePackageFile();
// Pointer to installer
cmCPackIFWInstaller* Installer;
// Collection of dependencies
std::set<cmCPackIFWPackage*> Dependencies;
// Collection of unresolved dependencies
std::set<DependenceStruct*> AlienDependencies;
2017-04-14 19:02:05 +02:00
// Collection of unresolved automatic dependency on
std::set<DependenceStruct*> AlienAutoDependOn;
2015-04-27 22:25:09 +02:00
// Patch to package directory
std::string Directory;
};