diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-05 13:44:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-09-13 13:54:27 (GMT) |
commit | 202a65759b98ed955af56db0415ae5033a90f740 (patch) | |
tree | 2e061a12db8ca4295987facfa96c1fb049e31220 /Source/CPack/IFW/cmCPackIFWInstaller.cxx | |
parent | 9488f8a7b7c4b4f180d16cde8a819a7a5216ef56 (diff) | |
download | CMake-202a65759b98ed955af56db0415ae5033a90f740.zip CMake-202a65759b98ed955af56db0415ae5033a90f740.tar.gz CMake-202a65759b98ed955af56db0415ae5033a90f740.tar.bz2 |
cmCPackGenerator::GetOption returns cmProp
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWInstaller.cxx')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 112 |
1 files changed, 55 insertions, 57 deletions
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"; |