cmCPackGenerator::GetOption returns cmProp

This commit is contained in:
Marc Chevrier
2021-09-05 15:44:04 +02:00
committed by Brad King
parent 9488f8a7b7
commit 202a65759b
26 changed files with 462 additions and 494 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ cmCPackIFWCommon::cmCPackIFWCommon()
{ {
} }
const char* cmCPackIFWCommon::GetOption(const std::string& op) const cmProp cmCPackIFWCommon::GetOption(const std::string& op) const
{ {
return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op) return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op)
: nullptr; : nullptr;
+3 -1
View File
@@ -7,6 +7,8 @@
#include <map> #include <map>
#include <string> #include <string>
#include "cmProperty.h"
class cmCPackIFWGenerator; class cmCPackIFWGenerator;
class cmXMLWriter; class cmXMLWriter;
@@ -26,7 +28,7 @@ public:
public: public:
// Internal implementation // Internal implementation
const char* GetOption(const std::string& op) const; cmProp GetOption(const std::string& op) const;
bool IsOn(const std::string& op) const; bool IsOn(const std::string& op) const;
bool IsSetToOff(const std::string& op) const; bool IsSetToOff(const std::string& op) const;
bool IsSetToEmpty(const std::string& op) const; bool IsSetToEmpty(const std::string& op) const;
+27 -30
View File
@@ -14,6 +14,7 @@
#include "cmCPackLog.h" // IWYU pragma: keep #include "cmCPackLog.h" // IWYU pragma: keep
#include "cmDuration.h" #include "cmDuration.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -250,7 +251,7 @@ const char* cmCPackIFWGenerator::GetPackagingInstallPrefix()
this->SetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX", tmpPref.c_str()); this->SetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX", tmpPref.c_str());
return this->GetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX"); return this->GetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX")->c_str();
} }
const char* cmCPackIFWGenerator::GetOutputExtension() const char* cmCPackIFWGenerator::GetOutputExtension()
@@ -273,11 +274,11 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'binarycreator' executable (needs) // Look 'binarycreator' executable (needs)
const char* BinCreatorStr = this->GetOption(BinCreatorOpt); cmProp BinCreatorStr = this->GetOption(BinCreatorOpt);
if (!BinCreatorStr || cmIsNOTFOUND(BinCreatorStr)) { if (!BinCreatorStr || cmIsNOTFOUND(BinCreatorStr)) {
this->BinCreator.clear(); this->BinCreator.clear();
} else { } else {
this->BinCreator = BinCreatorStr; this->BinCreator = *BinCreatorStr;
} }
if (this->BinCreator.empty()) { if (this->BinCreator.empty()) {
@@ -290,16 +291,16 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'repogen' executable (optional) // Look 'repogen' executable (optional)
const char* RepoGenStr = this->GetOption(RepoGenOpt); cmProp repoGen = this->GetOption(RepoGenOpt);
if (!RepoGenStr || cmIsNOTFOUND(RepoGenStr)) { if (!repoGen || cmIsNOTFOUND(repoGen)) {
this->RepoGen.clear(); this->RepoGen.clear();
} else { } else {
this->RepoGen = RepoGenStr; this->RepoGen = *repoGen;
} }
// Framework version // Framework version
if (const char* FrameworkVersionSrt = this->GetOption(FrameworkVersionOpt)) { if (cmProp frameworkVersion = this->GetOption(FrameworkVersionOpt)) {
this->FrameworkVersion = FrameworkVersionSrt; this->FrameworkVersion = *frameworkVersion;
} else { } else {
this->FrameworkVersion = "1.9.9"; this->FrameworkVersion = "1.9.9";
} }
@@ -312,14 +313,13 @@ int cmCPackIFWGenerator::InitializeInternal()
// Additional packages dirs // Additional packages dirs
this->PkgsDirsVector.clear(); this->PkgsDirsVector.clear();
if (const char* dirs = this->GetOption("CPACK_IFW_PACKAGES_DIRECTORIES")) { if (cmProp dirs = this->GetOption("CPACK_IFW_PACKAGES_DIRECTORIES")) {
cmExpandList(dirs, this->PkgsDirsVector); cmExpandList(dirs, this->PkgsDirsVector);
} }
// Additional repositories dirs // Additional repositories dirs
this->RepoDirsVector.clear(); this->RepoDirsVector.clear();
if (const char* dirs = if (cmProp dirs = this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
cmExpandList(dirs, this->RepoDirsVector); cmExpandList(dirs, this->RepoDirsVector);
} }
@@ -330,23 +330,22 @@ int cmCPackIFWGenerator::InitializeInternal()
// Repository // Repository
this->Repository.Generator = this; this->Repository.Generator = this;
this->Repository.Name = "Unspecified"; this->Repository.Name = "Unspecified";
if (const char* site = this->GetOption("CPACK_DOWNLOAD_SITE")) { if (cmProp site = this->GetOption("CPACK_DOWNLOAD_SITE")) {
this->Repository.Url = site; this->Repository.Url = *site;
this->Installer.RemoteRepositories.push_back(&this->Repository); this->Installer.RemoteRepositories.push_back(&this->Repository);
} }
// Repositories // Repositories
if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) { if (cmProp RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) {
std::vector<std::string> RepoAllVector = cmExpandedList(RepoAllStr); std::vector<std::string> RepoAllVector = cmExpandedList(RepoAllStr);
for (std::string const& r : RepoAllVector) { for (std::string const& r : RepoAllVector) {
this->GetRepository(r); this->GetRepository(r);
} }
} }
if (const char* ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) { if (cmProp ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) {
this->OnlineOnly = cmIsOn(ifwDownloadAll); this->OnlineOnly = cmIsOn(ifwDownloadAll);
} else if (const char* cpackDownloadAll = } else if (cmProp cpackDownloadAll = this->GetOption("CPACK_DOWNLOAD_ALL")) {
this->GetOption("CPACK_DOWNLOAD_ALL")) {
this->OnlineOnly = cmIsOn(cpackDownloadAll); this->OnlineOnly = cmIsOn(cpackDownloadAll);
} else { } else {
this->OnlineOnly = false; this->OnlineOnly = false;
@@ -374,9 +373,8 @@ int cmCPackIFWGenerator::InitializeInternal()
} }
// Output extension // Output extension
if (const char* optOutExt = if (cmProp optOutExt = this->GetOption("CPACK_IFW_PACKAGE_FILE_EXTENSION")) {
this->GetOption("CPACK_IFW_PACKAGE_FILE_EXTENSION")) { this->OutputExtension = *optOutExt;
this->OutputExtension = optOutExt;
} else if (sysName == "Darwin") { } else if (sysName == "Darwin") {
this->OutputExtension = ".dmg"; this->OutputExtension = ".dmg";
} else { } else {
@@ -508,21 +506,20 @@ std::string cmCPackIFWGenerator::GetRootPackageName()
{ {
// Default value // Default value
std::string name = "root"; std::string name = "root";
if (const char* optIFW_PACKAGE_GROUP = if (cmProp optIFW_PACKAGE_GROUP =
this->GetOption("CPACK_IFW_PACKAGE_GROUP")) { this->GetOption("CPACK_IFW_PACKAGE_GROUP")) {
// Configure from root group // Configure from root group
cmCPackIFWPackage package; cmCPackIFWPackage package;
package.Generator = this; package.Generator = this;
package.ConfigureFromGroup(optIFW_PACKAGE_GROUP); package.ConfigureFromGroup(optIFW_PACKAGE_GROUP);
name = package.Name; name = package.Name;
} else if (const char* optIFW_PACKAGE_NAME = } else if (cmProp optIFW_PACKAGE_NAME =
this->GetOption("CPACK_IFW_PACKAGE_NAME")) { this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
// Configure from root package name // Configure from root package name
name = optIFW_PACKAGE_NAME; name = *optIFW_PACKAGE_NAME;
} else if (const char* optPACKAGE_NAME = } else if (cmProp optPACKAGE_NAME = this->GetOption("CPACK_PACKAGE_NAME")) {
this->GetOption("CPACK_PACKAGE_NAME")) {
// Configure from package name // Configure from package name
name = optPACKAGE_NAME; name = *optPACKAGE_NAME;
} }
return name; return name;
} }
@@ -537,10 +534,10 @@ std::string cmCPackIFWGenerator::GetGroupPackageName(
if (cmCPackIFWPackage* package = this->GetGroupPackage(group)) { if (cmCPackIFWPackage* package = this->GetGroupPackage(group)) {
return package->Name; return package->Name;
} }
const char* option = cmProp option =
this->GetOption("CPACK_IFW_COMPONENT_GROUP_" + this->GetOption("CPACK_IFW_COMPONENT_GROUP_" +
cmsys::SystemTools::UpperCase(group->Name) + "_NAME"); cmsys::SystemTools::UpperCase(group->Name) + "_NAME");
name = option ? option : group->Name; name = option ? *option : group->Name;
if (group->ParentGroup) { if (group->ParentGroup) {
cmCPackIFWPackage* package = this->GetGroupPackage(group->ParentGroup); cmCPackIFWPackage* package = this->GetGroupPackage(group->ParentGroup);
bool dot = !this->ResolveDuplicateNames; bool dot = !this->ResolveDuplicateNames;
@@ -563,8 +560,8 @@ std::string cmCPackIFWGenerator::GetComponentPackageName(
} }
std::string prefix = "CPACK_IFW_COMPONENT_" + std::string prefix = "CPACK_IFW_COMPONENT_" +
cmsys::SystemTools::UpperCase(component->Name) + "_"; cmsys::SystemTools::UpperCase(component->Name) + "_";
const char* option = this->GetOption(prefix + "NAME"); cmProp option = this->GetOption(prefix + "NAME");
name = option ? option : component->Name; name = option ? *option : component->Name;
if (component->Group) { if (component->Group) {
cmCPackIFWPackage* package = this->GetGroupPackage(component->Group); cmCPackIFWPackage* package = this->GetGroupPackage(component->Group);
if ((this->componentPackageMethod == if ((this->componentPackageMethod ==
+55 -57
View File
@@ -12,6 +12,7 @@
#include "cmCPackIFWRepository.h" #include "cmCPackIFWRepository.h"
#include "cmCPackLog.h" // IWYU pragma: keep #include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmXMLParser.h" #include "cmXMLParser.h"
@@ -33,61 +34,59 @@ void cmCPackIFWInstaller::printSkippedOptionWarning(
void cmCPackIFWInstaller::ConfigureFromOptions() void cmCPackIFWInstaller::ConfigureFromOptions()
{ {
// Name; // Name;
if (const char* optIFW_PACKAGE_NAME = if (cmProp optIFW_PACKAGE_NAME = this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
this->GetOption("CPACK_IFW_PACKAGE_NAME")) { this->Name = *optIFW_PACKAGE_NAME;
this->Name = optIFW_PACKAGE_NAME; } else if (cmProp optPACKAGE_NAME = this->GetOption("CPACK_PACKAGE_NAME")) {
} else if (const char* optPACKAGE_NAME = this->Name = *optPACKAGE_NAME;
this->GetOption("CPACK_PACKAGE_NAME")) {
this->Name = optPACKAGE_NAME;
} else { } else {
this->Name = "Your package"; this->Name = "Your package";
} }
// Title; // Title;
if (const char* optIFW_PACKAGE_TITLE = if (cmProp optIFW_PACKAGE_TITLE =
this->GetOption("CPACK_IFW_PACKAGE_TITLE")) { this->GetOption("CPACK_IFW_PACKAGE_TITLE")) {
this->Title = optIFW_PACKAGE_TITLE; this->Title = *optIFW_PACKAGE_TITLE;
} else if (const char* optPACKAGE_DESCRIPTION_SUMMARY = } else if (cmProp optPACKAGE_DESCRIPTION_SUMMARY =
this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) { this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
this->Title = optPACKAGE_DESCRIPTION_SUMMARY; this->Title = *optPACKAGE_DESCRIPTION_SUMMARY;
} else { } else {
this->Title = "Your package description"; this->Title = "Your package description";
} }
// Version; // Version;
if (const char* option = this->GetOption("CPACK_PACKAGE_VERSION")) { if (cmProp option = this->GetOption("CPACK_PACKAGE_VERSION")) {
this->Version = option; this->Version = *option;
} else { } else {
this->Version = "1.0.0"; this->Version = "1.0.0";
} }
// Publisher // Publisher
if (const char* optIFW_PACKAGE_PUBLISHER = if (cmProp optIFW_PACKAGE_PUBLISHER =
this->GetOption("CPACK_IFW_PACKAGE_PUBLISHER")) { this->GetOption("CPACK_IFW_PACKAGE_PUBLISHER")) {
this->Publisher = optIFW_PACKAGE_PUBLISHER; this->Publisher = *optIFW_PACKAGE_PUBLISHER;
} else if (const char* optPACKAGE_VENDOR = } else if (cmProp optPACKAGE_VENDOR =
this->GetOption("CPACK_PACKAGE_VENDOR")) { this->GetOption("CPACK_PACKAGE_VENDOR")) {
this->Publisher = optPACKAGE_VENDOR; this->Publisher = *optPACKAGE_VENDOR;
} }
// ProductUrl // ProductUrl
if (const char* option = this->GetOption("CPACK_IFW_PRODUCT_URL")) { if (cmProp option = this->GetOption("CPACK_IFW_PRODUCT_URL")) {
this->ProductUrl = option; this->ProductUrl = *option;
} }
// ApplicationIcon // ApplicationIcon
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_ICON")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_ICON")) {
if (cmSystemTools::FileExists(option)) { if (cmSystemTools::FileExists(option)) {
this->InstallerApplicationIcon = option; this->InstallerApplicationIcon = *option;
} else { } else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", option); this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", option);
} }
} }
// WindowIcon // WindowIcon
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_WINDOW_ICON")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_WINDOW_ICON")) {
if (cmSystemTools::FileExists(option)) { if (cmSystemTools::FileExists(option)) {
this->InstallerWindowIcon = option; this->InstallerWindowIcon = *option;
} else { } else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", option); this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", option);
} }
@@ -103,45 +102,45 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
} }
// Logo // Logo
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) {
if (cmSystemTools::FileExists(option)) { if (cmSystemTools::FileExists(option)) {
this->Logo = option; this->Logo = *option;
} else { } else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", option); this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", option);
} }
} }
// Watermark // Watermark
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_WATERMARK")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_WATERMARK")) {
if (cmSystemTools::FileExists(option)) { if (cmSystemTools::FileExists(option)) {
this->Watermark = option; this->Watermark = *option;
} else { } else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", option); this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", option);
} }
} }
// Banner // Banner
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_BANNER")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_BANNER")) {
if (cmSystemTools::FileExists(option)) { if (cmSystemTools::FileExists(option)) {
this->Banner = option; this->Banner = *option;
} else { } else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", option); this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", option);
} }
} }
// Background // Background
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) {
if (cmSystemTools::FileExists(option)) { if (cmSystemTools::FileExists(option)) {
this->Background = option; this->Background = *option;
} else { } else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", option); this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", option);
} }
} }
// WizardStyle // WizardStyle
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_WIZARD_STYLE")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_WIZARD_STYLE")) {
// Setting the user value in any case // Setting the user value in any case
this->WizardStyle = option; this->WizardStyle = *option;
// Check known values // Check known values
if (this->WizardStyle != "Modern" && this->WizardStyle != "Aero" && if (this->WizardStyle != "Modern" && this->WizardStyle != "Aero" &&
this->WizardStyle != "Mac" && this->WizardStyle != "Classic") { this->WizardStyle != "Mac" && this->WizardStyle != "Classic") {
@@ -154,28 +153,28 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
} }
// StyleSheet // StyleSheet
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_STYLE_SHEET")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_STYLE_SHEET")) {
if (cmSystemTools::FileExists(option)) { if (cmSystemTools::FileExists(option)) {
this->StyleSheet = option; this->StyleSheet = *option;
} else { } else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_STYLE_SHEET", option); this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_STYLE_SHEET", option);
} }
} }
// WizardDefaultWidth // WizardDefaultWidth
if (const char* option = if (cmProp option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH")) { this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH")) {
this->WizardDefaultWidth = option; this->WizardDefaultWidth = *option;
} }
// WizardDefaultHeight // WizardDefaultHeight
if (const char* option = if (cmProp option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT")) { this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT")) {
this->WizardDefaultHeight = option; this->WizardDefaultHeight = *option;
} }
// WizardShowPageList // WizardShowPageList
if (const char* option = if (cmProp option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) { this->GetOption("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
if (!this->IsVersionLess("4.0")) { if (!this->IsVersionLess("4.0")) {
if (this->IsSetToOff("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) { if (this->IsSetToOff("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
@@ -204,23 +203,23 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
} }
// TitleColor // TitleColor
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) {
this->TitleColor = option; this->TitleColor = *option;
} }
// Start menu // Start menu
if (const char* optIFW_START_MENU_DIR = if (cmProp optIFW_START_MENU_DIR =
this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) { this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) {
this->StartMenuDir = optIFW_START_MENU_DIR; this->StartMenuDir = *optIFW_START_MENU_DIR;
} else { } else {
this->StartMenuDir = this->Name; this->StartMenuDir = this->Name;
} }
// Default target directory for installation // Default target directory for installation
if (const char* optIFW_TARGET_DIRECTORY = if (cmProp optIFW_TARGET_DIRECTORY =
this->GetOption("CPACK_IFW_TARGET_DIRECTORY")) { this->GetOption("CPACK_IFW_TARGET_DIRECTORY")) {
this->TargetDir = optIFW_TARGET_DIRECTORY; this->TargetDir = *optIFW_TARGET_DIRECTORY;
} else if (const char* optPACKAGE_INSTALL_DIRECTORY = } else if (cmProp optPACKAGE_INSTALL_DIRECTORY =
this->GetOption("CPACK_PACKAGE_INSTALL_DIRECTORY")) { this->GetOption("CPACK_PACKAGE_INSTALL_DIRECTORY")) {
this->TargetDir = this->TargetDir =
cmStrCat("@ApplicationsDir@/", optPACKAGE_INSTALL_DIRECTORY); cmStrCat("@ApplicationsDir@/", optPACKAGE_INSTALL_DIRECTORY);
@@ -229,21 +228,20 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
} }
// Default target directory for installation with administrator rights // Default target directory for installation with administrator rights
if (const char* option = if (cmProp option = this->GetOption("CPACK_IFW_ADMIN_TARGET_DIRECTORY")) {
this->GetOption("CPACK_IFW_ADMIN_TARGET_DIRECTORY")) { this->AdminTargetDir = *option;
this->AdminTargetDir = option;
} }
// Maintenance tool // Maintenance tool
if (const char* optIFW_MAINTENANCE_TOOL = if (cmProp optIFW_MAINTENANCE_TOOL =
this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME")) { this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME")) {
this->MaintenanceToolName = optIFW_MAINTENANCE_TOOL; this->MaintenanceToolName = *optIFW_MAINTENANCE_TOOL;
} }
// Maintenance tool ini file // Maintenance tool ini file
if (const char* optIFW_MAINTENANCE_TOOL_INI = if (cmProp optIFW_MAINTENANCE_TOOL_INI =
this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE")) { this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE")) {
this->MaintenanceToolIniFile = optIFW_MAINTENANCE_TOOL_INI; this->MaintenanceToolIniFile = *optIFW_MAINTENANCE_TOOL_INI;
} }
// Allow non-ASCII characters // Allow non-ASCII characters
@@ -265,13 +263,13 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
} }
// Control script // Control script
if (const char* optIFW_CONTROL_SCRIPT = if (cmProp optIFW_CONTROL_SCRIPT =
this->GetOption("CPACK_IFW_PACKAGE_CONTROL_SCRIPT")) { this->GetOption("CPACK_IFW_PACKAGE_CONTROL_SCRIPT")) {
this->ControlScript = optIFW_CONTROL_SCRIPT; this->ControlScript = *optIFW_CONTROL_SCRIPT;
} }
// Resources // Resources
if (const char* optIFW_PACKAGE_RESOURCES = if (cmProp optIFW_PACKAGE_RESOURCES =
this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) { this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) {
this->Resources.clear(); this->Resources.clear();
cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources); cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
@@ -541,7 +539,7 @@ void cmCPackIFWInstaller::GeneratePackageFiles()
package.Generator = this->Generator; package.Generator = this->Generator;
package.Installer = this; package.Installer = this;
// Check package group // Check package group
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_GROUP")) { if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_GROUP")) {
package.ConfigureFromGroup(option); package.ConfigureFromGroup(option);
std::string forcedOption = "CPACK_IFW_COMPONENT_GROUP_" + std::string forcedOption = "CPACK_IFW_COMPONENT_GROUP_" +
cmsys::SystemTools::UpperCase(option) + "_FORCED_INSTALLATION"; cmsys::SystemTools::UpperCase(option) + "_FORCED_INSTALLATION";
+48 -48
View File
@@ -15,6 +15,7 @@
#include "cmCPackIFWInstaller.h" #include "cmCPackIFWInstaller.h"
#include "cmCPackLog.h" // IWYU pragma: keep #include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmTimestamp.h" #include "cmTimestamp.h"
@@ -124,10 +125,10 @@ std::string cmCPackIFWPackage::GetComponentName(cmCPackComponent* component)
if (!component) { if (!component) {
return ""; return "";
} }
const char* option = cmProp option =
this->GetOption("CPACK_IFW_COMPONENT_" + this->GetOption("CPACK_IFW_COMPONENT_" +
cmsys::SystemTools::UpperCase(component->Name) + "_NAME"); cmsys::SystemTools::UpperCase(component->Name) + "_NAME");
return option ? option : component->Name; return option ? *option : component->Name;
} }
void cmCPackIFWPackage::DefaultConfiguration() void cmCPackIFWPackage::DefaultConfiguration()
@@ -159,23 +160,22 @@ int cmCPackIFWPackage::ConfigureFromOptions()
this->Name = this->Generator->GetRootPackageName(); this->Name = this->Generator->GetRootPackageName();
// Display name // Display name
if (const char* option = this->GetOption("CPACK_PACKAGE_NAME")) { if (cmProp option = this->GetOption("CPACK_PACKAGE_NAME")) {
this->DisplayName[""] = option; this->DisplayName[""] = *option;
} else { } else {
this->DisplayName[""] = "Your package"; this->DisplayName[""] = "Your package";
} }
// Description // Description
if (const char* option = if (cmProp option = this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) { this->Description[""] = *option;
this->Description[""] = option;
} else { } else {
this->Description[""] = "Your package description"; this->Description[""] = "Your package description";
} }
// Version // Version
if (const char* option = this->GetOption("CPACK_PACKAGE_VERSION")) { if (cmProp option = this->GetOption("CPACK_PACKAGE_VERSION")) {
this->Version = option; this->Version = *option;
} else { } else {
this->Version = "1.0.0"; this->Version = "1.0.0";
} }
@@ -204,22 +204,22 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
this->Description[""] = component->Description; this->Description[""] = component->Description;
// Version // Version
if (const char* optVERSION = this->GetOption(prefix + "VERSION")) { if (cmProp optVERSION = this->GetOption(prefix + "VERSION")) {
this->Version = optVERSION; this->Version = *optVERSION;
} else if (const char* optPACKAGE_VERSION = } else if (cmProp optPACKAGE_VERSION =
this->GetOption("CPACK_PACKAGE_VERSION")) { this->GetOption("CPACK_PACKAGE_VERSION")) {
this->Version = optPACKAGE_VERSION; this->Version = *optPACKAGE_VERSION;
} else { } else {
this->Version = "1.0.0"; this->Version = "1.0.0";
} }
// Script // Script
if (const char* option = this->GetOption(prefix + "SCRIPT")) { if (cmProp option = this->GetOption(prefix + "SCRIPT")) {
this->Script = option; this->Script = *option;
} }
// User interfaces // User interfaces
if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) { if (cmProp option = this->GetOption(prefix + "USER_INTERFACES")) {
this->UserInterfaces.clear(); this->UserInterfaces.clear();
cmExpandList(option, this->UserInterfaces); cmExpandList(option, this->UserInterfaces);
} }
@@ -232,7 +232,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
} }
// Licenses // Licenses
if (const char* option = this->GetOption(prefix + "LICENSES")) { if (cmProp option = this->GetOption(prefix + "LICENSES")) {
this->Licenses.clear(); this->Licenses.clear();
cmExpandList(option, this->Licenses); cmExpandList(option, this->Licenses);
if (this->Licenses.size() % 2 != 0) { if (this->Licenses.size() % 2 != 0) {
@@ -246,8 +246,8 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
} }
// Priority // Priority
if (const char* option = this->GetOption(prefix + "PRIORITY")) { if (cmProp option = this->GetOption(prefix + "PRIORITY")) {
this->SortingPriority = option; this->SortingPriority = *option;
cmCPackIFWLogger( cmCPackIFWLogger(
WARNING, WARNING,
"The \"PRIORITY\" option is set " "The \"PRIORITY\" option is set "
@@ -289,28 +289,28 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
this->Description[""] = group->Description; this->Description[""] = group->Description;
// Version // Version
if (const char* optVERSION = this->GetOption(prefix + "VERSION")) { if (cmProp optVERSION = this->GetOption(prefix + "VERSION")) {
this->Version = optVERSION; this->Version = *optVERSION;
} else if (const char* optPACKAGE_VERSION = } else if (cmProp optPACKAGE_VERSION =
this->GetOption("CPACK_PACKAGE_VERSION")) { this->GetOption("CPACK_PACKAGE_VERSION")) {
this->Version = optPACKAGE_VERSION; this->Version = *optPACKAGE_VERSION;
} else { } else {
this->Version = "1.0.0"; this->Version = "1.0.0";
} }
// Script // Script
if (const char* option = this->GetOption(prefix + "SCRIPT")) { if (cmProp option = this->GetOption(prefix + "SCRIPT")) {
this->Script = option; this->Script = *option;
} }
// User interfaces // User interfaces
if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) { if (cmProp option = this->GetOption(prefix + "USER_INTERFACES")) {
this->UserInterfaces.clear(); this->UserInterfaces.clear();
cmExpandList(option, this->UserInterfaces); cmExpandList(option, this->UserInterfaces);
} }
// Licenses // Licenses
if (const char* option = this->GetOption(prefix + "LICENSES")) { if (cmProp option = this->GetOption(prefix + "LICENSES")) {
this->Licenses.clear(); this->Licenses.clear();
cmExpandList(option, this->Licenses); cmExpandList(option, this->Licenses);
if (this->Licenses.size() % 2 != 0) { if (this->Licenses.size() % 2 != 0) {
@@ -324,8 +324,8 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
} }
// Priority // Priority
if (const char* option = this->GetOption(prefix + "PRIORITY")) { if (cmProp option = this->GetOption(prefix + "PRIORITY")) {
this->SortingPriority = option; this->SortingPriority = *option;
cmCPackIFWLogger( cmCPackIFWLogger(
WARNING, WARNING,
"The \"PRIORITY\" option is set " "The \"PRIORITY\" option is set "
@@ -346,14 +346,14 @@ int cmCPackIFWPackage::ConfigureFromGroup(const std::string& groupName)
std::string prefix = std::string prefix =
"CPACK_COMPONENT_GROUP_" + cmsys::SystemTools::UpperCase(groupName) + "_"; "CPACK_COMPONENT_GROUP_" + cmsys::SystemTools::UpperCase(groupName) + "_";
if (const char* option = this->GetOption(prefix + "DISPLAY_NAME")) { if (cmProp option = this->GetOption(prefix + "DISPLAY_NAME")) {
group.DisplayName = option; group.DisplayName = *option;
} else { } else {
group.DisplayName = group.Name; group.DisplayName = group.Name;
} }
if (const char* option = this->GetOption(prefix + "DESCRIPTION")) { if (cmProp option = this->GetOption(prefix + "DESCRIPTION")) {
group.Description = option; group.Description = *option;
} }
group.IsBold = this->IsOn(prefix + "BOLD_TITLE"); group.IsBold = this->IsOn(prefix + "BOLD_TITLE");
group.IsExpandedByDefault = this->IsOn(prefix + "EXPANDED"); group.IsExpandedByDefault = this->IsOn(prefix + "EXPANDED");
@@ -381,7 +381,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DISPLAY_NAME"; option = prefix + "DISPLAY_NAME";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->DisplayName.clear(); this->DisplayName.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
cmCPackIFWPackage::ExpandListArgument(value, this->DisplayName); cmCPackIFWPackage::ExpandListArgument(value, this->DisplayName);
} }
@@ -389,7 +389,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DESCRIPTION"; option = prefix + "DESCRIPTION";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->Description.clear(); this->Description.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
cmCPackIFWPackage::ExpandListArgument(value, this->Description); cmCPackIFWPackage::ExpandListArgument(value, this->Description);
} }
@@ -397,31 +397,31 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "RELEASE_DATE"; option = prefix + "RELEASE_DATE";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->ReleaseDate.clear(); this->ReleaseDate.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
this->ReleaseDate = value; this->ReleaseDate = *value;
} }
// Sorting priority // Sorting priority
option = prefix + "SORTING_PRIORITY"; option = prefix + "SORTING_PRIORITY";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->SortingPriority.clear(); this->SortingPriority.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
this->SortingPriority = value; this->SortingPriority = *value;
} }
// Update text // Update text
option = prefix + "UPDATE_TEXT"; option = prefix + "UPDATE_TEXT";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->UpdateText.clear(); this->UpdateText.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
this->UpdateText = value; this->UpdateText = *value;
} }
// Translations // Translations
option = prefix + "TRANSLATIONS"; option = prefix + "TRANSLATIONS";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->Translations.clear(); this->Translations.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
this->Translations.clear(); this->Translations.clear();
cmExpandList(value, this->Translations); cmExpandList(value, this->Translations);
} }
@@ -429,11 +429,11 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
// QtIFW dependencies // QtIFW dependencies
std::vector<std::string> deps; std::vector<std::string> deps;
option = prefix + "DEPENDS"; option = prefix + "DEPENDS";
if (const char* value = this->GetOption(option)) { if (cmProp value = this->GetOption(option)) {
cmExpandList(value, deps); cmExpandList(value, deps);
} }
option = prefix + "DEPENDENCIES"; option = prefix + "DEPENDENCIES";
if (const char* value = this->GetOption(option)) { if (cmProp value = this->GetOption(option)) {
cmExpandList(value, deps); cmExpandList(value, deps);
} }
for (std::string const& d : deps) { for (std::string const& d : deps) {
@@ -454,7 +454,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "AUTO_DEPEND_ON"; option = prefix + "AUTO_DEPEND_ON";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->AlienAutoDependOn.clear(); this->AlienAutoDependOn.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
std::vector<std::string> depsOn = cmExpandedList(value); std::vector<std::string> depsOn = cmExpandedList(value);
for (std::string const& d : depsOn) { for (std::string const& d : depsOn) {
DependenceStruct dep(d); DependenceStruct dep(d);
@@ -483,7 +483,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DEFAULT"; option = prefix + "DEFAULT";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->Default.clear(); this->Default.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
std::string lowerValue = cmsys::SystemTools::LowerCase(value); std::string lowerValue = cmsys::SystemTools::LowerCase(value);
if (lowerValue == "true") { if (lowerValue == "true") {
this->Default = "true"; this->Default = "true";
@@ -492,7 +492,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
} else if (lowerValue == "script") { } else if (lowerValue == "script") {
this->Default = "script"; this->Default = "script";
} else { } else {
this->Default = value; this->Default = *value;
} }
} }
@@ -510,7 +510,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "REPLACES"; option = prefix + "REPLACES";
if (this->IsSetToEmpty(option)) { if (this->IsSetToEmpty(option)) {
this->Replaces.clear(); this->Replaces.clear();
} else if (const char* value = this->GetOption(option)) { } else if (cmProp value = this->GetOption(option)) {
this->Replaces.clear(); this->Replaces.clear();
cmExpandList(value, this->Replaces); cmExpandList(value, this->Replaces);
} }
+13 -12
View File
@@ -6,6 +6,7 @@
#include "cmCPackIFWGenerator.h" #include "cmCPackIFWGenerator.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmXMLParser.h" #include "cmXMLParser.h"
#include "cmXMLWriter.h" #include "cmXMLWriter.h"
@@ -55,22 +56,22 @@ bool cmCPackIFWRepository::ConfigureFromOptions()
} }
// Url // Url
if (const char* url = this->GetOption(prefix + "URL")) { if (cmProp url = this->GetOption(prefix + "URL")) {
this->Url = url; this->Url = *url;
} else { } else {
this->Url.clear(); this->Url.clear();
} }
// Old url // Old url
if (const char* oldUrl = this->GetOption(prefix + "OLD_URL")) { if (cmProp oldUrl = this->GetOption(prefix + "OLD_URL")) {
this->OldUrl = oldUrl; this->OldUrl = *oldUrl;
} else { } else {
this->OldUrl.clear(); this->OldUrl.clear();
} }
// New url // New url
if (const char* newUrl = this->GetOption(prefix + "NEW_URL")) { if (cmProp newUrl = this->GetOption(prefix + "NEW_URL")) {
this->NewUrl = newUrl; this->NewUrl = *newUrl;
} else { } else {
this->NewUrl.clear(); this->NewUrl.clear();
} }
@@ -83,22 +84,22 @@ bool cmCPackIFWRepository::ConfigureFromOptions()
} }
// Username // Username
if (const char* username = this->GetOption(prefix + "USERNAME")) { if (cmProp username = this->GetOption(prefix + "USERNAME")) {
this->Username = username; this->Username = *username;
} else { } else {
this->Username.clear(); this->Username.clear();
} }
// Password // Password
if (const char* password = this->GetOption(prefix + "PASSWORD")) { if (cmProp password = this->GetOption(prefix + "PASSWORD")) {
this->Password = password; this->Password = *password;
} else { } else {
this->Password.clear(); this->Password.clear();
} }
// DisplayName // DisplayName
if (const char* displayName = this->GetOption(prefix + "DISPLAY_NAME")) { if (cmProp displayName = this->GetOption(prefix + "DISPLAY_NAME")) {
this->DisplayName = displayName; this->DisplayName = *displayName;
} else { } else {
this->DisplayName.clear(); this->DisplayName.clear();
} }
+38 -41
View File
@@ -18,6 +18,7 @@
#include "cmCryptoHash.h" #include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmInstalledFile.h" #include "cmInstalledFile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmUuid.h" #include "cmUuid.h"
@@ -125,7 +126,7 @@ bool cmCPackWIXGenerator::RunLightCommand(std::string const& objectFiles)
command << " -ext " << QuotePath(ext); command << " -ext " << QuotePath(ext);
} }
const char* const cultures = GetOption("CPACK_WIX_CULTURES"); cmProp const cultures = GetOption("CPACK_WIX_CULTURES");
if (cultures) { if (cultures) {
command << " -cultures:" << cultures; command << " -cultures:" << cultures;
} }
@@ -156,7 +157,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
return false; return false;
} }
if (GetOption("CPACK_WIX_PRODUCT_GUID") == 0) { if (!GetOption("CPACK_WIX_PRODUCT_GUID")) {
std::string guid = GenerateGUID(); std::string guid = GenerateGUID();
SetOption("CPACK_WIX_PRODUCT_GUID", guid.c_str()); SetOption("CPACK_WIX_PRODUCT_GUID", guid.c_str());
@@ -165,7 +166,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
<< std::endl); << std::endl);
} }
if (GetOption("CPACK_WIX_UPGRADE_GUID") == 0) { if (!GetOption("CPACK_WIX_UPGRADE_GUID")) {
std::string guid = GenerateGUID(); std::string guid = GenerateGUID();
SetOption("CPACK_WIX_UPGRADE_GUID", guid.c_str()); SetOption("CPACK_WIX_UPGRADE_GUID", guid.c_str());
@@ -182,7 +183,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
return false; return false;
} }
if (GetOption("CPACK_WIX_LICENSE_RTF") == 0) { if (!GetOption("CPACK_WIX_LICENSE_RTF")) {
std::string licenseFilename = this->CPackTopLevel + "/License.rtf"; std::string licenseFilename = this->CPackTopLevel + "/License.rtf";
SetOption("CPACK_WIX_LICENSE_RTF", licenseFilename.c_str()); SetOption("CPACK_WIX_LICENSE_RTF", licenseFilename.c_str());
@@ -191,7 +192,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
} }
} }
if (GetOption("CPACK_PACKAGE_VENDOR") == 0) { if (!GetOption("CPACK_PACKAGE_VENDOR")) {
std::string defaultVendor = "Humanity"; std::string defaultVendor = "Humanity";
SetOption("CPACK_PACKAGE_VENDOR", defaultVendor.c_str()); SetOption("CPACK_PACKAGE_VENDOR", defaultVendor.c_str());
@@ -200,7 +201,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
<< defaultVendor << " . " << std::endl); << defaultVendor << " . " << std::endl);
} }
if (GetOption("CPACK_WIX_UI_REF") == 0) { if (!GetOption("CPACK_WIX_UI_REF")) {
std::string defaultRef = "WixUI_InstallDir"; std::string defaultRef = "WixUI_InstallDir";
if (!this->Components.empty()) { if (!this->Components.empty()) {
@@ -210,9 +211,9 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
SetOption("CPACK_WIX_UI_REF", defaultRef.c_str()); SetOption("CPACK_WIX_UI_REF", defaultRef.c_str());
} }
const char* packageContact = GetOption("CPACK_PACKAGE_CONTACT"); cmProp packageContact = GetOption("CPACK_PACKAGE_CONTACT");
if (packageContact != 0 && GetOption("CPACK_WIX_PROPERTY_ARPCONTACT") == 0) { if (packageContact && !GetOption("CPACK_WIX_PROPERTY_ARPCONTACT")) {
SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact); SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact->c_str());
} }
CollectExtensions("CPACK_WIX_EXTENSIONS", this->CandleExtensions); CollectExtensions("CPACK_WIX_EXTENSIONS", this->CandleExtensions);
@@ -223,7 +224,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", this->LightExtensions); CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", this->LightExtensions);
CollectXmlNamespaces("CPACK_WIX_CUSTOM_XMLNS", this->CustomXmlNamespaces); CollectXmlNamespaces("CPACK_WIX_CUSTOM_XMLNS", this->CustomXmlNamespaces);
const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE"); cmProp patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
if (patchFilePath) { if (patchFilePath) {
std::vector<std::string> patchFilePaths = cmExpandedList(patchFilePath); std::vector<std::string> patchFilePaths = cmExpandedList(patchFilePath);
@@ -295,7 +296,7 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
void cmCPackWIXGenerator::AppendUserSuppliedExtraSources() void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
{ {
const char* cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES"); cmProp cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES");
if (!cpackWixExtraSources) if (!cpackWixExtraSources)
return; return;
@@ -304,7 +305,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream) void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
{ {
const char* cpackWixExtraObjects = GetOption("CPACK_WIX_EXTRA_OBJECTS"); cmProp cpackWixExtraObjects = GetOption("CPACK_WIX_EXTRA_OBJECTS");
if (!cpackWixExtraObjects) if (!cpackWixExtraObjects)
return; return;
@@ -335,7 +336,7 @@ void cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
CopyDefinition(includeFile, "CPACK_WIX_UI_BANNER", DefinitionType::PATH); CopyDefinition(includeFile, "CPACK_WIX_UI_BANNER", DefinitionType::PATH);
CopyDefinition(includeFile, "CPACK_WIX_UI_DIALOG", DefinitionType::PATH); CopyDefinition(includeFile, "CPACK_WIX_UI_DIALOG", DefinitionType::PATH);
SetOptionIfNotSet("CPACK_WIX_PROGRAM_MENU_FOLDER", SetOptionIfNotSet("CPACK_WIX_PROGRAM_MENU_FOLDER",
GetOption("CPACK_PACKAGE_NAME")); GetOption("CPACK_PACKAGE_NAME").GetCStr());
CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER"); CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER");
CopyDefinition(includeFile, "CPACK_WIX_UI_REF"); CopyDefinition(includeFile, "CPACK_WIX_UI_REF");
} }
@@ -355,7 +356,7 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
for (std::string const& name : options) { for (std::string const& name : options) {
if (cmHasPrefix(name, prefix)) { if (cmHasPrefix(name, prefix)) {
std::string id = name.substr(prefix.length()); std::string id = name.substr(prefix.length());
std::string value = GetOption(name.c_str()); std::string value = GetOption(name);
includeFile.BeginElement("Property"); includeFile.BeginElement("Property");
includeFile.AddAttribute("Id", id); includeFile.AddAttribute("Id", id);
@@ -364,7 +365,7 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
} }
} }
if (GetOption("CPACK_WIX_PROPERTY_ARPINSTALLLOCATION") == 0) { if (!GetOption("CPACK_WIX_PROPERTY_ARPINSTALLLOCATION")) {
includeFile.BeginElement("Property"); includeFile.BeginElement("Property");
includeFile.AddAttribute("Id", "INSTALL_ROOT"); includeFile.AddAttribute("Id", "INSTALL_ROOT");
includeFile.AddAttribute("Secure", "yes"); includeFile.AddAttribute("Secure", "yes");
@@ -405,7 +406,7 @@ void cmCPackWIXGenerator::CopyDefinition(cmWIXSourceWriter& source,
std::string const& name, std::string const& name,
DefinitionType type) DefinitionType type)
{ {
const char* value = GetOption(name.c_str()); cmProp value = GetOption(name);
if (value) { if (value) {
if (type == DefinitionType::PATH) { if (type == DefinitionType::PATH) {
AddDefinition(source, name, CMakeToWixPath(value)); AddDefinition(source, name, CMakeToWixPath(value));
@@ -485,17 +486,17 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
} }
std::string featureTitle = cpackPackageName; std::string featureTitle = cpackPackageName;
if (const char* title = GetOption("CPACK_WIX_ROOT_FEATURE_TITLE")) { if (cmProp title = GetOption("CPACK_WIX_ROOT_FEATURE_TITLE")) {
featureTitle = title; featureTitle = *title;
} }
featureDefinitions.AddAttribute("Title", featureTitle); featureDefinitions.AddAttribute("Title", featureTitle);
if (const char* desc = GetOption("CPACK_WIX_ROOT_FEATURE_DESCRIPTION")) { if (cmProp desc = GetOption("CPACK_WIX_ROOT_FEATURE_DESCRIPTION")) {
featureDefinitions.AddAttribute("Description", desc); featureDefinitions.AddAttribute("Description", desc);
} }
featureDefinitions.AddAttribute("Level", "1"); featureDefinitions.AddAttribute("Level", "1");
this->Patch->ApplyFragment("#PRODUCTFEATURE", featureDefinitions); this->Patch->ApplyFragment("#PRODUCTFEATURE", featureDefinitions);
const char* package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY"); cmProp package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY");
if (package) { if (package) {
featureDefinitions.CreateCMakePackageRegistryEntry( featureDefinitions.CreateCMakePackageRegistryEntry(
package, GetOption("CPACK_WIX_UPGRADE_GUID")); package, GetOption("CPACK_WIX_UPGRADE_GUID"));
@@ -540,10 +541,9 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
} }
bool emitUninstallShortcut = true; bool emitUninstallShortcut = true;
const char* cpackWixProgramMenuFolder = cmProp cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER"); GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
if (cpackWixProgramMenuFolder && if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder == ".") {
cm::string_view(cpackWixProgramMenuFolder) == ".") {
emitUninstallShortcut = false; emitUninstallShortcut = false;
} else if (emittedShortcutTypes.find(cmWIXShortcuts::START_MENU) == } else if (emittedShortcutTypes.find(cmWIXShortcuts::START_MENU) ==
emittedShortcutTypes.end()) { emittedShortcutTypes.end()) {
@@ -595,9 +595,9 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
std::string result = "ProgramFiles<64>Folder"; std::string result = "ProgramFiles<64>Folder";
const char* rootFolderId = GetOption("CPACK_WIX_ROOT_FOLDER_ID"); cmProp rootFolderId = GetOption("CPACK_WIX_ROOT_FOLDER_ID");
if (rootFolderId) { if (rootFolderId) {
result = rootFolderId; result = *rootFolderId;
} }
if (GetArchitecture() == "x86") { if (GetArchitecture() == "x86") {
@@ -612,8 +612,8 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate() bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate()
{ {
std::string wixTemplate = FindTemplate("WIX.template.in"); std::string wixTemplate = FindTemplate("WIX.template.in");
if (GetOption("CPACK_WIX_TEMPLATE") != 0) { if (cmProp wixtpl = GetOption("CPACK_WIX_TEMPLATE")) {
wixTemplate = GetOption("CPACK_WIX_TEMPLATE"); wixTemplate = *wixtpl;
} }
if (wixTemplate.empty()) { if (wixTemplate.empty()) {
@@ -669,7 +669,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
featureDefinitions.AddAttribute("Id", featureId); featureDefinitions.AddAttribute("Id", featureId);
std::vector<std::string> cpackPackageExecutablesList; std::vector<std::string> cpackPackageExecutablesList;
const char* cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES"); cmProp cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
if (cpackPackageExecutables) { if (cpackPackageExecutables) {
cmExpandList(cpackPackageExecutables, cpackPackageExecutablesList); cmExpandList(cpackPackageExecutables, cpackPackageExecutablesList);
if (cpackPackageExecutablesList.size() % 2 != 0) { if (cpackPackageExecutablesList.size() % 2 != 0) {
@@ -683,8 +683,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
} }
std::vector<std::string> cpackPackageDesktopLinksList; std::vector<std::string> cpackPackageDesktopLinksList;
const char* cpackPackageDesktopLinks = cmProp cpackPackageDesktopLinks = GetOption("CPACK_CREATE_DESKTOP_LINKS");
GetOption("CPACK_CREATE_DESKTOP_LINKS");
if (cpackPackageDesktopLinks) { if (cpackPackageDesktopLinks) {
cmExpandList(cpackPackageDesktopLinks, cpackPackageDesktopLinksList); cmExpandList(cpackPackageDesktopLinks, cpackPackageDesktopLinksList);
} }
@@ -743,10 +742,9 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
std::string directoryId; std::string directoryId;
switch (type) { switch (type) {
case cmWIXShortcuts::START_MENU: { case cmWIXShortcuts::START_MENU: {
const char* cpackWixProgramMenuFolder = cmProp cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER"); GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
if (cpackWixProgramMenuFolder && if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder == ".") {
cm::string_view(cpackWixProgramMenuFolder) == ".") {
directoryId = "ProgramMenuFolder"; directoryId = "ProgramMenuFolder";
} else { } else {
directoryId = "PROGRAM_MENU_FOLDER"; directoryId = "PROGRAM_MENU_FOLDER";
@@ -805,10 +803,9 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
fileDefinitions); fileDefinitions);
if (type == cmWIXShortcuts::START_MENU) { if (type == cmWIXShortcuts::START_MENU) {
const char* cpackWixProgramMenuFolder = cmProp cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER"); GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
if (cpackWixProgramMenuFolder && if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder != ".") {
cm::string_view(cpackWixProgramMenuFolder) != ".") {
fileDefinitions.EmitRemoveFolder("CM_REMOVE_PROGRAM_MENU_FOLDER" + fileDefinitions.EmitRemoveFolder("CM_REMOVE_PROGRAM_MENU_FOLDER" +
idSuffix); idSuffix);
} }
@@ -973,9 +970,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitions(
bool cmCPackWIXGenerator::RequireOption(std::string const& name, bool cmCPackWIXGenerator::RequireOption(std::string const& name,
std::string& value) const std::string& value) const
{ {
const char* tmp = GetOption(name.c_str()); cmProp tmp = GetOption(name);
if (tmp) { if (tmp) {
value = tmp; value = *tmp;
return true; return true;
} else { } else {
@@ -1146,7 +1143,7 @@ bool cmCPackWIXGenerator::IsLegalIdCharacter(char c)
void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName, void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
extension_set_t& extensions) extension_set_t& extensions)
{ {
const char* variableContent = GetOption(variableName.c_str()); cmProp variableContent = GetOption(variableName);
if (!variableContent) if (!variableContent)
return; return;
@@ -1157,7 +1154,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName, void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
xmlns_map_t& namespaces) xmlns_map_t& namespaces)
{ {
const char* variableContent = GetOption(variableName.c_str()); cmProp variableContent = GetOption(variableName);
if (!variableContent) { if (!variableContent) {
return; return;
} }
@@ -1186,7 +1183,7 @@ void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName, void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName,
std::ostream& stream) std::ostream& stream)
{ {
const char* variableContent = GetOption(variableName.c_str()); cmProp variableContent = GetOption(variableName);
if (!variableContent) if (!variableContent)
return; return;
+10 -10
View File
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */ file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackArchiveGenerator.h" #include "cmCPackArchiveGenerator.h"
#include <cstdlib>
#include <cstring> #include <cstring>
#include <map> #include <map>
#include <ostream> #include <ostream>
@@ -13,6 +12,7 @@
#include "cmCPackGenerator.h" #include "cmCPackGenerator.h"
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmWorkingDirectory.h" #include "cmWorkingDirectory.h"
@@ -77,7 +77,7 @@ std::string cmCPackArchiveGenerator::GetArchiveComponentFileName(
if (this->IsSet("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME")) { if (this->IsSet("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME")) {
packageFileName += packageFileName +=
this->GetOption("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME"); *this->GetOption("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME");
} else if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) { } else if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) {
packageFileName += this->GetComponentPackageFileName( packageFileName += this->GetComponentPackageFileName(
this->GetOption("CPACK_ARCHIVE_FILE_NAME"), component, isGroupName); this->GetOption("CPACK_ARCHIVE_FILE_NAME"), component, isGroupName);
@@ -118,11 +118,11 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) { if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) {
filePrefix = cmStrCat(this->GetOption("CPACK_PACKAGE_FILE_NAME"), '/'); filePrefix = cmStrCat(this->GetOption("CPACK_PACKAGE_FILE_NAME"), '/');
} }
const char* installPrefix = cmProp installPrefix = this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"); if (installPrefix && installPrefix->size() > 1 &&
if (installPrefix && installPrefix[0] == '/' && installPrefix[1] != 0) { (*installPrefix)[0] == '/') {
// add to file prefix and remove the leading '/' // add to file prefix and remove the leading '/'
filePrefix += installPrefix + 1; filePrefix += installPrefix->substr(1);
filePrefix += "/"; filePrefix += "/";
} }
for (std::string const& file : component->Files) { for (std::string const& file : component->Files) {
@@ -257,9 +257,9 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne()
this->packageFileNames[0] += "/"; this->packageFileNames[0] += "/";
if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) { if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) {
this->packageFileNames[0] += this->GetOption("CPACK_ARCHIVE_FILE_NAME"); this->packageFileNames[0] += *this->GetOption("CPACK_ARCHIVE_FILE_NAME");
} else { } else {
this->packageFileNames[0] += this->GetOption("CPACK_PACKAGE_FILE_NAME"); this->packageFileNames[0] += *this->GetOption("CPACK_PACKAGE_FILE_NAME");
} }
this->packageFileNames[0] += this->GetOutputExtension(); this->packageFileNames[0] += this->GetOutputExtension();
@@ -345,9 +345,9 @@ int cmCPackArchiveGenerator::GetThreadCount() const
// CPACK_ARCHIVE_THREADS overrides CPACK_THREADS // CPACK_ARCHIVE_THREADS overrides CPACK_THREADS
if (this->IsSet("CPACK_ARCHIVE_THREADS")) { if (this->IsSet("CPACK_ARCHIVE_THREADS")) {
threads = std::atoi(this->GetOption("CPACK_ARCHIVE_THREADS")); threads = std::stoi(this->GetOption("CPACK_ARCHIVE_THREADS"));
} else if (this->IsSet("CPACK_THREADS")) { } else if (this->IsSet("CPACK_THREADS")) {
threads = std::atoi(this->GetOption("CPACK_THREADS")); threads = std::stoi(this->GetOption("CPACK_THREADS"));
} }
return threads; return threads;
+16 -29
View File
@@ -6,6 +6,7 @@
#include <vector> #include <vector>
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -15,8 +16,8 @@ cmCPackBundleGenerator::~cmCPackBundleGenerator() = default;
int cmCPackBundleGenerator::InitializeInternal() int cmCPackBundleGenerator::InitializeInternal()
{ {
const char* name = this->GetOption("CPACK_BUNDLE_NAME"); cmProp name = this->GetOption("CPACK_BUNDLE_NAME");
if (nullptr == name) { if (!name) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_NAME must be set to use the Bundle generator." "CPACK_BUNDLE_NAME must be set to use the Bundle generator."
<< std::endl); << std::endl);
@@ -51,30 +52,24 @@ int cmCPackBundleGenerator::ConstructBundle()
{ {
// Get required arguments ... // Get required arguments ...
const std::string cpack_bundle_name = this->GetOption("CPACK_BUNDLE_NAME") cmProp cpack_bundle_name = this->GetOption("CPACK_BUNDLE_NAME");
? this->GetOption("CPACK_BUNDLE_NAME") if (cpack_bundle_name->empty()) {
: "";
if (cpack_bundle_name.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_NAME must be set." << std::endl); "CPACK_BUNDLE_NAME must be set." << std::endl);
return 0; return 0;
} }
const std::string cpack_bundle_plist = this->GetOption("CPACK_BUNDLE_PLIST") cmProp cpack_bundle_plist = this->GetOption("CPACK_BUNDLE_PLIST");
? this->GetOption("CPACK_BUNDLE_PLIST") if (cpack_bundle_plist->empty()) {
: "";
if (cpack_bundle_plist.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_PLIST must be set." << std::endl); "CPACK_BUNDLE_PLIST must be set." << std::endl);
return 0; return 0;
} }
const std::string cpack_bundle_icon = this->GetOption("CPACK_BUNDLE_ICON") cmProp cpack_bundle_icon = this->GetOption("CPACK_BUNDLE_ICON");
? this->GetOption("CPACK_BUNDLE_ICON") if (cpack_bundle_icon->empty()) {
: "";
if (cpack_bundle_icon.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_ICON must be set." << std::endl); "CPACK_BUNDLE_ICON must be set." << std::endl);
@@ -82,10 +77,8 @@ int cmCPackBundleGenerator::ConstructBundle()
} }
// Get optional arguments ... // Get optional arguments ...
const std::string cpack_bundle_startup_command = cmProp cpack_bundle_startup_command =
this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND");
? this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND")
: "";
// The staging directory contains everything that will end-up inside the // The staging directory contains everything that will end-up inside the
// final disk image ... // final disk image ...
@@ -138,7 +131,7 @@ int cmCPackBundleGenerator::ConstructBundle()
// Optionally a user-provided startup command (could be an // Optionally a user-provided startup command (could be an
// executable or a script) ... // executable or a script) ...
if (!cpack_bundle_startup_command.empty()) { if (!cpack_bundle_startup_command->empty()) {
std::ostringstream command_source; std::ostringstream command_source;
command_source << cpack_bundle_startup_command; command_source << cpack_bundle_startup_command;
@@ -180,13 +173,10 @@ bool cmCPackBundleGenerator::SupportsComponentInstallation() const
int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
{ {
const std::string cpack_apple_cert_app = cmProp cpack_apple_cert_app = this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP");
this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP")
? this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP")
: "";
// codesign the application. // codesign the application.
if (!cpack_apple_cert_app.empty()) { if (!cpack_apple_cert_app->empty()) {
std::string output; std::string output;
std::string bundle_path; std::string bundle_path;
bundle_path = bundle_path =
@@ -195,13 +185,10 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
// A list of additional files to sign, ie. frameworks and plugins. // A list of additional files to sign, ie. frameworks and plugins.
const std::string sign_parameter = const std::string sign_parameter =
this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER") this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
? this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER") ? *this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
: "--deep -f"; : "--deep -f";
const std::string sign_files = cmProp sign_files = this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES");
this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES")
? this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES")
: "";
std::vector<std::string> relFiles = cmExpandedList(sign_files); std::vector<std::string> relFiles = cmExpandedList(sign_files);
@@ -8,6 +8,7 @@
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h" #include "cmGlobalGenerator.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmProperty.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmake.h" #include "cmake.h"
@@ -59,14 +60,15 @@ int cmCPackCygwinBinaryGenerator::PackageFiles()
const char* cmCPackCygwinBinaryGenerator::GetOutputExtension() const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
{ {
this->OutputExtension = "-"; this->OutputExtension = "-";
const char* patchNumber = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); cmProp patchNumber = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patchNumber) { if (!patchNumber) {
patchNumber = "1"; this->OutputExtension += "1";
cmCPackLogger(cmCPackLog::LOG_WARNING, cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER not specified using 1" "CPACK_CYGWIN_PATCH_NUMBER not specified using 1"
<< std::endl); << std::endl);
} else {
this->OutputExtension += patchNumber;
} }
this->OutputExtension += patchNumber;
this->OutputExtension += ".tar.bz2"; this->OutputExtension += ".tar.bz2";
return this->OutputExtension.c_str(); return this->OutputExtension.c_str();
} }
@@ -8,6 +8,7 @@
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h" #include "cmGlobalGenerator.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmProperty.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmake.h" #include "cmake.h"
@@ -94,14 +95,15 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
} }
std::string outerTarFile = std::string outerTarFile =
cmStrCat(this->GetOption("CPACK_TEMPORARY_DIRECTORY"), '-'); cmStrCat(this->GetOption("CPACK_TEMPORARY_DIRECTORY"), '-');
const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); cmProp patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patch) { if (!patch) {
cmCPackLogger(cmCPackLog::LOG_WARNING, cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER" "CPACK_CYGWIN_PATCH_NUMBER"
<< " not specified, defaulting to 1\n"); << " not specified, defaulting to 1\n");
patch = "1"; outerTarFile += "1";
} else {
outerTarFile += patch;
} }
outerTarFile += patch;
outerTarFile += "-src.tar.bz2"; outerTarFile += "-src.tar.bz2";
std::string tmpDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
std::string buildScript = std::string buildScript =
@@ -145,14 +147,15 @@ const char* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix()
const char* cmCPackCygwinSourceGenerator::GetOutputExtension() const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
{ {
this->OutputExtension = "-"; this->OutputExtension = "-";
const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER"); cmProp patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patch) { if (!patch) {
cmCPackLogger(cmCPackLog::LOG_WARNING, cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER" "CPACK_CYGWIN_PATCH_NUMBER"
<< " not specified, defaulting to 1\n"); << " not specified, defaulting to 1\n");
patch = "1"; this->OutputExtension += "1";
} else {
this->OutputExtension += patch;
} }
this->OutputExtension += patch;
this->OutputExtension += "-src.tar.bz2"; this->OutputExtension += "-src.tar.bz2";
return this->OutputExtension.c_str(); return this->OutputExtension.c_str();
} }
+73 -74
View File
@@ -20,6 +20,7 @@
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmCryptoHash.h" #include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -30,12 +31,12 @@ class DebGenerator
public: public:
DebGenerator(cmCPackLog* logger, std::string outputName, std::string workDir, DebGenerator(cmCPackLog* logger, std::string outputName, std::string workDir,
std::string topLevelDir, std::string temporaryDir, std::string topLevelDir, std::string temporaryDir,
const char* debianCompressionType, const char* numThreads, cmProp debianCompressionType, cmProp numThreads,
const char* debianArchiveType, cmProp debianArchiveType,
std::map<std::string, std::string> controlValues, std::map<std::string, std::string> controlValues,
bool genShLibs, std::string shLibsFilename, bool genPostInst, bool genShLibs, std::string shLibsFilename, bool genPostInst,
std::string postInst, bool genPostRm, std::string postRm, std::string postInst, bool genPostRm, std::string postRm,
const char* controlExtra, bool permissionStrctPolicy, cmProp controlExtra, bool permissionStrctPolicy,
std::vector<std::string> packageFiles); std::vector<std::string> packageFiles);
bool generate() const; bool generate() const;
@@ -54,7 +55,7 @@ private:
std::string CompressionSuffix; std::string CompressionSuffix;
const std::string TopLevelDir; const std::string TopLevelDir;
const std::string TemporaryDir; const std::string TemporaryDir;
const char* DebianArchiveType; const std::string DebianArchiveType;
long NumThreads; long NumThreads;
const std::map<std::string, std::string> ControlValues; const std::map<std::string, std::string> ControlValues;
const bool GenShLibs; const bool GenShLibs;
@@ -63,27 +64,28 @@ private:
const std::string PostInst; const std::string PostInst;
const bool GenPostRm; const bool GenPostRm;
const std::string PostRm; const std::string PostRm;
const char* ControlExtra; cmProp ControlExtra;
const bool PermissionStrictPolicy; const bool PermissionStrictPolicy;
const std::vector<std::string> PackageFiles; const std::vector<std::string> PackageFiles;
cmArchiveWrite::Compress TarCompressionType; cmArchiveWrite::Compress TarCompressionType;
}; };
DebGenerator::DebGenerator( DebGenerator::DebGenerator(cmCPackLog* logger, std::string outputName,
cmCPackLog* logger, std::string outputName, std::string workDir, std::string workDir, std::string topLevelDir,
std::string topLevelDir, std::string temporaryDir, std::string temporaryDir, cmProp debCompressionType,
const char* debianCompressionType, const char* numThreads, cmProp numThreads, cmProp debianArchiveType,
const char* debianArchiveType, std::map<std::string, std::string> controlValues,
std::map<std::string, std::string> controlValues, bool genShLibs, bool genShLibs, std::string shLibsFilename,
std::string shLibsFilename, bool genPostInst, std::string postInst, bool genPostInst, std::string postInst,
bool genPostRm, std::string postRm, const char* controlExtra, bool genPostRm, std::string postRm,
bool permissionStrictPolicy, std::vector<std::string> packageFiles) cmProp controlExtra, bool permissionStrictPolicy,
std::vector<std::string> packageFiles)
: Logger(logger) : Logger(logger)
, OutputName(std::move(outputName)) , OutputName(std::move(outputName))
, WorkDir(std::move(workDir)) , WorkDir(std::move(workDir))
, TopLevelDir(std::move(topLevelDir)) , TopLevelDir(std::move(topLevelDir))
, TemporaryDir(std::move(temporaryDir)) , TemporaryDir(std::move(temporaryDir))
, DebianArchiveType(debianArchiveType ? debianArchiveType : "gnutar") , DebianArchiveType(debianArchiveType ? *debianArchiveType : "gnutar")
, ControlValues(std::move(controlValues)) , ControlValues(std::move(controlValues))
, GenShLibs(genShLibs) , GenShLibs(genShLibs)
, ShLibsFilename(std::move(shLibsFilename)) , ShLibsFilename(std::move(shLibsFilename))
@@ -95,26 +97,27 @@ DebGenerator::DebGenerator(
, PermissionStrictPolicy(permissionStrictPolicy) , PermissionStrictPolicy(permissionStrictPolicy)
, PackageFiles(std::move(packageFiles)) , PackageFiles(std::move(packageFiles))
{ {
if (!debianCompressionType) { std::string debianCompressionType = "gzip";
debianCompressionType = "gzip"; if (debCompressionType) {
debianCompressionType = *debCompressionType;
} }
if (!std::strcmp(debianCompressionType, "lzma")) { if (debianCompressionType == "lzma") {
this->CompressionSuffix = ".lzma"; this->CompressionSuffix = ".lzma";
this->TarCompressionType = cmArchiveWrite::CompressLZMA; this->TarCompressionType = cmArchiveWrite::CompressLZMA;
} else if (!std::strcmp(debianCompressionType, "xz")) { } else if (debianCompressionType == "xz") {
this->CompressionSuffix = ".xz"; this->CompressionSuffix = ".xz";
this->TarCompressionType = cmArchiveWrite::CompressXZ; this->TarCompressionType = cmArchiveWrite::CompressXZ;
} else if (!std::strcmp(debianCompressionType, "bzip2")) { } else if (debianCompressionType == "bzip2") {
this->CompressionSuffix = ".bz2"; this->CompressionSuffix = ".bz2";
this->TarCompressionType = cmArchiveWrite::CompressBZip2; this->TarCompressionType = cmArchiveWrite::CompressBZip2;
} else if (!std::strcmp(debianCompressionType, "gzip")) { } else if (debianCompressionType == "gzip") {
this->CompressionSuffix = ".gz"; this->CompressionSuffix = ".gz";
this->TarCompressionType = cmArchiveWrite::CompressGZip; this->TarCompressionType = cmArchiveWrite::CompressGZip;
} else if (!std::strcmp(debianCompressionType, "zstd")) { } else if (debianCompressionType == "zstd") {
this->CompressionSuffix = ".zst"; this->CompressionSuffix = ".zst";
this->TarCompressionType = cmArchiveWrite::CompressZstd; this->TarCompressionType = cmArchiveWrite::CompressZstd;
} else if (!std::strcmp(debianCompressionType, "none")) { } else if (debianCompressionType == "none") {
this->CompressionSuffix.clear(); this->CompressionSuffix.clear();
this->TarCompressionType = cmArchiveWrite::CompressNone; this->TarCompressionType = cmArchiveWrite::CompressNone;
} else { } else {
@@ -539,9 +542,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
std::string localToplevel(initialTopLevel); std::string localToplevel(initialTopLevel);
std::string packageFileName( std::string packageFileName(
cmSystemTools::GetParentDirectory(this->toplevel)); cmSystemTools::GetParentDirectory(this->toplevel));
std::string outputFileName( std::string outputFileName(*this->GetOption("CPACK_PACKAGE_FILE_NAME") +
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + "-" + "-" + packageName + this->GetOutputExtension());
packageName + this->GetOutputExtension());
localToplevel += "/" + packageName; localToplevel += "/" + packageName;
/* replace the TEMP DIRECTORY with the component one */ /* replace the TEMP DIRECTORY with the component one */
@@ -627,9 +629,8 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
std::string localToplevel(initialTopLevel); std::string localToplevel(initialTopLevel);
std::string packageFileName( std::string packageFileName(
cmSystemTools::GetParentDirectory(this->toplevel)); cmSystemTools::GetParentDirectory(this->toplevel));
std::string outputFileName( std::string outputFileName(*this->GetOption("CPACK_PACKAGE_FILE_NAME") +
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + this->GetOutputExtension());
this->GetOutputExtension());
// all GROUP in one vs all COMPONENT in one // all GROUP in one vs all COMPONENT in one
// if must be here otherwise non component paths have a trailing / while // if must be here otherwise non component paths have a trailing / while
// components don't // components don't
@@ -684,7 +685,7 @@ int cmCPackDebGenerator::PackageFiles()
bool cmCPackDebGenerator::createDebPackages() bool cmCPackDebGenerator::createDebPackages()
{ {
auto make_package = [this](const char* const path, auto make_package = [this](const std::string& path,
const char* const output_var, const char* const output_var,
bool (cmCPackDebGenerator::*creator)()) -> bool { bool (cmCPackDebGenerator::*creator)()) -> bool {
try { try {
@@ -706,7 +707,7 @@ bool cmCPackDebGenerator::createDebPackages()
bool retval = bool retval =
make_package(this->GetOption("GEN_WDIR"), "GEN_CPACK_OUTPUT_FILE_NAME", make_package(this->GetOption("GEN_WDIR"), "GEN_CPACK_OUTPUT_FILE_NAME",
&cmCPackDebGenerator::createDeb); &cmCPackDebGenerator::createDeb);
const char* const dbgsymdir_path = this->GetOption("GEN_DBGSYMDIR"); cmProp dbgsymdir_path = this->GetOption("GEN_DBGSYMDIR");
if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE") && dbgsymdir_path) { if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE") && dbgsymdir_path) {
retval = make_package(dbgsymdir_path, "GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME", retval = make_package(dbgsymdir_path, "GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME",
&cmCPackDebGenerator::createDbgsymDDeb) && &cmCPackDebGenerator::createDbgsymDDeb) &&
@@ -723,78 +724,75 @@ bool cmCPackDebGenerator::createDeb()
controlValues["Package"] = cmsys::SystemTools::LowerCase( controlValues["Package"] = cmsys::SystemTools::LowerCase(
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_NAME")); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_NAME"));
controlValues["Version"] = controlValues["Version"] =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_VERSION"); *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_VERSION");
controlValues["Section"] = controlValues["Section"] =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SECTION"); *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SECTION");
controlValues["Priority"] = controlValues["Priority"] =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PRIORITY"); *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PRIORITY");
controlValues["Architecture"] = controlValues["Architecture"] =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ARCHITECTURE"); *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ARCHITECTURE");
controlValues["Maintainer"] = controlValues["Maintainer"] =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_MAINTAINER"); *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_MAINTAINER");
controlValues["Description"] = controlValues["Description"] =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DESCRIPTION"); *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DESCRIPTION");
const char* debian_pkg_source = cmProp debian_pkg_source =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE");
if (cmNonempty(debian_pkg_source)) { if (cmNonempty(debian_pkg_source)) {
controlValues["Source"] = debian_pkg_source; controlValues["Source"] = *debian_pkg_source;
} }
const char* debian_pkg_dep = cmProp debian_pkg_dep = this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DEPENDS");
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DEPENDS");
if (cmNonempty(debian_pkg_dep)) { if (cmNonempty(debian_pkg_dep)) {
controlValues["Depends"] = debian_pkg_dep; controlValues["Depends"] = *debian_pkg_dep;
} }
const char* debian_pkg_rec = cmProp debian_pkg_rec =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_RECOMMENDS"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_RECOMMENDS");
if (cmNonempty(debian_pkg_rec)) { if (cmNonempty(debian_pkg_rec)) {
controlValues["Recommends"] = debian_pkg_rec; controlValues["Recommends"] = *debian_pkg_rec;
} }
const char* debian_pkg_sug = cmProp debian_pkg_sug = this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SUGGESTS");
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SUGGESTS");
if (cmNonempty(debian_pkg_sug)) { if (cmNonempty(debian_pkg_sug)) {
controlValues["Suggests"] = debian_pkg_sug; controlValues["Suggests"] = *debian_pkg_sug;
} }
const char* debian_pkg_url = cmProp debian_pkg_url = this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_HOMEPAGE");
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_HOMEPAGE");
if (cmNonempty(debian_pkg_url)) { if (cmNonempty(debian_pkg_url)) {
controlValues["Homepage"] = debian_pkg_url; controlValues["Homepage"] = *debian_pkg_url;
} }
const char* debian_pkg_predep = cmProp debian_pkg_predep =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PREDEPENDS"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PREDEPENDS");
if (cmNonempty(debian_pkg_predep)) { if (cmNonempty(debian_pkg_predep)) {
controlValues["Pre-Depends"] = debian_pkg_predep; controlValues["Pre-Depends"] = *debian_pkg_predep;
} }
const char* debian_pkg_enhances = cmProp debian_pkg_enhances =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ENHANCES"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ENHANCES");
if (cmNonempty(debian_pkg_enhances)) { if (cmNonempty(debian_pkg_enhances)) {
controlValues["Enhances"] = debian_pkg_enhances; controlValues["Enhances"] = *debian_pkg_enhances;
} }
const char* debian_pkg_breaks = cmProp debian_pkg_breaks =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_BREAKS"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_BREAKS");
if (cmNonempty(debian_pkg_breaks)) { if (cmNonempty(debian_pkg_breaks)) {
controlValues["Breaks"] = debian_pkg_breaks; controlValues["Breaks"] = *debian_pkg_breaks;
} }
const char* debian_pkg_conflicts = cmProp debian_pkg_conflicts =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_CONFLICTS"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_CONFLICTS");
if (cmNonempty(debian_pkg_conflicts)) { if (cmNonempty(debian_pkg_conflicts)) {
controlValues["Conflicts"] = debian_pkg_conflicts; controlValues["Conflicts"] = *debian_pkg_conflicts;
} }
const char* debian_pkg_provides = cmProp debian_pkg_provides =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PROVIDES"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PROVIDES");
if (cmNonempty(debian_pkg_provides)) { if (cmNonempty(debian_pkg_provides)) {
controlValues["Provides"] = debian_pkg_provides; controlValues["Provides"] = *debian_pkg_provides;
} }
const char* debian_pkg_replaces = cmProp debian_pkg_replaces =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_REPLACES"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_REPLACES");
if (cmNonempty(debian_pkg_replaces)) { if (cmNonempty(debian_pkg_replaces)) {
controlValues["Replaces"] = debian_pkg_replaces; controlValues["Replaces"] = *debian_pkg_replaces;
} }
const std::string strGenWDIR(this->GetOption("GEN_WDIR")); const std::string strGenWDIR(this->GetOption("GEN_WDIR"));
const std::string shlibsfilename = strGenWDIR + "/shlibs"; const std::string shlibsfilename = strGenWDIR + "/shlibs";
const char* debian_pkg_shlibs = cmProp debian_pkg_shlibs =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SHLIBS"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SHLIBS");
const bool gen_shibs = this->IsOn("CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS") && const bool gen_shibs = this->IsOn("CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS") &&
cmNonempty(debian_pkg_shlibs); cmNonempty(debian_pkg_shlibs);
@@ -851,32 +849,33 @@ bool cmCPackDebGenerator::createDbgsymDDeb()
// debian policy enforce lower case for package name // debian policy enforce lower case for package name
std::string packageNameLower = cmsys::SystemTools::LowerCase( std::string packageNameLower = cmsys::SystemTools::LowerCase(
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_NAME")); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_NAME"));
const char* debian_pkg_version = cmProp debian_pkg_version =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_VERSION"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_VERSION");
controlValues["Package"] = packageNameLower + "-dbgsym"; controlValues["Package"] = packageNameLower + "-dbgsym";
controlValues["Package-Type"] = "ddeb"; controlValues["Package-Type"] = "ddeb";
controlValues["Version"] = debian_pkg_version; controlValues["Version"] = *debian_pkg_version;
controlValues["Auto-Built-Package"] = "debug-symbols"; controlValues["Auto-Built-Package"] = "debug-symbols";
controlValues["Depends"] = this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_NAME") + controlValues["Depends"] =
std::string(" (= ") + debian_pkg_version + ")"; *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_NAME") + std::string(" (= ") +
*debian_pkg_version + ")";
controlValues["Section"] = "debug"; controlValues["Section"] = "debug";
controlValues["Priority"] = "optional"; controlValues["Priority"] = "optional";
controlValues["Architecture"] = controlValues["Architecture"] =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ARCHITECTURE"); *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ARCHITECTURE");
controlValues["Maintainer"] = controlValues["Maintainer"] =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_MAINTAINER"); *this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_MAINTAINER");
controlValues["Description"] = controlValues["Description"] =
std::string("debug symbols for ") + packageNameLower; std::string("debug symbols for ") + packageNameLower;
const char* debian_pkg_source = cmProp debian_pkg_source =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE"); this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE");
if (cmNonempty(debian_pkg_source)) { if (cmNonempty(debian_pkg_source)) {
controlValues["Source"] = debian_pkg_source; controlValues["Source"] = *debian_pkg_source;
} }
const char* debian_build_ids = this->GetOption("GEN_BUILD_IDS"); cmProp debian_build_ids = this->GetOption("GEN_BUILD_IDS");
if (cmNonempty(debian_build_ids)) { if (cmNonempty(debian_build_ids)) {
controlValues["Build-Ids"] = debian_build_ids; controlValues["Build-Ids"] = *debian_build_ids;
} }
DebGenerator gen( DebGenerator gen(
@@ -914,7 +913,7 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
std::string groupVar = std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP"; "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
if (nullptr != this->GetOption(groupVar)) { if (nullptr != this->GetOption(groupVar)) {
return std::string(this->GetOption(groupVar)); return *this->GetOption(groupVar);
} }
return componentName; return componentName;
} }
+20 -32
View File
@@ -18,6 +18,7 @@
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmDuration.h" #include "cmDuration.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmXMLWriter.h" #include "cmXMLWriter.h"
@@ -260,48 +261,35 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
const std::string& output_file) const std::string& output_file)
{ {
// Get optional arguments ... // Get optional arguments ...
const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON") cmProp cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON");
? this->GetOption("CPACK_PACKAGE_ICON")
: "";
const std::string cpack_dmg_volume_name = const std::string cpack_dmg_volume_name =
this->GetOption("CPACK_DMG_VOLUME_NAME") this->GetOption("CPACK_DMG_VOLUME_NAME")
? this->GetOption("CPACK_DMG_VOLUME_NAME") ? *this->GetOption("CPACK_DMG_VOLUME_NAME")
: this->GetOption("CPACK_PACKAGE_FILE_NAME"); : *this->GetOption("CPACK_PACKAGE_FILE_NAME");
const std::string cpack_dmg_format = this->GetOption("CPACK_DMG_FORMAT") const std::string cpack_dmg_format = this->GetOption("CPACK_DMG_FORMAT")
? this->GetOption("CPACK_DMG_FORMAT") ? *this->GetOption("CPACK_DMG_FORMAT")
: "UDZO"; : "UDZO";
const std::string cpack_dmg_filesystem = const std::string cpack_dmg_filesystem =
this->GetOption("CPACK_DMG_FILESYSTEM") this->GetOption("CPACK_DMG_FILESYSTEM")
? this->GetOption("CPACK_DMG_FILESYSTEM") ? *this->GetOption("CPACK_DMG_FILESYSTEM")
: "HFS+"; : "HFS+";
// Get optional arguments ... // Get optional arguments ...
std::string cpack_license_file = std::string cpack_license_file =
this->GetOption("CPACK_RESOURCE_FILE_LICENSE") *this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
? this->GetOption("CPACK_RESOURCE_FILE_LICENSE")
: "";
const std::string cpack_dmg_background_image = cmProp cpack_dmg_background_image =
this->GetOption("CPACK_DMG_BACKGROUND_IMAGE") this->GetOption("CPACK_DMG_BACKGROUND_IMAGE");
? this->GetOption("CPACK_DMG_BACKGROUND_IMAGE")
: "";
const std::string cpack_dmg_ds_store = this->GetOption("CPACK_DMG_DS_STORE") cmProp cpack_dmg_ds_store = this->GetOption("CPACK_DMG_DS_STORE");
? this->GetOption("CPACK_DMG_DS_STORE")
: "";
const std::string cpack_dmg_languages = cmProp cpack_dmg_languages = this->GetOption("CPACK_DMG_SLA_LANGUAGES");
this->GetOption("CPACK_DMG_SLA_LANGUAGES")
? this->GetOption("CPACK_DMG_SLA_LANGUAGES")
: "";
const std::string cpack_dmg_ds_store_setup_script = cmProp cpack_dmg_ds_store_setup_script =
this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT") this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT");
? this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT")
: "";
const bool cpack_dmg_disable_applications_symlink = const bool cpack_dmg_disable_applications_symlink =
this->IsOn("CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK"); this->IsOn("CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK");
@@ -332,7 +320,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
} }
// Optionally add a custom volume icon ... // Optionally add a custom volume icon ...
if (!cpack_package_icon.empty()) { if (!cpack_package_icon->empty()) {
std::ostringstream package_icon_source; std::ostringstream package_icon_source;
package_icon_source << cpack_package_icon; package_icon_source << cpack_package_icon;
@@ -351,7 +339,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Optionally add a custom .DS_Store file // Optionally add a custom .DS_Store file
// (e.g. for setting background/layout) ... // (e.g. for setting background/layout) ...
if (!cpack_dmg_ds_store.empty()) { if (!cpack_dmg_ds_store->empty()) {
std::ostringstream package_settings_source; std::ostringstream package_settings_source;
package_settings_source << cpack_dmg_ds_store; package_settings_source << cpack_dmg_ds_store;
@@ -372,7 +360,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Optionally add a custom background image ... // Optionally add a custom background image ...
// Make sure the background file type is the same as the custom image // Make sure the background file type is the same as the custom image
// and that the file is hidden so it doesn't show up. // and that the file is hidden so it doesn't show up.
if (!cpack_dmg_background_image.empty()) { if (!cpack_dmg_background_image->empty()) {
const std::string extension = const std::string extension =
cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image); cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
std::ostringstream package_background_source; std::ostringstream package_background_source;
@@ -394,7 +382,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
} }
bool remount_image = bool remount_image =
!cpack_package_icon.empty() || !cpack_dmg_ds_store_setup_script.empty(); !cpack_package_icon->empty() || !cpack_dmg_ds_store_setup_script->empty();
std::string temp_image_format = "UDZO"; std::string temp_image_format = "UDZO";
@@ -471,7 +459,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
} }
// Optionally set the custom icon flag for the image ... // Optionally set the custom icon flag for the image ...
if (!had_error && !cpack_package_icon.empty()) { if (!had_error && !cpack_package_icon->empty()) {
std::string error; std::string error;
std::ostringstream setfile_command; std::ostringstream setfile_command;
setfile_command << this->GetOption("CPACK_COMMAND_SETFILE"); setfile_command << this->GetOption("CPACK_COMMAND_SETFILE");
@@ -490,7 +478,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Optionally we can execute a custom apple script to generate // Optionally we can execute a custom apple script to generate
// the .DS_Store for the volume folder ... // the .DS_Store for the volume folder ...
if (!had_error && !cpack_dmg_ds_store_setup_script.empty()) { if (!had_error && !cpack_dmg_ds_store_setup_script->empty()) {
std::ostringstream setup_script_command; std::ostringstream setup_script_command;
setup_script_command << "osascript" setup_script_command << "osascript"
<< " \"" << cpack_dmg_ds_store_setup_script << "\"" << " \"" << cpack_dmg_ds_store_setup_script << "\""
@@ -718,7 +706,7 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
// the current COMPONENT belongs to. // the current COMPONENT belongs to.
std::string groupVar = std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP"; "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
const char* _groupName = GetOption(groupVar); cmProp _groupName = this->GetOption(groupVar);
if (_groupName) { if (_groupName) {
std::string groupName = _groupName; std::string groupName = _groupName;
+18 -19
View File
@@ -16,6 +16,7 @@
#include "cmCPackComponentGroup.h" #include "cmCPackComponentGroup.h"
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmMakefile.h" #include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -60,7 +61,7 @@ int cmCPackExternalGenerator::PackageFiles()
return 0; return 0;
} }
const char* packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT"); cmProp packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT");
if (cmNonempty(packageScript)) { if (cmNonempty(packageScript)) {
if (!cmSystemTools::FileIsFullPath(packageScript)) { if (!cmSystemTools::FileIsFullPath(packageScript)) {
cmCPackLogger( cmCPackLogger(
@@ -76,10 +77,9 @@ int cmCPackExternalGenerator::PackageFiles()
return 0; return 0;
} }
const char* builtPackagesStr = cmProp builtPackages = this->GetOption("CPACK_EXTERNAL_BUILT_PACKAGES");
this->GetOption("CPACK_EXTERNAL_BUILT_PACKAGES"); if (builtPackages) {
if (builtPackagesStr) { cmExpandList(builtPackages, this->packageFileNames, false);
cmExpandList(builtPackagesStr, this->packageFileNames, false);
} }
} }
@@ -181,43 +181,42 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
return 0; return 0;
} }
const char* packageName = this->Parent->GetOption("CPACK_PACKAGE_NAME"); cmProp packageName = this->Parent->GetOption("CPACK_PACKAGE_NAME");
if (packageName) { if (packageName) {
root["packageName"] = packageName; root["packageName"] = *packageName;
} }
const char* packageVersion = cmProp packageVersion = this->Parent->GetOption("CPACK_PACKAGE_VERSION");
this->Parent->GetOption("CPACK_PACKAGE_VERSION");
if (packageVersion) { if (packageVersion) {
root["packageVersion"] = packageVersion; root["packageVersion"] = *packageVersion;
} }
const char* packageDescriptionFile = cmProp packageDescriptionFile =
this->Parent->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE"); this->Parent->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE");
if (packageDescriptionFile) { if (packageDescriptionFile) {
root["packageDescriptionFile"] = packageDescriptionFile; root["packageDescriptionFile"] = *packageDescriptionFile;
} }
const char* packageDescriptionSummary = cmProp packageDescriptionSummary =
this->Parent->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY"); this->Parent->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY");
if (packageDescriptionSummary) { if (packageDescriptionSummary) {
root["packageDescriptionSummary"] = packageDescriptionSummary; root["packageDescriptionSummary"] = *packageDescriptionSummary;
} }
const char* buildConfigCstr = this->Parent->GetOption("CPACK_BUILD_CONFIG"); cmProp buildConfigCstr = this->Parent->GetOption("CPACK_BUILD_CONFIG");
if (buildConfigCstr) { if (buildConfigCstr) {
root["buildConfig"] = buildConfigCstr; root["buildConfig"] = *buildConfigCstr;
} }
const char* defaultDirectoryPermissions = cmProp defaultDirectoryPermissions =
this->Parent->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS"); this->Parent->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (cmNonempty(defaultDirectoryPermissions)) { if (cmNonempty(defaultDirectoryPermissions)) {
root["defaultDirectoryPermissions"] = defaultDirectoryPermissions; root["defaultDirectoryPermissions"] = *defaultDirectoryPermissions;
} }
if (cmIsInternallyOn(this->Parent->GetOption("CPACK_SET_DESTDIR"))) { if (cmIsInternallyOn(this->Parent->GetOption("CPACK_SET_DESTDIR"))) {
root["setDestdir"] = true; root["setDestdir"] = true;
root["packagingInstallPrefix"] = root["packagingInstallPrefix"] =
this->Parent->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"); *this->Parent->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
} else { } else {
root["setDestdir"] = false; root["setDestdir"] = false;
} }
+2 -2
View File
@@ -203,11 +203,11 @@ cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
// basically a wrapper that handles the NULL-ptr return from GetOption(). // basically a wrapper that handles the NULL-ptr return from GetOption().
std::string cmCPackFreeBSDGenerator::var_lookup(const char* var_name) std::string cmCPackFreeBSDGenerator::var_lookup(const char* var_name)
{ {
const char* pv = this->GetOption(var_name); cmProp pv = this->GetOption(var_name);
if (!pv) { if (!pv) {
return std::string(); return std::string();
} }
return pv; return *pv;
} }
// Produce UCL in the given @p manifest file for the common // Produce UCL in the given @p manifest file for the common
+70 -83
View File
@@ -78,14 +78,14 @@ int cmCPackGenerator::PrepareNames()
std::string tempDirectory = std::string tempDirectory =
cmStrCat(this->GetOption("CPACK_PACKAGE_DIRECTORY"), "/_CPack_Packages/"); cmStrCat(this->GetOption("CPACK_PACKAGE_DIRECTORY"), "/_CPack_Packages/");
const char* toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG"); cmProp toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG");
if (toplevelTag) { if (toplevelTag) {
tempDirectory += toplevelTag; tempDirectory += *toplevelTag;
tempDirectory += "/"; tempDirectory += "/";
} }
tempDirectory += this->GetOption("CPACK_GENERATOR"); tempDirectory += *this->GetOption("CPACK_GENERATOR");
std::string topDirectory = tempDirectory; std::string topDirectory = tempDirectory;
const char* pfname = this->GetOption("CPACK_PACKAGE_FILE_NAME"); cmProp pfname = this->GetOption("CPACK_PACKAGE_FILE_NAME");
if (!pfname) { if (!pfname) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_PACKAGE_FILE_NAME not specified" << std::endl); "CPACK_PACKAGE_FILE_NAME not specified" << std::endl);
@@ -99,7 +99,7 @@ int cmCPackGenerator::PrepareNames()
return 0; return 0;
} }
outName += this->GetOutputExtension(); outName += this->GetOutputExtension();
const char* pdir = this->GetOption("CPACK_PACKAGE_DIRECTORY"); cmProp pdir = this->GetOption("CPACK_PACKAGE_DIRECTORY");
if (!pdir) { if (!pdir) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_PACKAGE_DIRECTORY not specified" << std::endl); "CPACK_PACKAGE_DIRECTORY not specified" << std::endl);
@@ -125,7 +125,7 @@ int cmCPackGenerator::PrepareNames()
cmCPackLogger(cmCPackLog::LOG_DEBUG, cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for: CPACK_PACKAGE_DESCRIPTION_FILE" << std::endl); "Look for: CPACK_PACKAGE_DESCRIPTION_FILE" << std::endl);
const char* descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE"); cmProp descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE");
if (descFileName && !this->GetOption("CPACK_PACKAGE_DESCRIPTION")) { if (descFileName && !this->GetOption("CPACK_PACKAGE_DESCRIPTION")) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for: " << descFileName << std::endl); "Look for: " << descFileName << std::endl);
@@ -135,7 +135,7 @@ int cmCPackGenerator::PrepareNames()
<< descFileName << "]" << std::endl); << descFileName << "]" << std::endl);
return 0; return 0;
} }
cmsys::ifstream ifs(descFileName); cmsys::ifstream ifs(descFileName->c_str());
if (!ifs) { if (!ifs) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot open description file name: " << descFileName "Cannot open description file name: " << descFileName
@@ -151,9 +151,9 @@ int cmCPackGenerator::PrepareNames()
ostr << cmXMLSafe(line) << std::endl; ostr << cmXMLSafe(line) << std::endl;
} }
this->SetOption("CPACK_PACKAGE_DESCRIPTION", ostr.str().c_str()); this->SetOption("CPACK_PACKAGE_DESCRIPTION", ostr.str().c_str());
const char* defFileName = cmProp defFileName =
this->GetOption("CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE"); this->GetOption("CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE");
if (defFileName && !strcmp(defFileName, descFileName)) { if (defFileName && (defFileName == descFileName)) {
this->SetOption("CPACK_USED_DEFAULT_PACKAGE_DESCRIPTION_FILE", "ON"); this->SetOption("CPACK_USED_DEFAULT_PACKAGE_DESCRIPTION_FILE", "ON");
} }
} }
@@ -165,7 +165,7 @@ int cmCPackGenerator::PrepareNames()
<< std::endl); << std::endl);
return 0; return 0;
} }
const char* algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM"); cmProp algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM");
if (algoSignature) { if (algoSignature) {
if (!cmCryptoHash::New(algoSignature)) { if (!cmCryptoHash::New(algoSignature)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -215,7 +215,7 @@ int cmCPackGenerator::InstallProject()
// prepare default created directory permissions // prepare default created directory permissions
mode_t default_dir_mode_v = 0; mode_t default_dir_mode_v = 0;
mode_t* default_dir_mode = nullptr; mode_t* default_dir_mode = nullptr;
const char* default_dir_install_permissions = cmProp default_dir_install_permissions =
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS"); this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (cmNonempty(default_dir_install_permissions)) { if (cmNonempty(default_dir_install_permissions)) {
std::vector<std::string> items = std::vector<std::string> items =
@@ -266,7 +266,7 @@ int cmCPackGenerator::InstallProject()
} }
// Run pre-build actions // Run pre-build actions
const char* preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS"); cmProp preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS");
if (preBuildScripts) { if (preBuildScripts) {
const auto scripts = cmExpandedList(preBuildScripts, false); const auto scripts = cmExpandedList(preBuildScripts, false);
for (const auto& script : scripts) { for (const auto& script : scripts) {
@@ -293,7 +293,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
bool setDestDir, const std::string& tempInstallDirectory) bool setDestDir, const std::string& tempInstallDirectory)
{ {
(void)setDestDir; (void)setDestDir;
const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS"); cmProp installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
if (cmNonempty(installCommands)) { if (cmNonempty(installCommands)) {
std::string tempInstallDirectoryEnv = std::string tempInstallDirectoryEnv =
cmStrCat("CMAKE_INSTALL_PREFIX=", tempInstallDirectory); cmStrCat("CMAKE_INSTALL_PREFIX=", tempInstallDirectory);
@@ -333,7 +333,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
(void)setDestDir; (void)setDestDir;
(void)tempInstallDirectory; (void)tempInstallDirectory;
std::vector<cmsys::RegularExpression> ignoreFilesRegex; std::vector<cmsys::RegularExpression> ignoreFilesRegex;
const char* cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES"); cmProp cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES");
if (cpackIgnoreFiles) { if (cpackIgnoreFiles) {
std::vector<std::string> ignoreFilesRegexString = std::vector<std::string> ignoreFilesRegexString =
cmExpandedList(cpackIgnoreFiles); cmExpandedList(cpackIgnoreFiles);
@@ -343,8 +343,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
ignoreFilesRegex.emplace_back(ifr); ignoreFilesRegex.emplace_back(ifr);
} }
} }
const char* installDirectories = cmProp installDirectories = this->GetOption("CPACK_INSTALLED_DIRECTORIES");
this->GetOption("CPACK_INSTALLED_DIRECTORIES");
if (cmNonempty(installDirectories)) { if (cmNonempty(installDirectories)) {
std::vector<std::string> installDirectoriesVector = std::vector<std::string> installDirectoriesVector =
cmExpandedList(installDirectories); cmExpandedList(installDirectories);
@@ -472,9 +471,9 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
int cmCPackGenerator::InstallProjectViaInstallScript( int cmCPackGenerator::InstallProjectViaInstallScript(
bool setDestDir, const std::string& tempInstallDirectory) bool setDestDir, const std::string& tempInstallDirectory)
{ {
const char* cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPTS"); cmProp cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPTS");
{ {
const char* const cmakeScript = this->GetOption("CPACK_INSTALL_SCRIPT"); cmProp const cmakeScript = this->GetOption("CPACK_INSTALL_SCRIPT");
if (cmakeScript && cmakeScripts) { if (cmakeScript && cmakeScripts) {
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_WARNING, cmCPackLog::LOG_WARNING,
@@ -485,7 +484,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
cmakeScripts = cmakeScript; cmakeScripts = cmakeScript;
} }
} }
if (cmakeScripts && *cmakeScripts) { if (cmakeScripts && !cmakeScripts->empty()) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT, cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install scripts: " << cmakeScripts << std::endl); "- Install scripts: " << cmakeScripts << std::endl);
std::vector<std::string> cmakeScriptsVector = cmExpandedList(cmakeScripts); std::vector<std::string> cmakeScriptsVector = cmExpandedList(cmakeScripts);
@@ -502,7 +501,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
std::string dir; std::string dir;
if (this->GetOption("CPACK_INSTALL_PREFIX")) { if (this->GetOption("CPACK_INSTALL_PREFIX")) {
dir += this->GetOption("CPACK_INSTALL_PREFIX"); dir += *this->GetOption("CPACK_INSTALL_PREFIX");
} }
this->SetOption("CMAKE_INSTALL_PREFIX", dir.c_str()); this->SetOption("CMAKE_INSTALL_PREFIX", dir.c_str());
cmCPackLogger( cmCPackLogger(
@@ -540,8 +539,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
bool setDestDir, const std::string& baseTempInstallDirectory, bool setDestDir, const std::string& baseTempInstallDirectory,
const mode_t* default_dir_mode) const mode_t* default_dir_mode)
{ {
const char* cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS"); cmProp cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
const char* cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR"); cmProp cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR");
std::string absoluteDestFiles; std::string absoluteDestFiles;
if (cmNonempty(cmakeProjects)) { if (cmNonempty(cmakeProjects)) {
if (!cmakeGenerator) { if (!cmakeGenerator) {
@@ -595,7 +594,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// Determine the installation types for this project (if provided). // Determine the installation types for this project (if provided).
std::string installTypesVar = "CPACK_" + std::string installTypesVar = "CPACK_" +
cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES"; cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES";
const char* installTypes = this->GetOption(installTypesVar); cmProp installTypes = this->GetOption(installTypesVar);
if (cmNonempty(installTypes)) { if (cmNonempty(installTypes)) {
std::vector<std::string> installTypesVector = std::vector<std::string> installTypesVector =
cmExpandedList(installTypes); cmExpandedList(installTypes);
@@ -608,7 +607,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// Determine the set of components that will be used in this project // Determine the set of components that will be used in this project
std::string componentsVar = std::string componentsVar =
"CPACK_COMPONENTS_" + cmSystemTools::UpperCase(project.Component); "CPACK_COMPONENTS_" + cmSystemTools::UpperCase(project.Component);
const char* components = this->GetOption(componentsVar); cmProp components = this->GetOption(componentsVar);
if (cmNonempty(components)) { if (cmNonempty(components)) {
cmExpandList(components, componentsVector); cmExpandList(components, componentsVector);
for (std::string const& comp : componentsVector) { for (std::string const& comp : componentsVector) {
@@ -625,12 +624,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::vector<std::string> buildConfigs; std::vector<std::string> buildConfigs;
// Try get configuration names given via `-C` CLI option // Try get configuration names given via `-C` CLI option
{ cmExpandList(this->GetOption("CPACK_BUILD_CONFIG"), buildConfigs);
const char* const buildConfigCstr =
this->GetOption("CPACK_BUILD_CONFIG");
auto buildConfig = buildConfigCstr ? buildConfigCstr : std::string{};
cmExpandList(buildConfig, buildConfigs);
}
// Remove duplicates // Remove duplicates
std::sort(buildConfigs.begin(), buildConfigs.end()); std::sort(buildConfigs.begin(), buildConfigs.end());
@@ -767,11 +761,11 @@ int cmCPackGenerator::InstallCMakeProject(
tempInstallDirectory += this->GetComponentInstallDirNameSuffix(component); tempInstallDirectory += this->GetComponentInstallDirNameSuffix(component);
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) { if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) {
tempInstallDirectory += "/"; tempInstallDirectory += "/";
tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME"); tempInstallDirectory += *this->GetOption("CPACK_PACKAGE_FILE_NAME");
} }
} }
const char* default_dir_inst_permissions = cmProp default_dir_inst_permissions =
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS"); this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (cmNonempty(default_dir_inst_permissions)) { if (cmNonempty(default_dir_inst_permissions)) {
mf.AddDefinition("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS", mf.AddDefinition("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS",
@@ -795,12 +789,13 @@ int cmCPackGenerator::InstallCMakeProject(
// I know this is tricky and awkward but it's the price for // I know this is tricky and awkward but it's the price for
// CPACK_SET_DESTDIR backward compatibility. // CPACK_SET_DESTDIR backward compatibility.
if (cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) { if (cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) {
this->SetOption("CPACK_INSTALL_PREFIX", this->SetOption(
this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")); "CPACK_INSTALL_PREFIX",
this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX").GetCStr());
} }
std::string dir; std::string dir;
if (this->GetOption("CPACK_INSTALL_PREFIX")) { if (this->GetOption("CPACK_INSTALL_PREFIX")) {
dir += this->GetOption("CPACK_INSTALL_PREFIX"); dir += *this->GetOption("CPACK_INSTALL_PREFIX");
} }
mf.AddDefinition("CMAKE_INSTALL_PREFIX", dir); mf.AddDefinition("CMAKE_INSTALL_PREFIX", dir);
@@ -979,7 +974,7 @@ int cmCPackGenerator::InstallCMakeProject(
} else { } else {
this->SetOption( this->SetOption(
absoluteDestFileComponent, absoluteDestFileComponent,
cmToCStr(mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES"))); mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES").GetCStr());
} }
} }
} }
@@ -1038,8 +1033,7 @@ int cmCPackGenerator::DoPackage()
} }
if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) { if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) {
const char* toplevelDirectory = cmProp toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if (cmSystemTools::FileExists(toplevelDirectory)) { if (cmSystemTools::FileExists(toplevelDirectory)) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Remove toplevel directory: " << toplevelDirectory "Remove toplevel directory: " << toplevelDirectory
@@ -1060,9 +1054,9 @@ int cmCPackGenerator::DoPackage()
} }
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Done install project " << std::endl); cmCPackLogger(cmCPackLog::LOG_DEBUG, "Done install project " << std::endl);
const char* tempPackageFileName = cmProp tempPackageFileName =
this->GetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME"); this->GetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME");
const char* tempDirectory = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); cmProp tempDirectory = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl); cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl);
cmsys::Glob gl; cmsys::Glob gl;
@@ -1079,7 +1073,7 @@ int cmCPackGenerator::DoPackage()
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package" << std::endl); cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package" << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Package files to: " "Package files to: "
<< (tempPackageFileName ? tempPackageFileName : "(NULL)") << (tempPackageFileName ? *tempPackageFileName : "(NULL)")
<< std::endl); << std::endl);
if (cmSystemTools::FileExists(tempPackageFileName)) { if (cmSystemTools::FileExists(tempPackageFileName)) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,
@@ -1099,9 +1093,8 @@ int cmCPackGenerator::DoPackage()
* may update this during PackageFiles. * may update this during PackageFiles.
* (either putting several names or updating the provided one) * (either putting several names or updating the provided one)
*/ */
this->packageFileNames.emplace_back(tempPackageFileName ? tempPackageFileName this->packageFileNames.emplace_back(tempPackageFileName);
: ""); this->toplevel = *tempDirectory;
this->toplevel = tempDirectory;
{ // scope that enables package generators to run internal scripts with { // scope that enables package generators to run internal scripts with
// latest CMake policies enabled // latest CMake policies enabled
cmMakefile::ScopePushPop pp{ this->MakefileMap }; cmMakefile::ScopePushPop pp{ this->MakefileMap };
@@ -1115,7 +1108,7 @@ int cmCPackGenerator::DoPackage()
} }
} }
// Run post-build actions // Run post-build actions
const char* postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS"); cmProp postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS");
if (postBuildScripts) { if (postBuildScripts) {
this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES", this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES",
cmJoin(this->packageFileNames, ";")); cmJoin(this->packageFileNames, ";"));
@@ -1135,8 +1128,8 @@ int cmCPackGenerator::DoPackage()
} }
/* Prepare checksum algorithm*/ /* Prepare checksum algorithm*/
const char* algo = this->GetOption("CPACK_PACKAGE_CHECKSUM"); cmProp algo = this->GetOption("CPACK_PACKAGE_CHECKSUM");
std::unique_ptr<cmCryptoHash> crypto = cmCryptoHash::New(algo ? algo : ""); std::unique_ptr<cmCryptoHash> crypto = cmCryptoHash::New(algo);
/* /*
* Copy the generated packages to final destination * Copy the generated packages to final destination
@@ -1151,19 +1144,19 @@ int cmCPackGenerator::DoPackage()
for (std::string const& pkgFileName : this->packageFileNames) { for (std::string const& pkgFileName : this->packageFileNames) {
std::string tmpPF(this->GetOption("CPACK_OUTPUT_FILE_PREFIX")); std::string tmpPF(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
std::string filename(cmSystemTools::GetFilenameName(pkgFileName)); std::string filename(cmSystemTools::GetFilenameName(pkgFileName));
tempPackageFileName = pkgFileName.c_str(); tempPackageFileName = cmProp(pkgFileName);
tmpPF += "/" + filename; tmpPF += "/" + filename;
const char* packageFileName = tmpPF.c_str(); const char* packageFileName = tmpPF.c_str();
cmCPackLogger(cmCPackLog::LOG_DEBUG, cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Copy final package(s): " "Copy final package(s): "
<< (tempPackageFileName ? tempPackageFileName : "(NULL)") << (tempPackageFileName ? *tempPackageFileName : "(NULL)")
<< " to " << (packageFileName ? packageFileName : "(NULL)") << " to " << (packageFileName ? packageFileName : "(NULL)")
<< std::endl); << std::endl);
if (!cmSystemTools::CopyFileIfDifferent(pkgFileName, tmpPF)) { if (!cmSystemTools::CopyFileIfDifferent(pkgFileName, tmpPF)) {
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_ERROR, cmCPackLog::LOG_ERROR,
"Problem copying the package: " "Problem copying the package: "
<< (tempPackageFileName ? tempPackageFileName : "(NULL)") << " to " << (tempPackageFileName ? *tempPackageFileName : "(NULL)") << " to "
<< (packageFileName ? packageFileName : "(NULL)") << std::endl); << (packageFileName ? packageFileName : "(NULL)") << std::endl);
return 0; return 0;
} }
@@ -1200,7 +1193,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf)
// set the running generator name // set the running generator name
this->SetOption("CPACK_GENERATOR", this->Name.c_str()); this->SetOption("CPACK_GENERATOR", this->Name.c_str());
// Load the project specific config file // Load the project specific config file
const char* config = this->GetOption("CPACK_PROJECT_CONFIG_FILE"); cmProp config = this->GetOption("CPACK_PROJECT_CONFIG_FILE");
if (config) { if (config) {
mf->ReadListFile(config); mf->ReadListFile(config);
} }
@@ -1250,15 +1243,14 @@ bool cmCPackGenerator::IsSetToEmpty(const std::string& op) const
return false; return false;
} }
const char* cmCPackGenerator::GetOption(const std::string& op) const cmProp cmCPackGenerator::GetOption(const std::string& op) const
{ {
cmProp ret = this->MakefileMap->GetDefinition(op); cmProp ret = this->MakefileMap->GetDefinition(op);
if (!ret) { if (!ret) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Warning, GetOption return NULL for: " << op << std::endl); "Warning, GetOption return NULL for: " << op << std::endl);
return nullptr;
} }
return ret->c_str(); return ret;
} }
std::vector<std::string> cmCPackGenerator::GetOptions() const std::vector<std::string> cmCPackGenerator::GetOptions() const
@@ -1311,7 +1303,7 @@ const char* cmCPackGenerator::GetPackagingInstallPrefix()
<< this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX") << "'" << this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX") << "'"
<< std::endl); << std::endl);
return this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"); return this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")->c_str();
} }
std::string cmCPackGenerator::FindTemplate(const char* name) std::string cmCPackGenerator::FindTemplate(const char* name)
@@ -1391,12 +1383,8 @@ int cmCPackGenerator::PrepareGroupingKind()
method = ONE_PACKAGE_PER_GROUP; method = ONE_PACKAGE_PER_GROUP;
} }
std::string groupingType;
// Second way to specify grouping // Second way to specify grouping
if (nullptr != this->GetOption("CPACK_COMPONENTS_GROUPING")) { std::string groupingType = *this->GetOption("CPACK_COMPONENTS_GROUPING");
groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING");
}
if (!groupingType.empty()) { if (!groupingType.empty()) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,
@@ -1477,18 +1465,18 @@ std::string cmCPackGenerator::GetComponentPackageFileName(
if (isGroupName) { if (isGroupName) {
std::string groupDispVar = "CPACK_COMPONENT_GROUP_" + std::string groupDispVar = "CPACK_COMPONENT_GROUP_" +
cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME"; cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME";
const char* groupDispName = this->GetOption(groupDispVar); cmProp groupDispName = this->GetOption(groupDispVar);
if (groupDispName) { if (groupDispName) {
suffix = "-" + std::string(groupDispName); suffix = "-" + *groupDispName;
} }
} }
/* the [single] component case */ /* the [single] component case */
else { else {
std::string dispVar = "CPACK_COMPONENT_" + std::string dispVar = "CPACK_COMPONENT_" +
cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME"; cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME";
const char* dispName = this->GetOption(dispVar); cmProp dispName = this->GetOption(dispVar);
if (dispName) { if (dispName) {
suffix = "-" + std::string(dispName); suffix = "-" + *dispName;
} }
} }
} }
@@ -1531,9 +1519,9 @@ cmCPackInstallationType* cmCPackGenerator::GetInstallationType(
"CPACK_INSTALL_TYPE_" + cmsys::SystemTools::UpperCase(name); "CPACK_INSTALL_TYPE_" + cmsys::SystemTools::UpperCase(name);
installType->Name = name; installType->Name = name;
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME"); cmProp displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
if (cmNonempty(displayName)) { if (cmNonempty(displayName)) {
installType->DisplayName = displayName; installType->DisplayName = *displayName;
} else { } else {
installType->DisplayName = installType->Name; installType->DisplayName = installType->Name;
} }
@@ -1553,9 +1541,9 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
std::string macroPrefix = std::string macroPrefix =
"CPACK_COMPONENT_" + cmsys::SystemTools::UpperCase(name); "CPACK_COMPONENT_" + cmsys::SystemTools::UpperCase(name);
component->Name = name; component->Name = name;
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME"); cmProp displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
if (cmNonempty(displayName)) { if (cmNonempty(displayName)) {
component->DisplayName = displayName; component->DisplayName = *displayName;
} else { } else {
component->DisplayName = component->Name; component->DisplayName = component->Name;
} }
@@ -1565,17 +1553,17 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->IsDownloaded = this->IsOn(macroPrefix + "_DOWNLOADED") || component->IsDownloaded = this->IsOn(macroPrefix + "_DOWNLOADED") ||
cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL")); cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
const char* archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE"); cmProp archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
if (cmNonempty(archiveFile)) { if (cmNonempty(archiveFile)) {
component->ArchiveFile = archiveFile; component->ArchiveFile = *archiveFile;
} }
const char* plist = this->GetOption(macroPrefix + "_PLIST"); cmProp plist = this->GetOption(macroPrefix + "_PLIST");
if (cmNonempty(plist)) { if (cmNonempty(plist)) {
component->Plist = plist; component->Plist = *plist;
} }
const char* groupName = this->GetOption(macroPrefix + "_GROUP"); cmProp groupName = this->GetOption(macroPrefix + "_GROUP");
if (cmNonempty(groupName)) { if (cmNonempty(groupName)) {
component->Group = this->GetComponentGroup(projectName, groupName); component->Group = this->GetComponentGroup(projectName, groupName);
component->Group->Components.push_back(component); component->Group->Components.push_back(component);
@@ -1583,13 +1571,13 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->Group = nullptr; component->Group = nullptr;
} }
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION"); cmProp description = this->GetOption(macroPrefix + "_DESCRIPTION");
if (cmNonempty(description)) { if (cmNonempty(description)) {
component->Description = description; component->Description = *description;
} }
// Determine the installation types. // Determine the installation types.
const char* installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES"); cmProp installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES");
if (cmNonempty(installTypes)) { if (cmNonempty(installTypes)) {
std::vector<std::string> installTypesVector = std::vector<std::string> installTypesVector =
cmExpandedList(installTypes); cmExpandedList(installTypes);
@@ -1600,7 +1588,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
} }
// Determine the component dependencies. // Determine the component dependencies.
const char* depends = this->GetOption(macroPrefix + "_DEPENDS"); cmProp depends = this->GetOption(macroPrefix + "_DEPENDS");
if (cmNonempty(depends)) { if (cmNonempty(depends)) {
std::vector<std::string> dependsVector = cmExpandedList(depends); std::vector<std::string> dependsVector = cmExpandedList(depends);
for (std::string const& depend : dependsVector) { for (std::string const& depend : dependsVector) {
@@ -1624,21 +1612,20 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
if (!hasGroup) { if (!hasGroup) {
// Define the group // Define the group
group->Name = name; group->Name = name;
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME"); cmProp displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
if (cmNonempty(displayName)) { if (cmNonempty(displayName)) {
group->DisplayName = displayName; group->DisplayName = *displayName;
} else { } else {
group->DisplayName = group->Name; group->DisplayName = group->Name;
} }
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION"); cmProp description = this->GetOption(macroPrefix + "_DESCRIPTION");
if (cmNonempty(description)) { if (cmNonempty(description)) {
group->Description = description; group->Description = *description;
} }
group->IsBold = this->IsOn(macroPrefix + "_BOLD_TITLE"); group->IsBold = this->IsOn(macroPrefix + "_BOLD_TITLE");
group->IsExpandedByDefault = this->IsOn(macroPrefix + "_EXPANDED"); group->IsExpandedByDefault = this->IsOn(macroPrefix + "_EXPANDED");
const char* parentGroupName = cmProp parentGroupName = this->GetOption(macroPrefix + "_PARENT_GROUP");
this->GetOption(macroPrefix + "_PARENT_GROUP");
if (cmNonempty(parentGroupName)) { if (cmNonempty(parentGroupName)) {
group->ParentGroup = group->ParentGroup =
this->GetComponentGroup(projectName, parentGroupName); this->GetComponentGroup(projectName, parentGroupName);
+2 -1
View File
@@ -12,6 +12,7 @@
#include "cm_sys_stat.h" #include "cm_sys_stat.h"
#include "cmCPackComponentGroup.h" #include "cmCPackComponentGroup.h"
#include "cmProperty.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
class cmCPackLog; class cmCPackLog;
@@ -85,7 +86,7 @@ public:
//! Set and get the options //! Set and get the options
void SetOption(const std::string& op, const char* value); void SetOption(const std::string& op, const char* value);
void SetOptionIfNotSet(const std::string& op, const char* value); void SetOptionIfNotSet(const std::string& op, const char* value);
const char* GetOption(const std::string& op) const; cmProp GetOption(const std::string& op) const;
std::vector<std::string> GetOptions() const; std::vector<std::string> GetOptions() const;
bool IsSet(const std::string& name) const; bool IsSet(const std::string& name) const;
bool IsOn(const std::string& name) const; bool IsOn(const std::string& name) const;
+13 -13
View File
@@ -19,6 +19,7 @@
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmDuration.h" #include "cmDuration.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -142,9 +143,9 @@ int cmCPackNSISGenerator::PackageFiles()
} }
std::string installerHeaderImage; std::string installerHeaderImage;
if (this->IsSet("CPACK_NSIS_MUI_HEADERIMAGE")) { if (this->IsSet("CPACK_NSIS_MUI_HEADERIMAGE")) {
installerHeaderImage = this->GetOption("CPACK_NSIS_MUI_HEADERIMAGE"); installerHeaderImage = *this->GetOption("CPACK_NSIS_MUI_HEADERIMAGE");
} else if (this->IsSet("CPACK_PACKAGE_ICON")) { } else if (this->IsSet("CPACK_PACKAGE_ICON")) {
installerHeaderImage = this->GetOption("CPACK_PACKAGE_ICON"); installerHeaderImage = *this->GetOption("CPACK_PACKAGE_ICON");
} }
if (!installerHeaderImage.empty()) { if (!installerHeaderImage.empty()) {
std::string installerIconCode = cmStrCat( std::string installerIconCode = cmStrCat(
@@ -479,8 +480,8 @@ int cmCPackNSISGenerator::InitializeInternal()
cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs"); cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs");
if (!resS || retVal || if (!resS || retVal ||
(!versionRex.find(output) && !versionRexCVS.find(output))) { (!versionRex.find(output) && !versionRexCVS.find(output))) {
const char* topDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); cmProp topDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
std::string tmpFile = cmStrCat(topDir ? topDir : ".", "/NSISOutput.log"); std::string tmpFile = cmStrCat(topDir ? *topDir : ".", "/NSISOutput.log");
cmGeneratedFileStream ofs(tmpFile); cmGeneratedFileStream ofs(tmpFile);
ofs << "# Run command: " << nsisCmd << std::endl ofs << "# Run command: " << nsisCmd << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
@@ -512,11 +513,11 @@ int cmCPackNSISGenerator::InitializeInternal()
} }
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str()); this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str());
this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin"); this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin");
const char* cpackPackageExecutables = cmProp cpackPackageExecutables =
this->GetOption("CPACK_PACKAGE_EXECUTABLES"); this->GetOption("CPACK_PACKAGE_EXECUTABLES");
const char* cpackPackageDeskTopLinks = cmProp cpackPackageDeskTopLinks =
this->GetOption("CPACK_CREATE_DESKTOP_LINKS"); this->GetOption("CPACK_CREATE_DESKTOP_LINKS");
const char* cpackNsisExecutablesDirectory = cmProp cpackNsisExecutablesDirectory =
this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY"); this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY");
std::vector<std::string> cpackPackageDesktopLinksVector; std::vector<std::string> cpackPackageDesktopLinksVector;
if (cpackPackageDeskTopLinks) { if (cpackPackageDeskTopLinks) {
@@ -589,7 +590,7 @@ int cmCPackNSISGenerator::InitializeInternal()
void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str, void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
std::ostream& deleteStr) std::ostream& deleteStr)
{ {
const char* cpackMenuLinks = this->GetOption("CPACK_NSIS_MENU_LINKS"); cmProp cpackMenuLinks = this->GetOption("CPACK_NSIS_MENU_LINKS");
if (!cpackMenuLinks) { if (!cpackMenuLinks) {
return; return;
} }
@@ -728,11 +729,10 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
} }
// Create the directory for the upload area // Create the directory for the upload area
const char* userUploadDirectory = cmProp userUploadDirectory = this->GetOption("CPACK_UPLOAD_DIRECTORY");
this->GetOption("CPACK_UPLOAD_DIRECTORY");
std::string uploadDirectory; std::string uploadDirectory;
if (cmNonempty(userUploadDirectory)) { if (cmNonempty(userUploadDirectory)) {
uploadDirectory = userUploadDirectory; uploadDirectory = *userUploadDirectory;
} else { } else {
uploadDirectory = uploadDirectory =
cmStrCat(this->GetOption("CPACK_PACKAGE_DIRECTORY"), "/CPackUploads"); cmStrCat(this->GetOption("CPACK_PACKAGE_DIRECTORY"), "/CPackUploads");
@@ -968,9 +968,9 @@ std::string cmCPackNSISGenerator::CreateComponentGroupDescription(
std::string cmCPackNSISGenerator::CustomComponentInstallDirectory( std::string cmCPackNSISGenerator::CustomComponentInstallDirectory(
cm::string_view componentName) cm::string_view componentName)
{ {
const char* outputDir = this->GetOption( cmProp outputDir = this->GetOption(
cmStrCat("CPACK_NSIS_", componentName, "_INSTALL_DIRECTORY")); cmStrCat("CPACK_NSIS_", componentName, "_INSTALL_DIRECTORY"));
return outputDir ? outputDir : "$INSTDIR"; return outputDir ? *outputDir : "$INSTDIR";
} }
std::string cmCPackNSISGenerator::TranslateNewlines(std::string str) std::string cmCPackNSISGenerator::TranslateNewlines(std::string str)
+3 -2
View File
@@ -12,6 +12,7 @@
#include "cmCPackComponentGroup.h" #include "cmCPackComponentGroup.h"
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -120,7 +121,7 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup)
void cmCPackNuGetGenerator::AddGeneratedPackageNames() void cmCPackNuGetGenerator::AddGeneratedPackageNames()
{ {
const char* const files_list = this->GetOption("GEN_CPACK_OUTPUT_FILES"); cmProp const files_list = this->GetOption("GEN_CPACK_OUTPUT_FILES");
if (!files_list) { if (!files_list) {
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_ERROR, cmCPackLog::LOG_ERROR,
@@ -129,7 +130,7 @@ void cmCPackNuGetGenerator::AddGeneratedPackageNames()
return; return;
} }
// add the generated packages to package file names list // add the generated packages to package file names list
std::string fileNames{ files_list }; const std::string& fileNames = *files_list;
const char sep = ';'; const char sep = ';';
std::string::size_type pos1 = 0; std::string::size_type pos1 = 0;
std::string::size_type pos2 = fileNames.find(sep, pos1 + 1); std::string::size_type pos2 = fileNames.find(sep, pos1 + 1);
+6 -5
View File
@@ -10,6 +10,7 @@
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmDuration.h" #include "cmDuration.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -22,7 +23,7 @@ int cmCPackOSXX11Generator::PackageFiles()
// TODO: Use toplevel ? // TODO: Use toplevel ?
// It is used! Is this an obsolete comment? // It is used! Is this an obsolete comment?
const char* cpackPackageExecutables = cmProp cpackPackageExecutables =
this->GetOption("CPACK_PACKAGE_EXECUTABLES"); this->GetOption("CPACK_PACKAGE_EXECUTABLES");
if (cpackPackageExecutables) { if (cpackPackageExecutables) {
cmCPackLogger(cmCPackLog::LOG_DEBUG, cmCPackLogger(cmCPackLog::LOG_DEBUG,
@@ -70,7 +71,7 @@ int cmCPackOSXX11Generator::PackageFiles()
const char* scrDir = scriptDirectory.c_str(); const char* scrDir = scriptDirectory.c_str();
const char* contDir = contentsDirectory.c_str(); const char* contDir = contentsDirectory.c_str();
const char* rsrcFile = resourceFileName.c_str(); const char* rsrcFile = resourceFileName.c_str();
const char* iconFile = this->GetOption("CPACK_PACKAGE_ICON"); cmProp iconFile = this->GetOption("CPACK_PACKAGE_ICON");
if (iconFile) { if (iconFile) {
std::string iconFileName = cmsys::SystemTools::GetFilenameName(iconFile); std::string iconFileName = cmsys::SystemTools::GetFilenameName(iconFile);
if (!cmSystemTools::FileExists(iconFile)) { if (!cmSystemTools::FileExists(iconFile)) {
@@ -103,9 +104,9 @@ int cmCPackOSXX11Generator::PackageFiles()
true) || true) ||
!this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir, rsrcFile, !this->CopyResourcePlistFile("OSXScriptLauncher.rsrc", dir, rsrcFile,
true) || true) ||
!this->CopyResourcePlistFile("OSXScriptLauncher", appdir, !this->CopyResourcePlistFile(
this->GetOption("CPACK_PACKAGE_FILE_NAME"), "OSXScriptLauncher", appdir,
true)) { this->GetOption("CPACK_PACKAGE_FILE_NAME").GetCStr(), true)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem copying the resource files" << std::endl); "Problem copying the resource files" << std::endl);
return 0; return 0;
+5 -4
View File
@@ -7,6 +7,7 @@
#include "cmCPackComponentGroup.h" #include "cmCPackComponentGroup.h"
#include "cmCPackGenerator.h" #include "cmCPackGenerator.h"
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmXMLWriter.h" #include "cmXMLWriter.h"
@@ -56,7 +57,7 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName,
std::string opt = (themeName == nullptr) std::string opt = (themeName == nullptr)
? cmStrCat("CPACK_", genName, "_BACKGROUND") ? cmStrCat("CPACK_", genName, "_BACKGROUND")
: cmStrCat("CPACK_", genName, "_BACKGROUND_", paramSuffix); : cmStrCat("CPACK_", genName, "_BACKGROUND_", paramSuffix);
const char* bgFileName = this->GetOption(opt); cmProp bgFileName = this->GetOption(opt);
if (bgFileName == nullptr) { if (bgFileName == nullptr) {
return; return;
} }
@@ -78,7 +79,7 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName,
xout.Attribute("file", bgFileName); xout.Attribute("file", bgFileName);
const char* param = this->GetOption(cmStrCat(opt, "_ALIGNMENT")); cmProp param = this->GetOption(cmStrCat(opt, "_ALIGNMENT"));
if (param != nullptr) { if (param != nullptr) {
xout.Attribute("alignment", param); xout.Attribute("alignment", param);
} }
@@ -315,7 +316,7 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
{ {
std::string uname = cmSystemTools::UpperCase(name); std::string uname = cmSystemTools::UpperCase(name);
std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname; std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
const char* inFileName = this->GetOption(cpackVar); cmProp inFileName = this->GetOption(cpackVar);
if (!inFileName) { if (!inFileName) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPack option: " << cpackVar.c_str() "CPack option: " << cpackVar.c_str()
@@ -351,7 +352,7 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
(name + ext).c_str()); (name + ext).c_str());
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Configure file: " << (inFileName ? inFileName : "(NULL)") "Configure file: " << (inFileName ? *inFileName : "(NULL)")
<< " to " << destFileName << std::endl); << " to " << destFileName << std::endl);
this->ConfigureFile(inFileName, destFileName); this->ConfigureFile(inFileName, destFileName);
return true; return true;
+12 -11
View File
@@ -16,6 +16,7 @@
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmDuration.h" #include "cmDuration.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmXMLWriter.h" #include "cmXMLWriter.h"
@@ -79,9 +80,9 @@ int cmCPackPackageMakerGenerator::PackageFiles()
resDir += "/en.lproj"; resDir += "/en.lproj";
} }
const char* preflight = this->GetOption("CPACK_PREFLIGHT_SCRIPT"); cmProp preflight = this->GetOption("CPACK_PREFLIGHT_SCRIPT");
const char* postflight = this->GetOption("CPACK_POSTFLIGHT_SCRIPT"); cmProp postflight = this->GetOption("CPACK_POSTFLIGHT_SCRIPT");
const char* postupgrade = this->GetOption("CPACK_POSTUPGRADE_SCRIPT"); cmProp postupgrade = this->GetOption("CPACK_POSTUPGRADE_SCRIPT");
if (this->Components.empty()) { if (this->Components.empty()) {
// Create directory structure // Create directory structure
@@ -167,10 +168,9 @@ int cmCPackPackageMakerGenerator::PackageFiles()
// Create the directory where downloaded component packages will // Create the directory where downloaded component packages will
// be placed. // be placed.
const char* userUploadDirectory = cmProp userUploadDirectory = this->GetOption("CPACK_UPLOAD_DIRECTORY");
this->GetOption("CPACK_UPLOAD_DIRECTORY");
std::string uploadDirectory; std::string uploadDirectory;
if (userUploadDirectory && *userUploadDirectory) { if (userUploadDirectory && !userUploadDirectory->empty()) {
uploadDirectory = userUploadDirectory; uploadDirectory = userUploadDirectory;
} else { } else {
uploadDirectory = uploadDirectory =
@@ -352,8 +352,8 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
"/PackageMaker.app/Contents/MacOS"); "/PackageMaker.app/Contents/MacOS");
std::string pkgPath; std::string pkgPath;
const char* inst_program = this->GetOption("CPACK_INSTALLER_PROGRAM"); cmProp inst_program = this->GetOption("CPACK_INSTALLER_PROGRAM");
if (inst_program && *inst_program) { if (inst_program && !inst_program->empty()) {
pkgPath = inst_program; pkgPath = inst_program;
} else { } else {
pkgPath = cmSystemTools::FindProgram("PackageMaker", paths, false); pkgPath = cmSystemTools::FindProgram("PackageMaker", paths, false);
@@ -427,11 +427,12 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
// Determine the package compatibility version. If it wasn't // Determine the package compatibility version. If it wasn't
// specified by the user, we define it based on which features the // specified by the user, we define it based on which features the
// user requested. // user requested.
const char* packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION"); cmProp packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION");
if (packageCompat && *packageCompat) { if (packageCompat && !packageCompat->empty()) {
unsigned int majorVersion = 10; unsigned int majorVersion = 10;
unsigned int minorVersion = 5; unsigned int minorVersion = 5;
int res = sscanf(packageCompat, "%u.%u", &majorVersion, &minorVersion); int res =
sscanf(packageCompat->c_str(), "%u.%u", &majorVersion, &minorVersion);
if (res == 2) { if (res == 2) {
this->PackageCompatibilityVersion = this->PackageCompatibilityVersion =
getVersion(majorVersion, minorVersion); getVersion(majorVersion, minorVersion);
@@ -10,6 +10,7 @@
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmDuration.h" #include "cmDuration.h"
#include "cmGeneratedFileStream.h" #include "cmGeneratedFileStream.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -87,11 +88,11 @@ int cmCPackProductBuildGenerator::PackageFiles()
std::string version = this->GetOption("CPACK_PACKAGE_VERSION"); std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
std::string productbuild = this->GetOption("CPACK_COMMAND_PRODUCTBUILD"); std::string productbuild = this->GetOption("CPACK_COMMAND_PRODUCTBUILD");
std::string identityName; std::string identityName;
if (const char* n = this->GetOption("CPACK_PRODUCTBUILD_IDENTITY_NAME")) { if (cmProp n = this->GetOption("CPACK_PRODUCTBUILD_IDENTITY_NAME")) {
identityName = n; identityName = n;
} }
std::string keychainPath; std::string keychainPath;
if (const char* p = this->GetOption("CPACK_PRODUCTBUILD_KEYCHAIN_PATH")) { if (cmProp p = this->GetOption("CPACK_PRODUCTBUILD_KEYCHAIN_PATH")) {
keychainPath = p; keychainPath = p;
} }
@@ -173,8 +174,8 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
const char* comp_name = component ? component->Name.c_str() : nullptr; const char* comp_name = component ? component->Name.c_str() : nullptr;
const char* preflight = this->GetComponentScript("PREFLIGHT", comp_name); cmProp preflight = this->GetComponentScript("PREFLIGHT", comp_name);
const char* postflight = this->GetComponentScript("POSTFLIGHT", comp_name); cmProp postflight = this->GetComponentScript("POSTFLIGHT", comp_name);
std::string resDir = packageFileDir; std::string resDir = packageFileDir;
if (component) { if (component) {
@@ -213,11 +214,11 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
std::string version = this->GetOption("CPACK_PACKAGE_VERSION"); std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
std::string pkgbuild = this->GetOption("CPACK_COMMAND_PKGBUILD"); std::string pkgbuild = this->GetOption("CPACK_COMMAND_PKGBUILD");
std::string identityName; std::string identityName;
if (const char* n = this->GetOption("CPACK_PKGBUILD_IDENTITY_NAME")) { if (cmProp n = this->GetOption("CPACK_PKGBUILD_IDENTITY_NAME")) {
identityName = n; identityName = n;
} }
std::string keychainPath; std::string keychainPath;
if (const char* p = this->GetOption("CPACK_PKGBUILD_KEYCHAIN_PATH")) { if (cmProp p = this->GetOption("CPACK_PKGBUILD_KEYCHAIN_PATH")) {
keychainPath = p; keychainPath = p;
} }
@@ -239,7 +240,7 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
return RunProductBuild(pkgCmd.str()); return RunProductBuild(pkgCmd.str());
} }
const char* cmCPackProductBuildGenerator::GetComponentScript( cmProp cmCPackProductBuildGenerator::GetComponentScript(
const char* script, const char* component_name) const char* script, const char* component_name)
{ {
std::string scriptname = std::string("CPACK_") + script + "_"; std::string scriptname = std::string("CPACK_") + script + "_";
+2 -2
View File
@@ -8,6 +8,7 @@
#include "cmCPackGenerator.h" #include "cmCPackGenerator.h"
#include "cmCPackPKGGenerator.h" #include "cmCPackPKGGenerator.h"
#include "cmProperty.h"
class cmCPackComponent; class cmCPackComponent;
@@ -45,6 +46,5 @@ protected:
const std::string& packageDir, const std::string& packageDir,
const cmCPackComponent* component); const cmCPackComponent* component);
const char* GetComponentScript(const char* script, cmProp GetComponentScript(const char* script, const char* script_component);
const char* script_component);
}; };
+2 -1
View File
@@ -12,6 +12,7 @@
#include "cmCPackComponentGroup.h" #include "cmCPackComponentGroup.h"
#include "cmCPackGenerator.h" #include "cmCPackGenerator.h"
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmStringAlgorithms.h" #include "cmStringAlgorithms.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
@@ -103,7 +104,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
this->packageFileNames.clear(); this->packageFileNames.clear();
std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
const char* mainComponent = this->GetOption("CPACK_RPM_MAIN_COMPONENT"); cmProp mainComponent = this->GetOption("CPACK_RPM_MAIN_COMPONENT");
if (this->IsOn("CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE") && if (this->IsOn("CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE") &&
!this->IsOn("CPACK_RPM_DEBUGINFO_PACKAGE")) { !this->IsOn("CPACK_RPM_DEBUGINFO_PACKAGE")) {
+1
View File
@@ -14,6 +14,7 @@
#include "cmArchiveWrite.h" #include "cmArchiveWrite.h"
#include "cmCPackGenerator.h" #include "cmCPackGenerator.h"
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include "cmProperty.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
cmCPackSTGZGenerator::cmCPackSTGZGenerator() cmCPackSTGZGenerator::cmCPackSTGZGenerator()