86578eccf2
Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
143 lines
3.9 KiB
C++
143 lines
3.9 KiB
C++
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
#ifndef cmCPackComponentGroup_h
|
|
#define cmCPackComponentGroup_h
|
|
|
|
#include <cmConfigure.h>
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class cmCPackComponentGroup;
|
|
|
|
/** \class cmCPackInstallationType
|
|
* \brief A certain type of installation, which encompasses a
|
|
* set of components.
|
|
*/
|
|
class cmCPackInstallationType
|
|
{
|
|
public:
|
|
/// The name of the installation type (used to reference this
|
|
/// installation type).
|
|
std::string Name;
|
|
|
|
/// The name of the installation type as displayed to the user.
|
|
std::string DisplayName;
|
|
|
|
/// The index number of the installation type. This is an arbitrary
|
|
/// numbering from 1 to the number of installation types.
|
|
unsigned Index;
|
|
};
|
|
|
|
/** \class cmCPackComponent
|
|
* \brief A single component to be installed by CPack.
|
|
*/
|
|
class cmCPackComponent
|
|
{
|
|
public:
|
|
cmCPackComponent()
|
|
: Group(CM_NULLPTR)
|
|
, IsRequired(true)
|
|
, IsHidden(false)
|
|
, IsDisabledByDefault(false)
|
|
, IsDownloaded(false)
|
|
, TotalSize(0)
|
|
{
|
|
}
|
|
|
|
/// The name of the component (used to reference the component).
|
|
std::string Name;
|
|
|
|
/// The name of the component as displayed to the user.
|
|
std::string DisplayName;
|
|
|
|
/// The component group that contains this component (if any).
|
|
cmCPackComponentGroup* Group;
|
|
|
|
/// Whether this component group must always be installed.
|
|
bool IsRequired : 1;
|
|
|
|
/// Whether this component group is hidden. A hidden component group
|
|
/// is always installed. However, it may still be shown to the user.
|
|
bool IsHidden : 1;
|
|
|
|
/// Whether this component defaults to "disabled".
|
|
bool IsDisabledByDefault : 1;
|
|
|
|
/// Whether this component should be downloaded on-the-fly. If false,
|
|
/// the component will be a part of the installation package.
|
|
bool IsDownloaded : 1;
|
|
|
|
/// A description of this component.
|
|
std::string Description;
|
|
|
|
/// The installation types that this component is a part of.
|
|
std::vector<cmCPackInstallationType*> InstallationTypes;
|
|
|
|
/// If IsDownloaded is true, the name of the archive file that
|
|
/// contains the files that are part of this component.
|
|
std::string ArchiveFile;
|
|
|
|
/// The components that this component depends on.
|
|
std::vector<cmCPackComponent*> Dependencies;
|
|
|
|
/// The components that depend on this component.
|
|
std::vector<cmCPackComponent*> ReverseDependencies;
|
|
|
|
/// The list of installed files that are part of this component.
|
|
std::vector<std::string> Files;
|
|
|
|
/// The list of installed directories that are part of this component.
|
|
std::vector<std::string> Directories;
|
|
|
|
/// Get the total installed size of all of the files in this
|
|
/// component, in bytes. installDir is the directory into which the
|
|
/// component was installed.
|
|
unsigned long GetInstalledSize(const std::string& installDir) const;
|
|
|
|
/// Identical to GetInstalledSize, but returns the result in
|
|
/// kilobytes.
|
|
unsigned long GetInstalledSizeInKbytes(const std::string& installDir) const;
|
|
|
|
private:
|
|
mutable unsigned long TotalSize;
|
|
};
|
|
|
|
/** \class cmCPackComponentGroup
|
|
* \brief A component group to be installed by CPack.
|
|
*/
|
|
class cmCPackComponentGroup
|
|
{
|
|
public:
|
|
cmCPackComponentGroup()
|
|
: ParentGroup(CM_NULLPTR)
|
|
{
|
|
}
|
|
|
|
/// The name of the group (used to reference the group).
|
|
std::string Name;
|
|
|
|
/// The name of the component as displayed to the user.
|
|
std::string DisplayName;
|
|
|
|
/// The description of this component group.
|
|
std::string Description;
|
|
|
|
/// Whether the name of the component will be shown in bold.
|
|
bool IsBold : 1;
|
|
|
|
/// Whether the section should be expanded by default
|
|
bool IsExpandedByDefault : 1;
|
|
|
|
/// The components within this group.
|
|
std::vector<cmCPackComponent*> Components;
|
|
|
|
/// The parent group of this component group (if any).
|
|
cmCPackComponentGroup* ParentGroup;
|
|
|
|
/// The subgroups of this group.
|
|
std::vector<cmCPackComponentGroup*> Subgroups;
|
|
};
|
|
|
|
#endif
|