summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-09 18:41:38 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-05-09 18:41:38 (GMT)
commit8245f437b6528cfa86dda12e566a32c810f2d64a (patch)
tree2a7cbdef5bc06663e403b19af241b1acb7402d63 /Source/cmGlobalGenerator.h
parent181f4cb0aff97af0b5251ad3347e00efe7310ba9 (diff)
downloadCMake-8245f437b6528cfa86dda12e566a32c810f2d64a.zip
CMake-8245f437b6528cfa86dda12e566a32c810f2d64a.tar.gz
CMake-8245f437b6528cfa86dda12e566a32c810f2d64a.tar.bz2
BUG: fix problem for non-C/CXX languages with Visual Studio, the
dependencies for the custom commands added for java were not handled correctly. Needs more work. Alex
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r--Source/cmGlobalGenerator.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 0c0cd20..65fe715 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -202,8 +202,6 @@ protected:
void FillProjectMap();
bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen);
void FillProjectToTargetMap();
- // Calls TraceVSDependencies() on all targets
- void TraceDependencies();
void CreateDefaultGlobalTargets(cmTargets* targets);
cmTarget CreateGlobalTarget(const char* name, const char* message,
const cmCustomCommandLines* commandLines,
: 53.8%;'/> -rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx20
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx45
-rw-r--r--Source/CPack/cmCPackCygwinBinaryGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackCygwinSourceGenerator.cxx15
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx171
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx52
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx37
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackGenerator.cxx153
-rw-r--r--Source/CPack/cmCPackGenerator.h3
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx26
-rw-r--r--Source/CPack/cmCPackNuGetGenerator.cxx5
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx11
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx9
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx23
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx15
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.h4
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx1
26 files changed, 483 insertions, 497 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx
index 87ebbfe..177a959 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.cxx
+++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx
@@ -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)
: nullptr;
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.h b/Source/CPack/IFW/cmCPackIFWCommon.h
index 42deda4..cf243dc 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.h
+++ b/Source/CPack/IFW/cmCPackIFWCommon.h
@@ -7,6 +7,8 @@
#include <map>
#include <string>
+#include "cmProperty.h"
+
class cmCPackIFWGenerator;
class cmXMLWriter;
@@ -26,7 +28,7 @@ public:
public:
// 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 IsSetToOff(const std::string& op) const;
bool IsSetToEmpty(const std::string& op) const;
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 2806c61..4993b40 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -14,6 +14,7 @@
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -250,7 +251,7 @@ const char* cmCPackIFWGenerator::GetPackagingInstallPrefix()
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()
@@ -273,11 +274,11 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'binarycreator' executable (needs)
- const char* BinCreatorStr = this->GetOption(BinCreatorOpt);
+ cmProp BinCreatorStr = this->GetOption(BinCreatorOpt);
if (!BinCreatorStr || cmIsNOTFOUND(BinCreatorStr)) {
this->BinCreator.clear();
} else {
- this->BinCreator = BinCreatorStr;
+ this->BinCreator = *BinCreatorStr;
}
if (this->BinCreator.empty()) {
@@ -290,16 +291,16 @@ int cmCPackIFWGenerator::InitializeInternal()
// Look 'repogen' executable (optional)
- const char* RepoGenStr = this->GetOption(RepoGenOpt);
- if (!RepoGenStr || cmIsNOTFOUND(RepoGenStr)) {
+ cmProp repoGen = this->GetOption(RepoGenOpt);
+ if (!repoGen || cmIsNOTFOUND(repoGen)) {
this->RepoGen.clear();
} else {
- this->RepoGen = RepoGenStr;
+ this->RepoGen = *repoGen;
}
// Framework version
- if (const char* FrameworkVersionSrt = this->GetOption(FrameworkVersionOpt)) {
- this->FrameworkVersion = FrameworkVersionSrt;
+ if (cmProp frameworkVersion = this->GetOption(FrameworkVersionOpt)) {
+ this->FrameworkVersion = *frameworkVersion;
} else {
this->FrameworkVersion = "1.9.9";
}
@@ -312,14 +313,13 @@ int cmCPackIFWGenerator::InitializeInternal()
// Additional packages dirs
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);
}
// Additional repositories dirs
this->RepoDirsVector.clear();
- if (const char* dirs =
- this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
+ if (cmProp dirs = this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
cmExpandList(dirs, this->RepoDirsVector);
}
@@ -330,23 +330,22 @@ int cmCPackIFWGenerator::InitializeInternal()
// Repository
this->Repository.Generator = this;
this->Repository.Name = "Unspecified";
- if (const char* site = this->GetOption("CPACK_DOWNLOAD_SITE")) {
- this->Repository.Url = site;
+ if (cmProp site = this->GetOption("CPACK_DOWNLOAD_SITE")) {
+ this->Repository.Url = *site;
this->Installer.RemoteRepositories.push_back(&this->Repository);
}
// 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);
for (std::string const& r : RepoAllVector) {
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);
- } else if (const char* cpackDownloadAll =
- this->GetOption("CPACK_DOWNLOAD_ALL")) {
+ } else if (cmProp cpackDownloadAll = this->GetOption("CPACK_DOWNLOAD_ALL")) {
this->OnlineOnly = cmIsOn(cpackDownloadAll);
} else {
this->OnlineOnly = false;
@@ -374,9 +373,8 @@ int cmCPackIFWGenerator::InitializeInternal()
}
// Output extension
- if (const char* optOutExt =
- this->GetOption("CPACK_IFW_PACKAGE_FILE_EXTENSION")) {
- this->OutputExtension = optOutExt;
+ if (cmProp optOutExt = this->GetOption("CPACK_IFW_PACKAGE_FILE_EXTENSION")) {
+ this->OutputExtension = *optOutExt;
} else if (sysName == "Darwin") {
this->OutputExtension = ".dmg";
} else {
@@ -508,21 +506,20 @@ std::string cmCPackIFWGenerator::GetRootPackageName()
{
// Default value
std::string name = "root";
- if (const char* optIFW_PACKAGE_GROUP =
+ if (cmProp optIFW_PACKAGE_GROUP =
this->GetOption("CPACK_IFW_PACKAGE_GROUP")) {
// Configure from root group
cmCPackIFWPackage package;
package.Generator = this;
package.ConfigureFromGroup(optIFW_PACKAGE_GROUP);
name = package.Name;
- } else if (const char* optIFW_PACKAGE_NAME =
+ } else if (cmProp optIFW_PACKAGE_NAME =
this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
// Configure from root package name
- name = optIFW_PACKAGE_NAME;
- } else if (const char* optPACKAGE_NAME =
- this->GetOption("CPACK_PACKAGE_NAME")) {
+ name = *optIFW_PACKAGE_NAME;
+ } else if (cmProp optPACKAGE_NAME = this->GetOption("CPACK_PACKAGE_NAME")) {
// Configure from package name
- name = optPACKAGE_NAME;
+ name = *optPACKAGE_NAME;
}
return name;
}
@@ -537,10 +534,10 @@ std::string cmCPackIFWGenerator::GetGroupPackageName(
if (cmCPackIFWPackage* package = this->GetGroupPackage(group)) {
return package->Name;
}
- const char* option =
+ cmProp option =
this->GetOption("CPACK_IFW_COMPONENT_GROUP_" +
cmsys::SystemTools::UpperCase(group->Name) + "_NAME");
- name = option ? option : group->Name;
+ name = option ? *option : group->Name;
if (group->ParentGroup) {
cmCPackIFWPackage* package = this->GetGroupPackage(group->ParentGroup);
bool dot = !this->ResolveDuplicateNames;
@@ -563,8 +560,8 @@ std::string cmCPackIFWGenerator::GetComponentPackageName(
}
std::string prefix = "CPACK_IFW_COMPONENT_" +
cmsys::SystemTools::UpperCase(component->Name) + "_";
- const char* option = this->GetOption(prefix + "NAME");
- name = option ? option : component->Name;
+ cmProp option = this->GetOption(prefix + "NAME");
+ name = option ? *option : component->Name;
if (component->Group) {
cmCPackIFWPackage* package = this->GetGroupPackage(component->Group);
if ((this->componentPackageMethod ==
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index bf8b457..23b73ff 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -12,6 +12,7 @@
#include "cmCPackIFWRepository.h"
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmXMLParser.h"
@@ -33,61 +34,59 @@ void cmCPackIFWInstaller::printSkippedOptionWarning(
void cmCPackIFWInstaller::ConfigureFromOptions()
{
// Name;
- if (const char* optIFW_PACKAGE_NAME =
- this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
- this->Name = optIFW_PACKAGE_NAME;
- } else if (const char* optPACKAGE_NAME =
- this->GetOption("CPACK_PACKAGE_NAME")) {
- this->Name = optPACKAGE_NAME;
+ if (cmProp optIFW_PACKAGE_NAME = this->GetOption("CPACK_IFW_PACKAGE_NAME")) {
+ this->Name = *optIFW_PACKAGE_NAME;
+ } else if (cmProp optPACKAGE_NAME = this->GetOption("CPACK_PACKAGE_NAME")) {
+ this->Name = *optPACKAGE_NAME;
} else {
this->Name = "Your package";
}
// Title;
- if (const char* optIFW_PACKAGE_TITLE =
+ if (cmProp optIFW_PACKAGE_TITLE =
this->GetOption("CPACK_IFW_PACKAGE_TITLE")) {
- this->Title = optIFW_PACKAGE_TITLE;
- } else if (const char* optPACKAGE_DESCRIPTION_SUMMARY =
+ this->Title = *optIFW_PACKAGE_TITLE;
+ } else if (cmProp optPACKAGE_DESCRIPTION_SUMMARY =
this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
- this->Title = optPACKAGE_DESCRIPTION_SUMMARY;
+ this->Title = *optPACKAGE_DESCRIPTION_SUMMARY;
} else {
this->Title = "Your package description";
}
// Version;
- if (const char* option = this->GetOption("CPACK_PACKAGE_VERSION")) {
- this->Version = option;
+ if (cmProp option = this->GetOption("CPACK_PACKAGE_VERSION")) {
+ this->Version = *option;
} else {
this->Version = "1.0.0";
}
// Publisher
- if (const char* optIFW_PACKAGE_PUBLISHER =
+ if (cmProp optIFW_PACKAGE_PUBLISHER =
this->GetOption("CPACK_IFW_PACKAGE_PUBLISHER")) {
- this->Publisher = optIFW_PACKAGE_PUBLISHER;
- } else if (const char* optPACKAGE_VENDOR =
+ this->Publisher = *optIFW_PACKAGE_PUBLISHER;
+ } else if (cmProp optPACKAGE_VENDOR =
this->GetOption("CPACK_PACKAGE_VENDOR")) {
- this->Publisher = optPACKAGE_VENDOR;
+ this->Publisher = *optPACKAGE_VENDOR;
}
// ProductUrl
- if (const char* option = this->GetOption("CPACK_IFW_PRODUCT_URL")) {
- this->ProductUrl = option;
+ if (cmProp option = this->GetOption("CPACK_IFW_PRODUCT_URL")) {
+ this->ProductUrl = *option;
}
// ApplicationIcon
- if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_ICON")) {
+ if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_ICON")) {
if (cmSystemTools::FileExists(option)) {
- this->InstallerApplicationIcon = option;
+ this->InstallerApplicationIcon = *option;
} else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", option);
}
}
// 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)) {
- this->InstallerWindowIcon = option;
+ this->InstallerWindowIcon = *option;
} else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", option);
}
@@ -103,45 +102,45 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Logo
- if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) {
+ if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) {
if (cmSystemTools::FileExists(option)) {
- this->Logo = option;
+ this->Logo = *option;
} else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", option);
}
}
// Watermark
- if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_WATERMARK")) {
+ if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_WATERMARK")) {
if (cmSystemTools::FileExists(option)) {
- this->Watermark = option;
+ this->Watermark = *option;
} else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", option);
}
}
// Banner
- if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_BANNER")) {
+ if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_BANNER")) {
if (cmSystemTools::FileExists(option)) {
- this->Banner = option;
+ this->Banner = *option;
} else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", option);
}
}
// Background
- if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) {
+ if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) {
if (cmSystemTools::FileExists(option)) {
- this->Background = option;
+ this->Background = *option;
} else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", option);
}
}
// 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
- this->WizardStyle = option;
+ this->WizardStyle = *option;
// Check known values
if (this->WizardStyle != "Modern" && this->WizardStyle != "Aero" &&
this->WizardStyle != "Mac" && this->WizardStyle != "Classic") {
@@ -154,28 +153,28 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// 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)) {
- this->StyleSheet = option;
+ this->StyleSheet = *option;
} else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_STYLE_SHEET", option);
}
}
// WizardDefaultWidth
- if (const char* option =
+ if (cmProp option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH")) {
- this->WizardDefaultWidth = option;
+ this->WizardDefaultWidth = *option;
}
// WizardDefaultHeight
- if (const char* option =
+ if (cmProp option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT")) {
- this->WizardDefaultHeight = option;
+ this->WizardDefaultHeight = *option;
}
// WizardShowPageList
- if (const char* option =
+ if (cmProp option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
if (!this->IsVersionLess("4.0")) {
if (this->IsSetToOff("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
@@ -204,23 +203,23 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// TitleColor
- if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) {
- this->TitleColor = option;
+ if (cmProp option = this->GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) {
+ this->TitleColor = *option;
}
// Start menu
- if (const char* optIFW_START_MENU_DIR =
+ if (cmProp optIFW_START_MENU_DIR =
this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) {
- this->StartMenuDir = optIFW_START_MENU_DIR;
+ this->StartMenuDir = *optIFW_START_MENU_DIR;
} else {
this->StartMenuDir = this->Name;
}
// Default target directory for installation
- if (const char* optIFW_TARGET_DIRECTORY =
+ if (cmProp optIFW_TARGET_DIRECTORY =
this->GetOption("CPACK_IFW_TARGET_DIRECTORY")) {
- this->TargetDir = optIFW_TARGET_DIRECTORY;
- } else if (const char* optPACKAGE_INSTALL_DIRECTORY =
+ this->TargetDir = *optIFW_TARGET_DIRECTORY;
+ } else if (cmProp optPACKAGE_INSTALL_DIRECTORY =
this->GetOption("CPACK_PACKAGE_INSTALL_DIRECTORY")) {
this->TargetDir =
cmStrCat("@ApplicationsDir@/", optPACKAGE_INSTALL_DIRECTORY);
@@ -229,21 +228,20 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Default target directory for installation with administrator rights
- if (const char* option =
- this->GetOption("CPACK_IFW_ADMIN_TARGET_DIRECTORY")) {
- this->AdminTargetDir = option;
+ if (cmProp option = this->GetOption("CPACK_IFW_ADMIN_TARGET_DIRECTORY")) {
+ this->AdminTargetDir = *option;
}
// Maintenance tool
- if (const char* optIFW_MAINTENANCE_TOOL =
+ if (cmProp optIFW_MAINTENANCE_TOOL =
this->GetOption("CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME")) {
- this->MaintenanceToolName = optIFW_MAINTENANCE_TOOL;
+ this->MaintenanceToolName = *optIFW_MAINTENANCE_TOOL;
}
// 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->MaintenanceToolIniFile = optIFW_MAINTENANCE_TOOL_INI;
+ this->MaintenanceToolIniFile = *optIFW_MAINTENANCE_TOOL_INI;
}
// Allow non-ASCII characters
@@ -265,13 +263,13 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
// Control script
- if (const char* optIFW_CONTROL_SCRIPT =
+ if (cmProp optIFW_CONTROL_SCRIPT =
this->GetOption("CPACK_IFW_PACKAGE_CONTROL_SCRIPT")) {
- this->ControlScript = optIFW_CONTROL_SCRIPT;
+ this->ControlScript = *optIFW_CONTROL_SCRIPT;
}
// Resources
- if (const char* optIFW_PACKAGE_RESOURCES =
+ if (cmProp optIFW_PACKAGE_RESOURCES =
this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) {
this->Resources.clear();
cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
@@ -541,7 +539,7 @@ void cmCPackIFWInstaller::GeneratePackageFiles()
package.Generator = this->Generator;
package.Installer = this;
// 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);
std::string forcedOption = "CPACK_IFW_COMPONENT_GROUP_" +
cmsys::SystemTools::UpperCase(option) + "_FORCED_INSTALLATION";
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index 1429c46..c1e11d2 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -15,6 +15,7 @@
#include "cmCPackIFWInstaller.h"
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
@@ -124,10 +125,10 @@ std::string cmCPackIFWPackage::GetComponentName(cmCPackComponent* component)
if (!component) {
return "";
}
- const char* option =
+ cmProp option =
this->GetOption("CPACK_IFW_COMPONENT_" +
cmsys::SystemTools::UpperCase(component->Name) + "_NAME");
- return option ? option : component->Name;
+ return option ? *option : component->Name;
}
void cmCPackIFWPackage::DefaultConfiguration()
@@ -159,23 +160,22 @@ int cmCPackIFWPackage::ConfigureFromOptions()
this->Name = this->Generator->GetRootPackageName();
// Display name
- if (const char* option = this->GetOption("CPACK_PACKAGE_NAME")) {
- this->DisplayName[""] = option;
+ if (cmProp option = this->GetOption("CPACK_PACKAGE_NAME")) {
+ this->DisplayName[""] = *option;
} else {
this->DisplayName[""] = "Your package";
}
// Description
- if (const char* option =
- this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
- this->Description[""] = option;
+ if (cmProp option = this->GetOption("CPACK_PACKAGE_DESCRIPTION_SUMMARY")) {
+ this->Description[""] = *option;
} else {
this->Description[""] = "Your package description";
}
// Version
- if (const char* option = this->GetOption("CPACK_PACKAGE_VERSION")) {
- this->Version = option;
+ if (cmProp option = this->GetOption("CPACK_PACKAGE_VERSION")) {
+ this->Version = *option;
} else {
this->Version = "1.0.0";
}
@@ -204,22 +204,22 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
this->Description[""] = component->Description;
// Version
- if (const char* optVERSION = this->GetOption(prefix + "VERSION")) {
- this->Version = optVERSION;
- } else if (const char* optPACKAGE_VERSION =
+ if (cmProp optVERSION = this->GetOption(prefix + "VERSION")) {
+ this->Version = *optVERSION;
+ } else if (cmProp optPACKAGE_VERSION =
this->GetOption("CPACK_PACKAGE_VERSION")) {
- this->Version = optPACKAGE_VERSION;
+ this->Version = *optPACKAGE_VERSION;
} else {
this->Version = "1.0.0";
}
// Script
- if (const char* option = this->GetOption(prefix + "SCRIPT")) {
- this->Script = option;
+ if (cmProp option = this->GetOption(prefix + "SCRIPT")) {
+ this->Script = *option;
}
// User interfaces
- if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) {
+ if (cmProp option = this->GetOption(prefix + "USER_INTERFACES")) {
this->UserInterfaces.clear();
cmExpandList(option, this->UserInterfaces);
}
@@ -232,7 +232,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
}
// Licenses
- if (const char* option = this->GetOption(prefix + "LICENSES")) {
+ if (cmProp option = this->GetOption(prefix + "LICENSES")) {
this->Licenses.clear();
cmExpandList(option, this->Licenses);
if (this->Licenses.size() % 2 != 0) {
@@ -246,8 +246,8 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
}
// Priority
- if (const char* option = this->GetOption(prefix + "PRIORITY")) {
- this->SortingPriority = option;
+ if (cmProp option = this->GetOption(prefix + "PRIORITY")) {
+ this->SortingPriority = *option;
cmCPackIFWLogger(
WARNING,
"The \"PRIORITY\" option is set "
@@ -289,28 +289,28 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
this->Description[""] = group->Description;
// Version
- if (const char* optVERSION = this->GetOption(prefix + "VERSION")) {
- this->Version = optVERSION;
- } else if (const char* optPACKAGE_VERSION =
+ if (cmProp optVERSION = this->GetOption(prefix + "VERSION")) {
+ this->Version = *optVERSION;
+ } else if (cmProp optPACKAGE_VERSION =
this->GetOption("CPACK_PACKAGE_VERSION")) {
- this->Version = optPACKAGE_VERSION;
+ this->Version = *optPACKAGE_VERSION;
} else {
this->Version = "1.0.0";
}
// Script
- if (const char* option = this->GetOption(prefix + "SCRIPT")) {
- this->Script = option;
+ if (cmProp option = this->GetOption(prefix + "SCRIPT")) {
+ this->Script = *option;
}
// User interfaces
- if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) {
+ if (cmProp option = this->GetOption(prefix + "USER_INTERFACES")) {
this->UserInterfaces.clear();
cmExpandList(option, this->UserInterfaces);
}
// Licenses
- if (const char* option = this->GetOption(prefix + "LICENSES")) {
+ if (cmProp option = this->GetOption(prefix + "LICENSES")) {
this->Licenses.clear();
cmExpandList(option, this->Licenses);
if (this->Licenses.size() % 2 != 0) {
@@ -324,8 +324,8 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
}
// Priority
- if (const char* option = this->GetOption(prefix + "PRIORITY")) {
- this->SortingPriority = option;
+ if (cmProp option = this->GetOption(prefix + "PRIORITY")) {
+ this->SortingPriority = *option;
cmCPackIFWLogger(
WARNING,
"The \"PRIORITY\" option is set "
@@ -346,14 +346,14 @@ int cmCPackIFWPackage::ConfigureFromGroup(const std::string& groupName)
std::string prefix =
"CPACK_COMPONENT_GROUP_" + cmsys::SystemTools::UpperCase(groupName) + "_";
- if (const char* option = this->GetOption(prefix + "DISPLAY_NAME")) {
- group.DisplayName = option;
+ if (cmProp option = this->GetOption(prefix + "DISPLAY_NAME")) {
+ group.DisplayName = *option;
} else {
group.DisplayName = group.Name;
}
- if (const char* option = this->GetOption(prefix + "DESCRIPTION")) {
- group.Description = option;
+ if (cmProp option = this->GetOption(prefix + "DESCRIPTION")) {
+ group.Description = *option;
}
group.IsBold = this->IsOn(prefix + "BOLD_TITLE");
group.IsExpandedByDefault = this->IsOn(prefix + "EXPANDED");
@@ -381,7 +381,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DISPLAY_NAME";
if (this->IsSetToEmpty(option)) {
this->DisplayName.clear();
- } else if (const char* value = this->GetOption(option)) {
+ } else if (cmProp value = this->GetOption(option)) {
cmCPackIFWPackage::ExpandListArgument(value, this->DisplayName);
}
@@ -389,7 +389,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DESCRIPTION";
if (this->IsSetToEmpty(option)) {
this->Description.clear();
- } else if (const char* value = this->GetOption(option)) {
+ } else if (cmProp value = this->GetOption(option)) {
cmCPackIFWPackage::ExpandListArgument(value, this->Description);
}
@@ -397,31 +397,31 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "RELEASE_DATE";
if (this->IsSetToEmpty(option)) {
this->ReleaseDate.clear();
- } else if (const char* value = this->GetOption(option)) {
- this->ReleaseDate = value;
+ } else if (cmProp value = this->GetOption(option)) {
+ this->ReleaseDate = *value;
}
// Sorting priority
option = prefix + "SORTING_PRIORITY";
if (this->IsSetToEmpty(option)) {
this->SortingPriority.clear();
- } else if (const char* value = this->GetOption(option)) {
- this->SortingPriority = value;
+ } else if (cmProp value = this->GetOption(option)) {
+ this->SortingPriority = *value;
}
// Update text
option = prefix + "UPDATE_TEXT";
if (this->IsSetToEmpty(option)) {
this->UpdateText.clear();
- } else if (const char* value = this->GetOption(option)) {
- this->UpdateText = value;
+ } else if (cmProp value = this->GetOption(option)) {
+ this->UpdateText = *value;
}
// Translations
option = prefix + "TRANSLATIONS";
if (this->IsSetToEmpty(option)) {
this->Translations.clear();
- } else if (const char* value = this->GetOption(option)) {
+ } else if (cmProp value = this->GetOption(option)) {
this->Translations.clear();
cmExpandList(value, this->Translations);
}
@@ -429,11 +429,11 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
// QtIFW dependencies
std::vector<std::string> deps;
option = prefix + "DEPENDS";
- if (const char* value = this->GetOption(option)) {
+ if (cmProp value = this->GetOption(option)) {
cmExpandList(value, deps);
}
option = prefix + "DEPENDENCIES";
- if (const char* value = this->GetOption(option)) {
+ if (cmProp value = this->GetOption(option)) {
cmExpandList(value, deps);
}
for (std::string const& d : deps) {
@@ -454,7 +454,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "AUTO_DEPEND_ON";
if (this->IsSetToEmpty(option)) {
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);
for (std::string const& d : depsOn) {
DependenceStruct dep(d);
@@ -483,7 +483,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "DEFAULT";
if (this->IsSetToEmpty(option)) {
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);
if (lowerValue == "true") {
this->Default = "true";
@@ -492,7 +492,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
} else if (lowerValue == "script") {
this->Default = "script";
} else {
- this->Default = value;
+ this->Default = *value;
}
}
@@ -510,7 +510,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
option = prefix + "REPLACES";
if (this->IsSetToEmpty(option)) {
this->Replaces.clear();
- } else if (const char* value = this->GetOption(option)) {
+ } else if (cmProp value = this->GetOption(option)) {
this->Replaces.clear();
cmExpandList(value, this->Replaces);
}
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx
index 7ec2256..cc64e93 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.cxx
+++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx
@@ -6,6 +6,7 @@
#include "cmCPackIFWGenerator.h"
#include "cmGeneratedFileStream.h"
+#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmXMLParser.h"
#include "cmXMLWriter.h"
@@ -55,22 +56,22 @@ bool cmCPackIFWRepository::ConfigureFromOptions()
}
// Url
- if (const char* url = this->GetOption(prefix + "URL")) {
- this->Url = url;
+ if (cmProp url = this->GetOption(prefix + "URL")) {
+ this->Url = *url;
} else {
this->Url.clear();
}
// Old url
- if (const char* oldUrl = this->GetOption(prefix + "OLD_URL")) {
- this->OldUrl = oldUrl;
+ if (cmProp oldUrl = this->GetOption(prefix + "OLD_URL")) {
+ this->OldUrl = *oldUrl;
} else {
this->OldUrl.clear();
}
// New url
- if (const char* newUrl = this->GetOption(prefix + "NEW_URL")) {
- this->NewUrl = newUrl;
+ if (cmProp newUrl = this->GetOption(prefix + "NEW_URL")) {
+ this->NewUrl = *newUrl;
} else {
this->NewUrl.clear();
}
@@ -83,22 +84,22 @@ bool cmCPackIFWRepository::ConfigureFromOptions()
}
// Username
- if (const char* username = this->GetOption(prefix + "USERNAME")) {
- this->Username = username;
+ if (cmProp username = this->GetOption(prefix + "USERNAME")) {
+ this->Username = *username;
} else {
this->Username.clear();
}
// Password
- if (const char* password = this->GetOption(prefix + "PASSWORD")) {
- this->Password = password;
+ if (cmProp password = this->GetOption(prefix + "PASSWORD")) {
+ this->Password = *password;
} else {
this->Password.clear();
}
// DisplayName
- if (const char* displayName = this->GetOption(prefix + "DISPLAY_NAME")) {
- this->DisplayName = displayName;
+ if (cmProp displayName = this->GetOption(prefix + "DISPLAY_NAME")) {
+ this->DisplayName = *displayName;
} else {
this->DisplayName.clear();
}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 8b3644f..7ec2c3f 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -18,6 +18,7 @@
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
#include "cmInstalledFile.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmUuid.h"
@@ -125,7 +126,7 @@ bool cmCPackWIXGenerator::RunLightCommand(std::string const& objectFiles)
command << " -ext " << QuotePath(ext);
}
- const char* const cultures = GetOption("CPACK_WIX_CULTURES");
+ cmProp const cultures = GetOption("CPACK_WIX_CULTURES");
if (cultures) {
command << " -cultures:" << cultures;
}
@@ -156,7 +157,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
return false;
}
- if (GetOption("CPACK_WIX_PRODUCT_GUID") == 0) {
+ if (!GetOption("CPACK_WIX_PRODUCT_GUID")) {
std::string guid = GenerateGUID();
SetOption("CPACK_WIX_PRODUCT_GUID", guid.c_str());
@@ -165,7 +166,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
<< std::endl);
}
- if (GetOption("CPACK_WIX_UPGRADE_GUID") == 0) {
+ if (!GetOption("CPACK_WIX_UPGRADE_GUID")) {
std::string guid = GenerateGUID();
SetOption("CPACK_WIX_UPGRADE_GUID", guid.c_str());
@@ -182,7 +183,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
return false;
}
- if (GetOption("CPACK_WIX_LICENSE_RTF") == 0) {
+ if (!GetOption("CPACK_WIX_LICENSE_RTF")) {
std::string licenseFilename = this->CPackTopLevel + "/License.rtf";
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";
SetOption("CPACK_PACKAGE_VENDOR", defaultVendor.c_str());
@@ -200,7 +201,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
<< defaultVendor << " . " << std::endl);
}
- if (GetOption("CPACK_WIX_UI_REF") == 0) {
+ if (!GetOption("CPACK_WIX_UI_REF")) {
std::string defaultRef = "WixUI_InstallDir";
if (!this->Components.empty()) {
@@ -210,9 +211,9 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
SetOption("CPACK_WIX_UI_REF", defaultRef.c_str());
}
- const char* packageContact = GetOption("CPACK_PACKAGE_CONTACT");
- if (packageContact != 0 && GetOption("CPACK_WIX_PROPERTY_ARPCONTACT") == 0) {
- SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact);
+ cmProp packageContact = GetOption("CPACK_PACKAGE_CONTACT");
+ if (packageContact && !GetOption("CPACK_WIX_PROPERTY_ARPCONTACT")) {
+ SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact->c_str());
}
CollectExtensions("CPACK_WIX_EXTENSIONS", this->CandleExtensions);
@@ -223,7 +224,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", this->LightExtensions);
CollectXmlNamespaces("CPACK_WIX_CUSTOM_XMLNS", this->CustomXmlNamespaces);
- const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
+ cmProp patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
if (patchFilePath) {
std::vector<std::string> patchFilePaths = cmExpandedList(patchFilePath);
@@ -295,7 +296,7 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
{
- const char* cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES");
+ cmProp cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES");
if (!cpackWixExtraSources)
return;
@@ -304,7 +305,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
{
- const char* cpackWixExtraObjects = GetOption("CPACK_WIX_EXTRA_OBJECTS");
+ cmProp cpackWixExtraObjects = GetOption("CPACK_WIX_EXTRA_OBJECTS");
if (!cpackWixExtraObjects)
return;
@@ -335,7 +336,7 @@ void cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
CopyDefinition(includeFile, "CPACK_WIX_UI_BANNER", DefinitionType::PATH);
CopyDefinition(includeFile, "CPACK_WIX_UI_DIALOG", DefinitionType::PATH);
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_UI_REF");
}
@@ -355,7 +356,7 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
for (std::string const& name : options) {
if (cmHasPrefix(name, prefix)) {
std::string id = name.substr(prefix.length());
- std::string value = GetOption(name.c_str());
+ std::string value = GetOption(name);
includeFile.BeginElement("Property");
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.AddAttribute("Id", "INSTALL_ROOT");
includeFile.AddAttribute("Secure", "yes");
@@ -405,7 +406,7 @@ void cmCPackWIXGenerator::CopyDefinition(cmWIXSourceWriter& source,
std::string const& name,
DefinitionType type)
{
- const char* value = GetOption(name.c_str());
+ cmProp value = GetOption(name);
if (value) {
if (type == DefinitionType::PATH) {
AddDefinition(source, name, CMakeToWixPath(value));
@@ -485,17 +486,17 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
}
std::string featureTitle = cpackPackageName;
- if (const char* title = GetOption("CPACK_WIX_ROOT_FEATURE_TITLE")) {
- featureTitle = title;
+ if (cmProp title = GetOption("CPACK_WIX_ROOT_FEATURE_TITLE")) {
+ featureTitle = *title;
}
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("Level", "1");
this->Patch->ApplyFragment("#PRODUCTFEATURE", featureDefinitions);
- const char* package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY");
+ cmProp package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY");
if (package) {
featureDefinitions.CreateCMakePackageRegistryEntry(
package, GetOption("CPACK_WIX_UPGRADE_GUID"));
@@ -540,10 +541,9 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
}
bool emitUninstallShortcut = true;
- const char* cpackWixProgramMenuFolder =
+ cmProp cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
- if (cpackWixProgramMenuFolder &&
- cm::string_view(cpackWixProgramMenuFolder) == ".") {
+ if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder == ".") {
emitUninstallShortcut = false;
} else if (emittedShortcutTypes.find(cmWIXShortcuts::START_MENU) ==
emittedShortcutTypes.end()) {
@@ -595,9 +595,9 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
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) {
- result = rootFolderId;
+ result = *rootFolderId;
}
if (GetArchitecture() == "x86") {
@@ -612,8 +612,8 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate()
{
std::string wixTemplate = FindTemplate("WIX.template.in");
- if (GetOption("CPACK_WIX_TEMPLATE") != 0) {
- wixTemplate = GetOption("CPACK_WIX_TEMPLATE");
+ if (cmProp wixtpl = GetOption("CPACK_WIX_TEMPLATE")) {
+ wixTemplate = *wixtpl;
}
if (wixTemplate.empty()) {
@@ -669,7 +669,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
featureDefinitions.AddAttribute("Id", featureId);
std::vector<std::string> cpackPackageExecutablesList;
- const char* cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
+ cmProp cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
if (cpackPackageExecutables) {
cmExpandList(cpackPackageExecutables, cpackPackageExecutablesList);
if (cpackPackageExecutablesList.size() % 2 != 0) {
@@ -683,8 +683,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
}
std::vector<std::string> cpackPackageDesktopLinksList;
- const char* cpackPackageDesktopLinks =
- GetOption("CPACK_CREATE_DESKTOP_LINKS");
+ cmProp cpackPackageDesktopLinks = GetOption("CPACK_CREATE_DESKTOP_LINKS");
if (cpackPackageDesktopLinks) {
cmExpandList(cpackPackageDesktopLinks, cpackPackageDesktopLinksList);
}
@@ -743,10 +742,9 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
std::string directoryId;
switch (type) {
case cmWIXShortcuts::START_MENU: {
- const char* cpackWixProgramMenuFolder =
+ cmProp cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
- if (cpackWixProgramMenuFolder &&
- cm::string_view(cpackWixProgramMenuFolder) == ".") {
+ if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder == ".") {
directoryId = "ProgramMenuFolder";
} else {
directoryId = "PROGRAM_MENU_FOLDER";
@@ -805,10 +803,9 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
fileDefinitions);
if (type == cmWIXShortcuts::START_MENU) {
- const char* cpackWixProgramMenuFolder =
+ cmProp cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
- if (cpackWixProgramMenuFolder &&
- cm::string_view(cpackWixProgramMenuFolder) != ".") {
+ if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder != ".") {
fileDefinitions.EmitRemoveFolder("CM_REMOVE_PROGRAM_MENU_FOLDER" +
idSuffix);
}
@@ -973,9 +970,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitions(
bool cmCPackWIXGenerator::RequireOption(std::string const& name,
std::string& value) const
{
- const char* tmp = GetOption(name.c_str());
+ cmProp tmp = GetOption(name);
if (tmp) {
- value = tmp;
+ value = *tmp;
return true;
} else {
@@ -1146,7 +1143,7 @@ bool cmCPackWIXGenerator::IsLegalIdCharacter(char c)
void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
extension_set_t& extensions)
{
- const char* variableContent = GetOption(variableName.c_str());
+ cmProp variableContent = GetOption(variableName);
if (!variableContent)
return;
@@ -1157,7 +1154,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
xmlns_map_t& namespaces)
{
- const char* variableContent = GetOption(variableName.c_str());
+ cmProp variableContent = GetOption(variableName);
if (!variableContent) {
return;
}
@@ -1186,7 +1183,7 @@ void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName,
std::ostream& stream)
{
- const char* variableContent = GetOption(variableName.c_str());
+ cmProp variableContent = GetOption(variableName);
if (!variableContent)
return;
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index d9234e6..4f90ba2 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackArchiveGenerator.h"
-#include <cstdlib>
#include <cstring>
#include <map>
#include <ostream>
@@ -13,6 +12,7 @@
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmGeneratedFileStream.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
@@ -77,7 +77,7 @@ std::string cmCPackArchiveGenerator::GetArchiveComponentFileName(
if (this->IsSet("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME")) {
packageFileName +=
- this->GetOption("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME");
+ *this->GetOption("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME");
} else if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) {
packageFileName += this->GetComponentPackageFileName(
this->GetOption("CPACK_ARCHIVE_FILE_NAME"), component, isGroupName);
@@ -118,11 +118,11 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) {
filePrefix = cmStrCat(this->GetOption("CPACK_PACKAGE_FILE_NAME"), '/');
}
- const char* installPrefix =
- this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
- if (installPrefix && installPrefix[0] == '/' && installPrefix[1] != 0) {
+ cmProp installPrefix = this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
+ if (installPrefix && installPrefix->size() > 1 &&
+ (*installPrefix)[0] == '/') {
// add to file prefix and remove the leading '/'
- filePrefix += installPrefix + 1;
+ filePrefix += installPrefix->substr(1);
filePrefix += "/";
}
for (std::string const& file : component->Files) {
@@ -257,9 +257,9 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne()
this->packageFileNames[0] += "/";
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 {
- this->packageFileNames[0] += this->GetOption("CPACK_PACKAGE_FILE_NAME");
+ this->packageFileNames[0] += *this->GetOption("CPACK_PACKAGE_FILE_NAME");
}
this->packageFileNames[0] += this->GetOutputExtension();
@@ -345,9 +345,9 @@ int cmCPackArchiveGenerator::GetThreadCount() const
// CPACK_ARCHIVE_THREADS overrides CPACK_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")) {
- threads = std::atoi(this->GetOption("CPACK_THREADS"));
+ threads = std::stoi(this->GetOption("CPACK_THREADS"));
}
return threads;
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index 4d5f43f..a2e0be4 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -6,6 +6,7 @@
#include <vector>
#include "cmCPackLog.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -15,8 +16,8 @@ cmCPackBundleGenerator::~cmCPackBundleGenerator() = default;
int cmCPackBundleGenerator::InitializeInternal()
{
- const char* name = this->GetOption("CPACK_BUNDLE_NAME");
- if (nullptr == name) {
+ cmProp name = this->GetOption("CPACK_BUNDLE_NAME");
+ if (!name) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_NAME must be set to use the Bundle generator."
<< std::endl);
@@ -51,30 +52,24 @@ int cmCPackBundleGenerator::ConstructBundle()
{
// Get required arguments ...
- const std::string cpack_bundle_name = this->GetOption("CPACK_BUNDLE_NAME")
- ? this->GetOption("CPACK_BUNDLE_NAME")
- : "";
- if (cpack_bundle_name.empty()) {
+ cmProp cpack_bundle_name = this->GetOption("CPACK_BUNDLE_NAME");
+ if (cpack_bundle_name->empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_NAME must be set." << std::endl);
return 0;
}
- const std::string cpack_bundle_plist = this->GetOption("CPACK_BUNDLE_PLIST")
- ? this->GetOption("CPACK_BUNDLE_PLIST")
- : "";
- if (cpack_bundle_plist.empty()) {
+ cmProp cpack_bundle_plist = this->GetOption("CPACK_BUNDLE_PLIST");
+ if (cpack_bundle_plist->empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_PLIST must be set." << std::endl);
return 0;
}
- const std::string cpack_bundle_icon = this->GetOption("CPACK_BUNDLE_ICON")
- ? this->GetOption("CPACK_BUNDLE_ICON")
- : "";
- if (cpack_bundle_icon.empty()) {
+ cmProp cpack_bundle_icon = this->GetOption("CPACK_BUNDLE_ICON");
+ if (cpack_bundle_icon->empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_BUNDLE_ICON must be set." << std::endl);
@@ -82,10 +77,8 @@ int cmCPackBundleGenerator::ConstructBundle()
}
// Get optional arguments ...
- const std::string cpack_bundle_startup_command =
- this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND")
- ? this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND")
- : "";
+ cmProp cpack_bundle_startup_command =
+ this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND");
// The staging directory contains everything that will end-up inside the
// final disk image ...
@@ -138,7 +131,7 @@ int cmCPackBundleGenerator::ConstructBundle()
// Optionally a user-provided startup command (could be an
// executable or a script) ...
- if (!cpack_bundle_startup_command.empty()) {
+ if (!cpack_bundle_startup_command->empty()) {
std::ostringstream command_source;
command_source << cpack_bundle_startup_command;
@@ -180,13 +173,10 @@ bool cmCPackBundleGenerator::SupportsComponentInstallation() const
int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
{
- const std::string cpack_apple_cert_app =
- this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP")
- ? this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP")
- : "";
+ cmProp cpack_apple_cert_app = this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP");
// codesign the application.
- if (!cpack_apple_cert_app.empty()) {
+ if (!cpack_apple_cert_app->empty()) {
std::string output;
std::string 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.
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")
: "--deep -f";
- const std::string sign_files =
- this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES")
- ? this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES")
- : "";
+ cmProp sign_files = this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES");
std::vector<std::string> relFiles = cmExpandedList(sign_files);
diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
index b5abd5a..1de5e1c 100644
--- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx
@@ -8,6 +8,7 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmProperty.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -59,14 +60,15 @@ int cmCPackCygwinBinaryGenerator::PackageFiles()
const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
{
this->OutputExtension = "-";
- const char* patchNumber = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
+ cmProp patchNumber = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if (!patchNumber) {
- patchNumber = "1";
+ this->OutputExtension += "1";
cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_CYGWIN_PATCH_NUMBER not specified using 1"
<< std::endl);
+ } else {
+ this->OutputExtension += patchNumber;
}
- this->OutputExtension += patchNumber;
this->OutputExtension += ".tar.bz2";
return this->OutputExtension.c_str();
}
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx