/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying1file LICENSE.rst or https://cmake.org/licensing for details. */2#pragma once34#include "cmConfigure.h" // IWYU pragma: keep56#include <map>7#include <set>8#include <string>9#include <vector>1011#include "cmCPackIFWCommon.h"1213class cmCPackComponent;14class cmCPackComponentGroup;15class cmCPackIFWInstaller;1617/** \class cmCPackIFWPackage18* \brief A single component to be installed by CPack IFW generator19*/20class cmCPackIFWPackage : public cmCPackIFWCommon21{22public:23// Types2425enum CompareTypes26{27CompareNone = 0x0,28CompareEqual = 0x1,29CompareLess = 0x2,30CompareLessOrEqual = 0x3,31CompareGreater = 0x4,32CompareGreaterOrEqual = 0x533};3435struct CompareStruct36{37CompareStruct();3839unsigned int Type;40std::string Value;41};4243struct DependenceStruct44{45DependenceStruct();46explicit DependenceStruct(std::string const& dependence);4748std::string Name;49CompareStruct Compare;5051std::string NameWithCompare() const;5253bool operator<(DependenceStruct const& other) const54{55return this->Name < other.Name;56}57};5859public:60// [Con|De]structor6162/**63* Construct package64*/65cmCPackIFWPackage();6667public:68// Configuration6970/// Human-readable name of the component71std::map<std::string, std::string> DisplayName;7273/// Human-readable description of the component74std::map<std::string, std::string> Description;7576/// Version number of the component77std::string Version;7879/// Date when this component version was released80std::string ReleaseDate;8182/// Domain-like identification for this component83std::string Name;8485/// File name of a script being loaded86std::string Script;8788/// List of license agreements to be accepted by the installing user89std::vector<std::string> Licenses;9091/// List of pages to load92std::vector<std::string> UserInterfaces;9394/// List of translation files to load95std::vector<std::string> Translations;9697/// Priority of the component in the tree98std::string SortingPriority;99100/// Description added to the component description101std::string UpdateText;102103/// Set to true to preselect the component in the installer104std::string Default;105106/// Marks the package as essential to force a restart of the MaintenanceTool107std::string Essential;108109/// Set to true to hide the component from the installer110std::string Virtual;111112/// Determines that the package must always be installed113std::string ForcedInstallation;114115/// List of components to replace116std::vector<std::string> Replaces;117118/// Package needs to be installed with elevated permissions119std::string RequiresAdminRights;120121/// Set to false if you want to hide the checkbox for an item122std::string Checkable;123124public:125// Internal implementation126127std::string GetComponentName(cmCPackComponent* component);128129void DefaultConfiguration();130131int ConfigureFromOptions();132int ConfigureFromComponent(cmCPackComponent* component);133int ConfigureFromGroup(cmCPackComponentGroup* group);134int ConfigureFromGroup(std::string const& groupName);135int ConfigureFromPrefix(std::string const& prefix);136137void GeneratePackageFile();138139// Pointer to installer140cmCPackIFWInstaller* Installer;141// Collection of dependencies142std::set<cmCPackIFWPackage*> Dependencies;143// Collection of unresolved dependencies144std::set<DependenceStruct*> AlienDependencies;145// Collection of unresolved automatic dependency on146std::set<DependenceStruct*> AlienAutoDependOn;147// Patch to package directory148std::string Directory;149};150151152