/* 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 <string>7#include <vector>89class cmCPackComponentGroup;1011/** \class cmCPackInstallationType12* \brief A certain type of installation, which encompasses a13* set of components.14*/15class cmCPackInstallationType16{17public:18/// The name of the installation type (used to reference this19/// installation type).20std::string Name;2122/// The name of the installation type as displayed to the user.23std::string DisplayName;2425/// The index number of the installation type. This is an arbitrary26/// numbering from 1 to the number of installation types.27unsigned Index;28};2930/** \class cmCPackComponent31* \brief A single component to be installed by CPack.32*/33class cmCPackComponent34{35public:36cmCPackComponent()37: IsRequired(true)38, IsHidden(false)39, IsDisabledByDefault(false)40, IsDownloaded(false)41{42}4344/// The name of the component (used to reference the component).45std::string Name;4647/// The name of the component as displayed to the user.48std::string DisplayName;4950/// The component group that contains this component (if any).51cmCPackComponentGroup* Group = nullptr;5253/// Whether this component group must always be installed.54bool IsRequired : 1;5556/// Whether this component group is hidden. A hidden component group57/// is always installed. However, it may still be shown to the user.58bool IsHidden : 1;5960/// Whether this component defaults to "disabled".61bool IsDisabledByDefault : 1;6263/// Whether this component should be downloaded on-the-fly. If false,64/// the component will be a part of the installation package.65bool IsDownloaded : 1;6667/// A description of this component.68std::string Description;6970/// The installation types that this component is a part of.71std::vector<cmCPackInstallationType*> InstallationTypes;7273/// If IsDownloaded is true, the name of the archive file that74/// contains the files that are part of this component.75std::string ArchiveFile;7677/// The file to pass to --component-plist when using the78/// productbuild generator.79std::string Plist;8081/// The components that this component depends on.82std::vector<cmCPackComponent*> Dependencies;8384/// The components that depend on this component.85std::vector<cmCPackComponent*> ReverseDependencies;8687/// The list of installed files that are part of this component.88std::vector<std::string> Files;8990/// The list of installed directories that are part of this component.91std::vector<std::string> Directories;9293/// Get the total installed size of all of the files in this94/// component, in bytes. installDir is the directory into which the95/// component was installed.96unsigned long GetInstalledSize(std::string const& installDir) const;9798/// Identical to GetInstalledSize, but returns the result in99/// kilobytes.100unsigned long GetInstalledSizeInKbytes(std::string const& installDir) const;101102private:103mutable unsigned long TotalSize = 0;104};105106/** \class cmCPackComponentGroup107* \brief A component group to be installed by CPack.108*/109class cmCPackComponentGroup110{111public:112cmCPackComponentGroup()113: IsBold(false)114, IsExpandedByDefault(false)115{116}117118/// The name of the group (used to reference the group).119std::string Name;120121/// The name of the component as displayed to the user.122std::string DisplayName;123124/// The description of this component group.125std::string Description;126127/// Whether the name of the component will be shown in bold.128bool IsBold : 1;129130/// Whether the section should be expanded by default131bool IsExpandedByDefault : 1;132133/// The components within this group.134std::vector<cmCPackComponent*> Components;135136/// The parent group of this component group (if any).137cmCPackComponentGroup* ParentGroup = nullptr;138139/// The subgroups of this group.140std::vector<cmCPackComponentGroup*> Subgroups;141};142143/** \class cmCPackInstallCMakeProject144* \brief A single quadruplet from the CPACK_INSTALL_CMAKE_PROJECTS variable.145*/146class cmCPackInstallCMakeProject147{148public:149/// The directory of the CMake project.150std::string Directory;151152/// The name of the CMake project.153std::string ProjectName;154155/// The name of the component (or component set) to install.156std::string Component;157158/// The subdirectory to install into.159std::string SubDirectory;160161/// The list of installation types.162std::vector<cmCPackInstallationType*> InstallationTypes;163164/// The list of components.165std::vector<cmCPackComponent*> Components;166};167168169