diff options
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 16 | ||||
-rw-r--r-- | Source/CPack/cmCPackBundleGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 22 | ||||
-rw-r--r-- | Source/CPack/cmCPackDragNDropGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 45 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 42 | ||||
-rw-r--r-- | Source/CPack/cmCPackNuGetGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/CPack/cmCPackOSXX11Generator.cxx | 8 | ||||
-rw-r--r-- | Source/CPack/cmCPackPKGGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/CPack/cmCPackPackageMakerGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/CPack/cmCPackProductBuildGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/CPack/cmCPackRPMGenerator.cxx | 26 | ||||
-rw-r--r-- | Source/CPack/cmCPackSTGZGenerator.cxx | 5 |
14 files changed, 88 insertions, 112 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 4993b40..0e2aec0 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -249,7 +249,7 @@ const char* cmCPackIFWGenerator::GetPackagingInstallPrefix() tmpPref += "packages/" + this->GetRootPackageName() + "/data"; } - this->SetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX", tmpPref.c_str()); + this->SetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX", tmpPref); return this->GetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX")->c_str(); } diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 7ec2c3f..e127c44 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -159,7 +159,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() if (!GetOption("CPACK_WIX_PRODUCT_GUID")) { std::string guid = GenerateGUID(); - SetOption("CPACK_WIX_PRODUCT_GUID", guid.c_str()); + SetOption("CPACK_WIX_PRODUCT_GUID", guid); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "CPACK_WIX_PRODUCT_GUID implicitly set to " << guid << " . " @@ -168,7 +168,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() if (!GetOption("CPACK_WIX_UPGRADE_GUID")) { std::string guid = GenerateGUID(); - SetOption("CPACK_WIX_UPGRADE_GUID", guid.c_str()); + SetOption("CPACK_WIX_UPGRADE_GUID", guid); cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_WIX_UPGRADE_GUID implicitly set to " @@ -185,7 +185,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() if (!GetOption("CPACK_WIX_LICENSE_RTF")) { std::string licenseFilename = this->CPackTopLevel + "/License.rtf"; - SetOption("CPACK_WIX_LICENSE_RTF", licenseFilename.c_str()); + SetOption("CPACK_WIX_LICENSE_RTF", licenseFilename); if (!CreateLicenseFile()) { return false; @@ -194,7 +194,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() if (!GetOption("CPACK_PACKAGE_VENDOR")) { std::string defaultVendor = "Humanity"; - SetOption("CPACK_PACKAGE_VENDOR", defaultVendor.c_str()); + SetOption("CPACK_PACKAGE_VENDOR", defaultVendor); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "CPACK_PACKAGE_VENDOR implicitly set to " @@ -208,12 +208,12 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() defaultRef = "WixUI_FeatureTree"; } - SetOption("CPACK_WIX_UI_REF", defaultRef.c_str()); + SetOption("CPACK_WIX_UI_REF", defaultRef); } cmProp packageContact = GetOption("CPACK_PACKAGE_CONTACT"); if (packageContact && !GetOption("CPACK_WIX_PROPERTY_ARPCONTACT")) { - SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact->c_str()); + SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact); } CollectExtensions("CPACK_WIX_EXTENSIONS", this->CandleExtensions); @@ -336,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").GetCStr()); + GetOption("CPACK_PACKAGE_NAME")); CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER"); CopyDefinition(includeFile, "CPACK_WIX_UI_REF"); } @@ -1177,7 +1177,7 @@ void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName, oss << " xmlns:" << ns.first << "=\"" << cmWIXSourceWriter::EscapeAttributeValue(ns.second) << '"'; } - SetOption("CPACK_WIX_CUSTOM_XMLNS_EXPANDED", oss.str().c_str()); + SetOption("CPACK_WIX_CUSTOM_XMLNS_EXPANDED", oss.str()); } void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName, diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index a2e0be4..d93ddb8 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -34,7 +34,7 @@ int cmCPackBundleGenerator::InitializeInternal() "Cannot locate codesign command" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_COMMAND_CODESIGN", codesign_path.c_str()); + this->SetOptionIfNotSet("CPACK_COMMAND_CODESIGN", codesign_path); } return this->Superclass::InitializeInternal(); diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 52b94c4..91b6c12 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -547,19 +547,17 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel, localToplevel += "/" + packageName; /* replace the TEMP DIRECTORY with the component one */ - this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel.c_str()); + this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel); packageFileName += "/" + outputFileName; /* replace proposed CPACK_OUTPUT_FILE_NAME */ - this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName.c_str()); + this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName); /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - packageFileName.c_str()); + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", packageFileName); // Tell CPackDeb.cmake the name of the component GROUP. - this->SetOption("CPACK_DEB_PACKAGE_COMPONENT", packageName.c_str()); + this->SetOption("CPACK_DEB_PACKAGE_COMPONENT", packageName); // Tell CPackDeb.cmake the path where the component is. std::string component_path = cmStrCat('/', packageName); - this->SetOption("CPACK_DEB_PACKAGE_COMPONENT_PART_PATH", - component_path.c_str()); + this->SetOption("CPACK_DEB_PACKAGE_COMPONENT_PART_PATH", component_path); if (!this->ReadListFile("Internal/CPack/CPackDeb.cmake")) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackDeb.cmake" << std::endl); @@ -639,19 +637,17 @@ int cmCPackDebGenerator::PackageComponentsAllInOne( } /* replace the TEMP DIRECTORY with the component one */ - this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel.c_str()); + this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel); packageFileName += "/" + outputFileName; /* replace proposed CPACK_OUTPUT_FILE_NAME */ - this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName.c_str()); + this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName); /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - packageFileName.c_str()); + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", packageFileName); if (!compInstDirName.empty()) { // Tell CPackDeb.cmake the path where the component is. std::string component_path = cmStrCat('/', compInstDirName); - this->SetOption("CPACK_DEB_PACKAGE_COMPONENT_PART_PATH", - component_path.c_str()); + this->SetOption("CPACK_DEB_PACKAGE_COMPONENT_PART_PATH", component_path); } if (!this->ReadListFile("Internal/CPack/CPackDeb.cmake")) { cmCPackLogger(cmCPackLog::LOG_ERROR, diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index a4e4ab3..36ab414 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -77,7 +77,7 @@ int cmCPackDragNDropGenerator::InitializeInternal() "Cannot locate hdiutil command" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path.c_str()); + this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path); const std::string setfile_path = cmSystemTools::FindProgram("SetFile", paths, false); @@ -86,7 +86,7 @@ int cmCPackDragNDropGenerator::InitializeInternal() "Cannot locate SetFile command" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path.c_str()); + this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path); const std::string rez_path = cmSystemTools::FindProgram("Rez", paths, false); if (rez_path.empty()) { @@ -94,7 +94,7 @@ int cmCPackDragNDropGenerator::InitializeInternal() "Cannot locate Rez command" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_COMMAND_REZ", rez_path.c_str()); + this->SetOptionIfNotSet("CPACK_COMMAND_REZ", rez_path); if (this->IsSet("CPACK_DMG_SLA_DIR")) { slaDirectory = this->GetOption("CPACK_DMG_SLA_DIR"); diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index f55b068..43efcf4 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -107,21 +107,19 @@ int cmCPackGenerator::PrepareNames() } std::string destFile = pdir; - this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PREFIX", destFile.c_str()); + this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PREFIX", destFile); destFile += "/" + outName; std::string outFile = topDirectory + "/" + outName; - this->SetOptionIfNotSet("CPACK_TOPLEVEL_DIRECTORY", topDirectory.c_str()); - this->SetOptionIfNotSet("CPACK_TEMPORARY_DIRECTORY", tempDirectory.c_str()); - this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_NAME", outName.c_str()); - this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PATH", destFile.c_str()); - this->SetOptionIfNotSet("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - outFile.c_str()); + this->SetOptionIfNotSet("CPACK_TOPLEVEL_DIRECTORY", topDirectory); + this->SetOptionIfNotSet("CPACK_TEMPORARY_DIRECTORY", tempDirectory); + this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_NAME", outName); + this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PATH", destFile); + this->SetOptionIfNotSet("CPACK_TEMPORARY_PACKAGE_FILE_NAME", outFile); this->SetOptionIfNotSet("CPACK_INSTALL_DIRECTORY", this->GetInstallPath()); this->SetOptionIfNotSet( "CPACK_NATIVE_INSTALL_DIRECTORY", - cmsys::SystemTools::ConvertToOutputPath(this->GetInstallPath()).c_str()); - this->SetOptionIfNotSet("CPACK_TEMPORARY_INSTALL_DIRECTORY", - tempDirectory.c_str()); + cmsys::SystemTools::ConvertToOutputPath(this->GetInstallPath())); + this->SetOptionIfNotSet("CPACK_TEMPORARY_INSTALL_DIRECTORY", tempDirectory); cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for: CPACK_PACKAGE_DESCRIPTION_FILE" << std::endl); @@ -150,7 +148,7 @@ int cmCPackGenerator::PrepareNames() while (ifs && cmSystemTools::GetLineFromStream(ifs, line)) { ostr << cmXMLSafe(line) << std::endl; } - this->SetOption("CPACK_PACKAGE_DESCRIPTION", ostr.str().c_str()); + this->SetOption("CPACK_PACKAGE_DESCRIPTION", ostr.str()); cmProp defFileName = this->GetOption("CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE"); if (defFileName && (defFileName == descFileName)) { @@ -503,7 +501,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript( if (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); cmCPackLogger( cmCPackLog::LOG_DEBUG, "- Using DESTDIR + CPACK_INSTALL_PREFIX... (this->SetOption)" @@ -512,7 +510,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript( "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'" << std::endl); } else { - this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory.c_str()); + this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory); cmCPackLogger(cmCPackLog::LOG_DEBUG, "- Using non-DESTDIR install... (this->SetOption)" @@ -523,9 +521,9 @@ int cmCPackGenerator::InstallProjectViaInstallScript( } this->SetOptionIfNotSet("CMAKE_CURRENT_BINARY_DIR", - tempInstallDirectory.c_str()); + tempInstallDirectory); this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR", - tempInstallDirectory.c_str()); + tempInstallDirectory); bool res = this->MakefileMap->ReadListFile(installScript); if (cmSystemTools::GetErrorOccuredFlag() || !res) { return 0; @@ -676,8 +674,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( this->CMakeProjects.emplace_back(std::move(project)); } } - this->SetOption("CPACK_ABSOLUTE_DESTINATION_FILES", - absoluteDestFiles.c_str()); + this->SetOption("CPACK_ABSOLUTE_DESTINATION_FILES", absoluteDestFiles); return 1; } @@ -789,9 +786,8 @@ int cmCPackGenerator::InstallCMakeProject( // I know this is tricky and awkward but it's the price for // CPACK_SET_DESTDIR backward compatibility. if (cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) { - this->SetOption( - "CPACK_INSTALL_PREFIX", - this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX").GetCStr()); + this->SetOption("CPACK_INSTALL_PREFIX", + this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")); } std::string dir; if (this->GetOption("CPACK_INSTALL_PREFIX")) { @@ -970,11 +966,10 @@ int cmCPackGenerator::InstallCMakeProject( std::string absoluteDestFilesListComponent = cmStrCat(this->GetOption(absoluteDestFileComponent), ';', *d); this->SetOption(absoluteDestFileComponent, - absoluteDestFilesListComponent.c_str()); + absoluteDestFilesListComponent); } else { - this->SetOption( - absoluteDestFileComponent, - mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES").GetCStr()); + this->SetOption(absoluteDestFileComponent, + mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")); } } } @@ -1212,7 +1207,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf) this->MakefileMap = mf; this->Name = name; // set the running generator name - this->SetOption("CPACK_GENERATOR", this->Name.c_str()); + this->SetOption("CPACK_GENERATOR", this->Name); // Load the project specific config file cmProp config = this->GetOption("CPACK_PROJECT_CONFIG_FILE"); if (config) { diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index a3b59ca..f151ff1 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -85,7 +85,7 @@ int cmCPackNSISGenerator::PackageFiles() } cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: " << str.str() << std::endl); - this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str().c_str()); + this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str()); std::vector<std::string> dirs; this->GetListOfSubdirectories(this->toplevel.c_str(), dirs); std::ostringstream dstr; @@ -121,7 +121,7 @@ int cmCPackNSISGenerator::PackageFiles() } cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: " << dstr.str() << std::endl); - this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", dstr.str().c_str()); + this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", dstr.str()); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << nsisInFileName << " to " << nsisFileName @@ -151,7 +151,7 @@ int cmCPackNSISGenerator::PackageFiles() std::string installerIconCode = cmStrCat( "!define MUI_HEADERIMAGE_BITMAP \"", installerHeaderImage, "\"\n"); this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_ICON_CODE", - installerIconCode.c_str()); + installerIconCode); } if (this->IsSet("CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP")) { @@ -159,7 +159,7 @@ int cmCPackNSISGenerator::PackageFiles() "!define MUI_WELCOMEFINISHPAGE_BITMAP \"", this->GetOption("CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP"), "\"\n"); this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_WELCOMEFINISH_CODE", - installerBitmapCode.c_str()); + installerBitmapCode); } if (this->IsSet("CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP")) { @@ -167,7 +167,7 @@ int cmCPackNSISGenerator::PackageFiles() "!define MUI_UNWELCOMEFINISHPAGE_BITMAP \"", this->GetOption("CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP"), "\"\n"); this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_UNWELCOMEFINISH_CODE", - installerBitmapCode.c_str()); + installerBitmapCode); } if (this->IsSet("CPACK_NSIS_MUI_FINISHPAGE_RUN")) { @@ -176,7 +176,7 @@ int cmCPackNSISGenerator::PackageFiles() this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY"), '\\', this->GetOption("CPACK_NSIS_MUI_FINISHPAGE_RUN"), "\"\n"); this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE", - installerRunCode.c_str()); + installerRunCode); } if (this->IsSet("CPACK_NSIS_WELCOME_TITLE")) { @@ -184,7 +184,7 @@ int cmCPackNSISGenerator::PackageFiles() cmStrCat("!define MUI_WELCOMEPAGE_TITLE \"", this->GetOption("CPACK_NSIS_WELCOME_TITLE"), "\""); this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_WELCOME_TITLE_CODE", - welcomeTitleCode.c_str()); + welcomeTitleCode); } if (this->IsSet("CPACK_NSIS_WELCOME_TITLE_3LINES")) { @@ -197,7 +197,7 @@ int cmCPackNSISGenerator::PackageFiles() cmStrCat("!define MUI_FINISHPAGE_TITLE \"", this->GetOption("CPACK_NSIS_FINISH_TITLE"), "\""); this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_FINISH_TITLE_CODE", - finishTitleCode.c_str()); + finishTitleCode); } if (this->IsSet("CPACK_NSIS_FINISH_TITLE_3LINES")) { @@ -232,15 +232,14 @@ int cmCPackNSISGenerator::PackageFiles() std::string brandingTextCode = cmStrCat("BrandingText /TRIM", brandingTextPosition, " \"", this->GetOption("CPACK_NSIS_BRANDING_TEXT"), "\"\n"); - this->SetOptionIfNotSet("CPACK_NSIS_BRANDING_TEXT_CODE", - brandingTextCode.c_str()); + this->SetOptionIfNotSet("CPACK_NSIS_BRANDING_TEXT_CODE", brandingTextCode); } if (!this->IsSet("CPACK_NSIS_IGNORE_LICENSE_PAGE")) { std::string licenceCode = cmStrCat("!insertmacro MUI_PAGE_LICENSE \"", this->GetOption("CPACK_RESOURCE_FILE_LICENSE"), "\"\n"); - this->SetOptionIfNotSet("CPACK_NSIS_LICENSE_PAGE", licenceCode.c_str()); + this->SetOptionIfNotSet("CPACK_NSIS_LICENSE_PAGE", licenceCode); } // Setup all of the component sections @@ -335,7 +334,7 @@ int cmCPackNSISGenerator::PackageFiles() componentDescriptions + groupDescriptions + "!insertmacro MUI_FUNCTION_DESCRIPTION_END\n"; this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", - componentDescriptions.c_str()); + componentDescriptions); } if (anyDownloadedComponents) { @@ -345,18 +344,15 @@ int cmCPackNSISGenerator::PackageFiles() } } - this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", - installTypesCode.c_str()); + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", installTypesCode); this->SetOptionIfNotSet("CPACK_NSIS_PAGE_COMPONENTS", "!insertmacro MUI_PAGE_COMPONENTS"); this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL", ""); - this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTIONS", - componentCode.c_str()); - this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", - sectionList.c_str()); + this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTIONS", componentCode); + this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", sectionList); this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS", - selectedVarsList.c_str()); - this->SetOption("CPACK_NSIS_DEFINES", defines.c_str()); + selectedVarsList); + this->SetOption("CPACK_NSIS_DEFINES", defines); } this->ConfigureFile(nsisInInstallOptions, nsisInstallOptions); @@ -511,7 +507,7 @@ int cmCPackNSISGenerator::InitializeInternal() cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: CVS " << versionRexCVS.match(1) << std::endl); } - this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str()); + this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath); this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin"); cmProp cpackPackageExecutables = this->GetOption("CPACK_PACKAGE_EXECUTABLES"); @@ -579,8 +575,8 @@ int cmCPackNSISGenerator::InitializeInternal() } this->CreateMenuLinks(str, deleteStr); - this->SetOptionIfNotSet("CPACK_NSIS_CREATE_ICONS", str.str().c_str()); - this->SetOptionIfNotSet("CPACK_NSIS_DELETE_ICONS", deleteStr.str().c_str()); + this->SetOptionIfNotSet("CPACK_NSIS_CREATE_ICONS", str.str()); + this->SetOptionIfNotSet("CPACK_NSIS_DELETE_ICONS", deleteStr.str()); this->SetOptionIfNotSet("CPACK_NSIS_COMPRESSOR", "lzma"); diff --git a/Source/CPack/cmCPackNuGetGenerator.cxx b/Source/CPack/cmCPackNuGetGenerator.cxx index 9e7f92a..c268f27 100644 --- a/Source/CPack/cmCPackNuGetGenerator.cxx +++ b/Source/CPack/cmCPackNuGetGenerator.cxx @@ -82,10 +82,10 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) std::back_inserter(components), [](cmCPackComponent const* comp) { return comp->Name; }); this->SetOption("CPACK_NUGET_" + compGUp + "_GROUP_COMPONENTS", - cmJoin(components, ";").c_str()); + cmJoin(components, ";")); } if (!groups.empty()) { - this->SetOption("CPACK_NUGET_GROUPS", cmJoin(groups, ";").c_str()); + this->SetOption("CPACK_NUGET_GROUPS", cmJoin(groups, ";")); } // Handle Orphan components (components not belonging to any groups) @@ -103,8 +103,7 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) } } if (!components.empty()) { - this->SetOption("CPACK_NUGET_COMPONENTS", - cmJoin(components, ";").c_str()); + this->SetOption("CPACK_NUGET_COMPONENTS", cmJoin(components, ";")); } } else { @@ -115,7 +114,7 @@ void cmCPackNuGetGenerator::SetupGroupComponentVariables(bool ignoreGroup) [](std::pair<std::string, cmCPackComponent> const& comp) { return comp.first; }); - this->SetOption("CPACK_NUGET_COMPONENTS", cmJoin(components, ";").c_str()); + this->SetOption("CPACK_NUGET_COMPONENTS", cmJoin(components, ";")); } } diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 262cc6e..8291752 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -46,8 +46,7 @@ int cmCPackOSXX11Generator::PackageFiles() it != cpackPackageExecutablesVector.end(); ++it) { std::string cpackExecutableName = *it; ++it; - this->SetOptionIfNotSet("CPACK_EXECUTABLE_NAME", - cpackExecutableName.c_str()); + this->SetOptionIfNotSet("CPACK_EXECUTABLE_NAME", cpackExecutableName); } } @@ -84,7 +83,7 @@ int cmCPackOSXX11Generator::PackageFiles() } std::string destFileName = resourcesDirectory + "/" + iconFileName; this->ConfigureFile(iconFile, destFileName, true); - this->SetOptionIfNotSet("CPACK_APPLE_GUI_ICON", iconFileName.c_str()); + this->SetOptionIfNotSet("CPACK_APPLE_GUI_ICON", iconFileName); } std::string applicationsLinkName = diskImageDirectory + "/Applications"; @@ -191,8 +190,7 @@ int cmCPackOSXX11Generator::InitializeInternal() "Cannot find hdiutil compiler" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", - pkgPath.c_str()); + this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", pkgPath); return this->Superclass::InitializeInternal(); } diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index a1eba56..171fbb2 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -167,7 +167,7 @@ void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile, // Dark Aqua this->CreateBackground("darkAqua", metapackageFile, genName, xout); - this->SetOption("CPACK_PACKAGEMAKER_CHOICES", choiceOut.str().c_str()); + this->SetOption("CPACK_PACKAGEMAKER_CHOICES", choiceOut.str()); // Create the distribution.dist file in the metapackage to turn it // into a distribution package. @@ -348,8 +348,7 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name, // Set this so that distribution.dist gets the right name (without // the path). - this->SetOption("CPACK_RESOURCE_FILE_" + uname + "_NOPATH", - (name + ext).c_str()); + this->SetOption("CPACK_RESOURCE_FILE_" + uname + "_NOPATH", (name + ext)); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << (inFileName ? *inFileName : "(NULL)") diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 33b601c..2915616 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -362,7 +362,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal() "Cannot find PackageMaker compiler" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath.c_str()); + this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath); } // Get path to the real PackageMaker, not a symlink: @@ -455,8 +455,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal() "Cannot find hdiutil compiler" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", - pkgPath.c_str()); + this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", pkgPath); return this->Superclass::InitializeInternal(); } @@ -544,8 +543,7 @@ bool cmCPackPackageMakerGenerator::GenerateComponentPackage( // Create the Info.plist file for this component std::string moduleVersionSuffix = cmStrCat('.', component.Name); - this->SetOption("CPACK_MODULE_VERSION_SUFFIX", - moduleVersionSuffix.c_str()); + this->SetOption("CPACK_MODULE_VERSION_SUFFIX", moduleVersionSuffix); std::string infoFileName = cmStrCat(component.Name, "-Info.plist"); if (!this->CopyResourcePlistFile("Info.plist", infoFileName.c_str())) { return false; diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 99c55a0..614b538 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -123,7 +123,7 @@ int cmCPackProductBuildGenerator::InitializeInternal() "Cannot find pkgbuild executable" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_COMMAND_PKGBUILD", program.c_str()); + this->SetOptionIfNotSet("CPACK_COMMAND_PKGBUILD", program); program = cmSystemTools::FindProgram("productbuild", no_paths, false); if (program.empty()) { @@ -131,7 +131,7 @@ int cmCPackProductBuildGenerator::InitializeInternal() "Cannot find productbuild executable" << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_COMMAND_PRODUCTBUILD", program.c_str()); + this->SetOptionIfNotSet("CPACK_COMMAND_PRODUCTBUILD", program); return this->Superclass::InitializeInternal(); } diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 2765c58..47db5bb 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -33,13 +33,13 @@ int cmCPackRPMGenerator::InitializeInternal() if (this->GetOption("CPACK_PACKAGE_NAME")) { std::string packageName = this->GetOption("CPACK_PACKAGE_NAME"); std::replace(packageName.begin(), packageName.end(), ' ', '-'); - this->SetOption("CPACK_PACKAGE_NAME", packageName.c_str()); + this->SetOption("CPACK_PACKAGE_NAME", packageName); } /* same for CPACK_PACKAGE_FILE_NAME */ if (this->GetOption("CPACK_PACKAGE_FILE_NAME")) { std::string packageName = this->GetOption("CPACK_PACKAGE_FILE_NAME"); std::replace(packageName.begin(), packageName.end(), ' ', '-'); - this->SetOption("CPACK_PACKAGE_FILE_NAME", packageName.c_str()); + this->SetOption("CPACK_PACKAGE_FILE_NAME", packageName); } return this->Superclass::InitializeInternal(); } @@ -74,19 +74,17 @@ int cmCPackRPMGenerator::PackageOnePack(std::string const& initialToplevel, localToplevel += "/" + packageName; /* replace the TEMP DIRECTORY with the component one */ - this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel.c_str()); + this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel); packageFileName += "/" + outputFileName; /* replace proposed CPACK_OUTPUT_FILE_NAME */ - this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName.c_str()); + this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName); /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - packageFileName.c_str()); + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", packageFileName); // Tell CPackRPM.cmake the name of the component NAME. - this->SetOption("CPACK_RPM_PACKAGE_COMPONENT", packageName.c_str()); + this->SetOption("CPACK_RPM_PACKAGE_COMPONENT", packageName); // Tell CPackRPM.cmake the path where the component is. std::string component_path = cmStrCat('/', packageName); - this->SetOption("CPACK_RPM_PACKAGE_COMPONENT_PART_PATH", - component_path.c_str()); + this->SetOption("CPACK_RPM_PACKAGE_COMPONENT_PART_PATH", component_path); if (!this->ReadListFile("Internal/CPack/CPackRPM.cmake")) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake" << std::endl); @@ -365,19 +363,17 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne( localToplevel += "/" + compInstDirName; /* replace the TEMP DIRECTORY with the component one */ - this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel.c_str()); + this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel); packageFileName += "/" + outputFileName; /* replace proposed CPACK_OUTPUT_FILE_NAME */ - this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName.c_str()); + this->SetOption("CPACK_OUTPUT_FILE_NAME", outputFileName); /* replace the TEMPORARY package file name */ - this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", - packageFileName.c_str()); + this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME", packageFileName); if (!compInstDirName.empty()) { // Tell CPackRPM.cmake the path where the component is. std::string component_path = cmStrCat('/', compInstDirName); - this->SetOption("CPACK_RPM_PACKAGE_COMPONENT_PART_PATH", - component_path.c_str()); + this->SetOption("CPACK_RPM_PACKAGE_COMPONENT_PART_PATH", component_path); } if (this->ReadListFile("Internal/CPack/CPackRPM.cmake")) { diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 7eb8cc3..4b34c08 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -34,7 +34,7 @@ int cmCPackSTGZGenerator::InitializeInternal() "Cannot find template file: " << inFile << std::endl); return 0; } - this->SetOptionIfNotSet("CPACK_STGZ_HEADER_FILE", inFile.c_str()); + this->SetOptionIfNotSet("CPACK_STGZ_HEADER_FILE", inFile); this->SetOptionIfNotSet("CPACK_AT_SIGN", "@"); return this->Superclass::InitializeInternal(); @@ -79,8 +79,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os) while (cmSystemTools::GetLineFromStream(ilfs, line)) { licenseText += line + "\n"; } - this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT", - licenseText.c_str()); + this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT", licenseText); const char headerLengthTag[] = "###CPACK_HEADER_LENGTH###"; |