diff options
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 38 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/CPack/cmCPackArchiveGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/cmCPackExternalGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 36 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackPKGGenerator.cxx | 17 |
10 files changed, 65 insertions, 62 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 9dd8fe3..bc14eb4 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -585,7 +585,7 @@ std::string cmCPackIFWGenerator::GetRootPackageName() // Configure from root group cmCPackIFWPackage package; package.Generator = this; - package.ConfigureFromGroup(optIFW_PACKAGE_GROUP); + package.ConfigureFromGroup(*optIFW_PACKAGE_GROUP); name = package.Name; } else if (cmValue optIFW_PACKAGE_NAME = this->GetOption("CPACK_IFW_PACKAGE_NAME")) { diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 2feca75..69440d9 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -77,19 +77,20 @@ void cmCPackIFWInstaller::ConfigureFromOptions() // ApplicationIcon if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_ICON")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->InstallerApplicationIcon = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", *option); } } // WindowIcon if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_WINDOW_ICON")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->InstallerWindowIcon = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", + *option); } } @@ -104,37 +105,37 @@ void cmCPackIFWInstaller::ConfigureFromOptions() // Logo if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->Logo = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", *option); } } // Watermark if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_WATERMARK")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->Watermark = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", *option); } } // Banner if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_BANNER")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->Banner = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", *option); } } // Background if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->Background = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", *option); } } @@ -155,10 +156,11 @@ void cmCPackIFWInstaller::ConfigureFromOptions() // StyleSheet if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_STYLE_SHEET")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->StyleSheet = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_STYLE_SHEET", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_STYLE_SHEET", + *option); } } @@ -276,9 +278,9 @@ void cmCPackIFWInstaller::ConfigureFromOptions() // Control script if (cmValue optIFW_CONTROL_SCRIPT = this->GetOption("CPACK_IFW_PACKAGE_CONTROL_SCRIPT")) { - if (!cmSystemTools::FileExists(optIFW_CONTROL_SCRIPT)) { + if (!cmSystemTools::FileExists(*optIFW_CONTROL_SCRIPT)) { this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_CONTROL_SCRIPT", - optIFW_CONTROL_SCRIPT); + *optIFW_CONTROL_SCRIPT); } else { this->ControlScript = *optIFW_CONTROL_SCRIPT; } @@ -653,9 +655,9 @@ void cmCPackIFWInstaller::GeneratePackageFiles() package.Installer = this; // Check package group if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_GROUP")) { - package.ConfigureFromGroup(option); + package.ConfigureFromGroup(*option); std::string forcedOption = "CPACK_IFW_COMPONENT_GROUP_" + - cmsys::SystemTools::UpperCase(option) + "_FORCED_INSTALLATION"; + cmsys::SystemTools::UpperCase(*option) + "_FORCED_INSTALLATION"; if (!this->GetOption(forcedOption)) { package.ForcedInstallation = "true"; } diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index c2109c9..1668fb5 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -382,7 +382,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->DisplayName.clear(); } else if (cmValue value = this->GetOption(option)) { - cmCPackIFWPackage::ExpandListArgument(value, this->DisplayName); + cmCPackIFWPackage::ExpandListArgument(*value, this->DisplayName); } // Description @@ -390,7 +390,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->Description.clear(); } else if (cmValue value = this->GetOption(option)) { - cmCPackIFWPackage::ExpandListArgument(value, this->Description); + cmCPackIFWPackage::ExpandListArgument(*value, this->Description); } // Release date @@ -484,7 +484,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->Default.clear(); } else if (cmValue value = this->GetOption(option)) { - std::string lowerValue = cmsys::SystemTools::LowerCase(value); + std::string lowerValue = cmsys::SystemTools::LowerCase(*value); if (lowerValue == "true") { this->Default = "true"; } else if (lowerValue == "false") { diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 5dae966..aeb3db3 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -422,9 +422,9 @@ void cmCPackWIXGenerator::CopyDefinition(cmWIXSourceWriter& source, cmValue value = GetOption(name); if (value) { if (type == DefinitionType::PATH) { - AddDefinition(source, name, CMakeToWixPath(value)); + AddDefinition(source, name, CMakeToWixPath(*value)); } else { - AddDefinition(source, name, value); + AddDefinition(source, name, *value); } } } @@ -504,7 +504,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() } featureDefinitions.AddAttribute("Title", featureTitle); if (cmValue desc = GetOption("CPACK_WIX_ROOT_FEATURE_DESCRIPTION")) { - featureDefinitions.AddAttribute("Description", desc); + featureDefinitions.AddAttribute("Description", *desc); } featureDefinitions.AddAttribute("Level", "1"); this->Patch->ApplyFragment("#PRODUCTFEATURE", featureDefinitions); @@ -512,7 +512,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() cmValue package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY"); if (package) { featureDefinitions.CreateCMakePackageRegistryEntry( - package, GetOption("CPACK_WIX_UPGRADE_GUID")); + *package, GetOption("CPACK_WIX_UPGRADE_GUID")); } if (!CreateFeatureHierarchy(featureDefinitions)) { diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 894c24b..c9c069c 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -80,10 +80,10 @@ std::string cmCPackArchiveGenerator::GetArchiveComponentFileName( *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); + *this->GetOption("CPACK_ARCHIVE_FILE_NAME"), component, isGroupName); } else { packageFileName += this->GetComponentPackageFileName( - this->GetOption("CPACK_PACKAGE_FILE_NAME"), component, isGroupName); + *this->GetOption("CPACK_PACKAGE_FILE_NAME"), component, isGroupName); } packageFileName += this->GetOutputExtension(); @@ -357,9 +357,9 @@ int cmCPackArchiveGenerator::GetThreadCount() const // CPACK_ARCHIVE_THREADS overrides CPACK_THREADS if (this->IsSet("CPACK_ARCHIVE_THREADS")) { - threads = std::stoi(this->GetOption("CPACK_ARCHIVE_THREADS")); + threads = std::stoi(*this->GetOption("CPACK_ARCHIVE_THREADS")); } else if (this->IsSet("CPACK_THREADS")) { - threads = std::stoi(this->GetOption("CPACK_THREADS")); + threads = std::stoi(*this->GetOption("CPACK_THREADS")); } return threads; diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index a3b9434..6ba28d1 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -124,8 +124,8 @@ DebGenerator::DebGenerator( << debianCompressionType << std::endl); } - if (numThreads != nullptr) { - if (!cmStrToLong(numThreads, &this->NumThreads)) { + if (numThreads) { + if (!cmStrToLong(*numThreads, &this->NumThreads)) { this->NumThreads = 1; cmCPackLogger(cmCPackLog::LOG_ERROR, "Unrecognized number of threads: " << numThreads @@ -703,7 +703,7 @@ bool cmCPackDebGenerator::createDebPackages() &cmCPackDebGenerator::createDeb); cmValue dbgsymdir_path = this->GetOption("GEN_DBGSYMDIR"); 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) && retval; } diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index edd8490..4c92592 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -63,7 +63,7 @@ int cmCPackExternalGenerator::PackageFiles() cmValue packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT"); if (cmNonempty(packageScript)) { - if (!cmSystemTools::FileIsFullPath(packageScript)) { + if (!cmSystemTools::FileIsFullPath(*packageScript)) { cmCPackLogger( cmCPackLog::LOG_ERROR, "CPACK_EXTERNAL_PACKAGE_SCRIPT does not contain a full file path" @@ -71,7 +71,7 @@ int cmCPackExternalGenerator::PackageFiles() return 0; } - bool res = this->MakefileMap->ReadListFile(packageScript); + bool res = this->MakefileMap->ReadListFile(*packageScript); if (cmSystemTools::GetErrorOccurredFlag() || !res) { return 0; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 90d15f8..2ac5b3d 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -91,7 +91,7 @@ int cmCPackGenerator::PrepareNames() "CPACK_PACKAGE_FILE_NAME not specified" << std::endl); return 0; } - std::string outName = pfname; + std::string outName = *pfname; tempDirectory += "/" + outName; if (!this->GetOutputExtension()) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -106,7 +106,7 @@ int cmCPackGenerator::PrepareNames() return 0; } - std::string destFile = pdir; + std::string destFile = *pdir; this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PREFIX", destFile); destFile += "/" + outName; std::string outFile = topDirectory + "/" + outName; @@ -126,17 +126,17 @@ int cmCPackGenerator::PrepareNames() cmValue descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE"); if (descFileName && !this->GetOption("CPACK_PACKAGE_DESCRIPTION")) { cmCPackLogger(cmCPackLog::LOG_DEBUG, - "Look for: " << descFileName << std::endl); - if (!cmSystemTools::FileExists(descFileName)) { + "Look for: " << *descFileName << std::endl); + if (!cmSystemTools::FileExists(*descFileName)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find description file name: [" - << descFileName << "]" << std::endl); + << *descFileName << "]" << std::endl); return 0; } cmsys::ifstream ifs(descFileName->c_str()); if (!ifs) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Cannot open description file name: " << descFileName + "Cannot open description file name: " << *descFileName << std::endl); return 0; } @@ -144,14 +144,14 @@ int cmCPackGenerator::PrepareNames() std::string line; cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "Read description file: " << descFileName << std::endl); + "Read description file: " << *descFileName << std::endl); while (ifs && cmSystemTools::GetLineFromStream(ifs, line)) { ostr << cmXMLSafe(line) << std::endl; } this->SetOption("CPACK_PACKAGE_DESCRIPTION", ostr.str()); cmValue defFileName = this->GetOption("CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE"); - if (defFileName && (defFileName == descFileName)) { + if (defFileName && (*defFileName == *descFileName)) { this->SetOption("CPACK_USED_DEFAULT_PACKAGE_DESCRIPTION_FILE", "ON"); } } @@ -636,7 +636,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( std::unique_ptr<cmGlobalGenerator> globalGenerator = this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator( - cmakeGenerator); + *cmakeGenerator); if (!globalGenerator) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Specified package generator not found. " @@ -1050,14 +1050,14 @@ int cmCPackGenerator::DoPackage() if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) { cmValue toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); - if (cmSystemTools::FileExists(toplevelDirectory)) { + if (toplevelDirectory && cmSystemTools::FileExists(*toplevelDirectory)) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "Remove toplevel directory: " << toplevelDirectory + "Remove toplevel directory: " << *toplevelDirectory << std::endl); - if (!cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory)) { + if (!cmSystemTools::RepeatedRemoveDirectory(*toplevelDirectory)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem removing toplevel directory: " - << toplevelDirectory << std::endl); + << *toplevelDirectory << std::endl); return 0; } } @@ -1091,10 +1091,10 @@ int cmCPackGenerator::DoPackage() "Package files to: " << (tempPackageFileName ? *tempPackageFileName : "(NULL)") << std::endl); - if (cmSystemTools::FileExists(tempPackageFileName)) { + if (tempPackageFileName && cmSystemTools::FileExists(*tempPackageFileName)) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove old package file" << std::endl); - cmSystemTools::RemoveFile(tempPackageFileName); + cmSystemTools::RemoveFile(*tempPackageFileName); } if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) { tempDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); @@ -1211,7 +1211,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf) // Load the project specific config file cmValue config = this->GetOption("CPACK_PROJECT_CONFIG_FILE"); if (config) { - mf->ReadListFile(config); + mf->ReadListFile(*config); } int result = this->InitializeInternal(); if (cmSystemTools::GetErrorOccurredFlag()) { @@ -1581,7 +1581,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( cmValue groupName = this->GetOption(macroPrefix + "_GROUP"); if (cmNonempty(groupName)) { - component->Group = this->GetComponentGroup(projectName, groupName); + component->Group = this->GetComponentGroup(projectName, *groupName); component->Group->Components.push_back(component); } else { component->Group = nullptr; @@ -1644,7 +1644,7 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup( cmValue parentGroupName = this->GetOption(macroPrefix + "_PARENT_GROUP"); if (cmNonempty(parentGroupName)) { group->ParentGroup = - this->GetComponentGroup(projectName, parentGroupName); + this->GetComponentGroup(projectName, *parentGroupName); group->ParentGroup->Subgroups.push_back(group); } else { group->ParentGroup = nullptr; diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 6ca5783..d7119c5 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -473,7 +473,7 @@ int cmCPackNSISGenerator::InitializeInternal() this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLE", "makensis"); nsisPath = cmSystemTools::FindProgram( - this->GetOption("CPACK_NSIS_EXECUTABLE"), path, false); + *this->GetOption("CPACK_NSIS_EXECUTABLE"), path, false); if (nsisPath.empty()) { cmCPackLogger( diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 7b9f6cf..76ef091 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -58,16 +58,17 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, ? cmStrCat("CPACK_", genName, "_BACKGROUND") : cmStrCat("CPACK_", genName, "_BACKGROUND_", paramSuffix); cmValue bgFileName = this->GetOption(opt); - if (bgFileName == nullptr) { + if (!bgFileName) { return; } - std::string bgFilePath = cmStrCat(metapackageFile, "/Contents/", bgFileName); + std::string bgFilePath = + cmStrCat(metapackageFile, "/Contents/", *bgFileName); if (!cmSystemTools::FileExists(bgFilePath)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Background image doesn't exist in the resource directory: " - << bgFileName << std::endl); + << *bgFileName << std::endl); return; } @@ -77,16 +78,16 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, xout.StartElement(cmStrCat("background-", themeName)); } - xout.Attribute("file", bgFileName); + xout.Attribute("file", *bgFileName); cmValue param = this->GetOption(cmStrCat(opt, "_ALIGNMENT")); if (param != nullptr) { - xout.Attribute("alignment", param); + xout.Attribute("alignment", *param); } param = this->GetOption(cmStrCat(opt, "_SCALING")); if (param != nullptr) { - xout.Attribute("scaling", param); + xout.Attribute("scaling", *param); } // Apple docs say that you must provide either mime-type or uti @@ -94,12 +95,12 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, // doesn't have them, so don't make them mandatory. param = this->GetOption(cmStrCat(opt, "_MIME_TYPE")); if (param != nullptr) { - xout.Attribute("mime-type", param); + xout.Attribute("mime-type", *param); } param = this->GetOption(cmStrCat(opt, "_UTI")); if (param != nullptr) { - xout.Attribute("uti", param); + xout.Attribute("uti", *param); } xout.EndElement(); |