diff options
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWCommon.cxx | 5 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 15 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 3 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.cxx | 19 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 27 | ||||
-rw-r--r-- | Source/CPack/cmCPackBundleGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/CPack/cmCPackDragNDropGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/cmCPackExternalGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/CPack/cmCPackFreeBSDGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 42 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 23 | ||||
-rw-r--r-- | Source/CPack/cmCPackOSXX11Generator.cxx | 4 | ||||
-rw-r--r-- | Source/CPack/cmCPackRPMGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 3 |
15 files changed, 84 insertions, 94 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx index 1e72641..5b1ccbd 100644 --- a/Source/CPack/IFW/cmCPackIFWCommon.cxx +++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx @@ -5,6 +5,7 @@ #include "cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" #include "cmCPackLog.h" // IWYU pragma: keep +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTimestamp.h" #include "cmVersionConfig.h" @@ -78,7 +79,7 @@ void cmCPackIFWCommon::ExpandListArgument( const std::string& arg, std::map<std::string, std::string>& argsOut) { std::vector<std::string> args; - cmSystemTools::ExpandListArgument(arg, args, false); + cmExpandList(arg, args, false); if (args.empty()) { return; } @@ -100,7 +101,7 @@ void cmCPackIFWCommon::ExpandListArgument( const std::string& arg, std::multimap<std::string, std::string>& argsOut) { std::vector<std::string> args; - cmSystemTools::ExpandListArgument(arg, args, false); + cmExpandList(arg, args, false); if (args.empty()) { return; } diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index c1b6eea..f0fb37a 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -11,6 +11,7 @@ #include "cmCPackLog.h" // IWYU pragma: keep #include "cmDuration.h" #include "cmGeneratedFileStream.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include <sstream> @@ -253,7 +254,7 @@ int cmCPackIFWGenerator::InitializeInternal() // Look 'binarycreator' executable (needs) const char* BinCreatorStr = this->GetOption(BinCreatorOpt); - if (!BinCreatorStr || cmSystemTools::IsNOTFOUND(BinCreatorStr)) { + if (!BinCreatorStr || cmIsNOTFOUND(BinCreatorStr)) { this->BinCreator.clear(); } else { this->BinCreator = BinCreatorStr; @@ -270,7 +271,7 @@ int cmCPackIFWGenerator::InitializeInternal() // Look 'repogen' executable (optional) const char* RepoGenStr = this->GetOption(RepoGenOpt); - if (!RepoGenStr || cmSystemTools::IsNOTFOUND(RepoGenStr)) { + if (!RepoGenStr || cmIsNOTFOUND(RepoGenStr)) { this->RepoGen.clear(); } else { this->RepoGen = RepoGenStr; @@ -292,14 +293,14 @@ int cmCPackIFWGenerator::InitializeInternal() // Additional packages dirs this->PkgsDirsVector.clear(); if (const char* dirs = this->GetOption("CPACK_IFW_PACKAGES_DIRECTORIES")) { - cmSystemTools::ExpandListArgument(dirs, this->PkgsDirsVector); + cmExpandList(dirs, this->PkgsDirsVector); } // Additional repositories dirs this->RepoDirsVector.clear(); if (const char* dirs = this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) { - cmSystemTools::ExpandListArgument(dirs, this->RepoDirsVector); + cmExpandList(dirs, this->RepoDirsVector); } // Installer @@ -317,17 +318,17 @@ int cmCPackIFWGenerator::InitializeInternal() // Repositories if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) { std::vector<std::string> RepoAllVector; - cmSystemTools::ExpandListArgument(RepoAllStr, RepoAllVector); + cmExpandList(RepoAllStr, RepoAllVector); for (std::string const& r : RepoAllVector) { this->GetRepository(r); } } if (const char* ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) { - this->OnlineOnly = cmSystemTools::IsOn(ifwDownloadAll); + this->OnlineOnly = cmIsOn(ifwDownloadAll); } else if (const char* cpackDownloadAll = this->GetOption("CPACK_DOWNLOAD_ALL")) { - this->OnlineOnly = cmSystemTools::IsOn(cpackDownloadAll); + this->OnlineOnly = cmIsOn(cpackDownloadAll); } else { this->OnlineOnly = false; } diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index f130e05..5313dd0 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -245,8 +245,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions() if (const char* optIFW_PACKAGE_RESOURCES = this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) { this->Resources.clear(); - cmSystemTools::ExpandListArgument(optIFW_PACKAGE_RESOURCES, - this->Resources); + cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources); } } diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index a1a52b1..7407c49 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -8,6 +8,7 @@ #include "cmCPackIFWInstaller.h" #include "cmCPackLog.h" // IWYU pragma: keep #include "cmGeneratedFileStream.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTimestamp.h" #include "cmXMLWriter.h" @@ -196,7 +197,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component) // User interfaces if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) { this->UserInterfaces.clear(); - cmSystemTools::ExpandListArgument(option, this->UserInterfaces); + cmExpandList(option, this->UserInterfaces); } // CMake dependencies @@ -209,7 +210,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component) // Licenses if (const char* option = this->GetOption(prefix + "LICENSES")) { this->Licenses.clear(); - cmSystemTools::ExpandListArgument(option, this->Licenses); + cmExpandList(option, this->Licenses); if (this->Licenses.size() % 2 != 0) { cmCPackIFWLogger( WARNING, @@ -281,13 +282,13 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group) // User interfaces if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) { this->UserInterfaces.clear(); - cmSystemTools::ExpandListArgument(option, this->UserInterfaces); + cmExpandList(option, this->UserInterfaces); } // Licenses if (const char* option = this->GetOption(prefix + "LICENSES")) { this->Licenses.clear(); - cmSystemTools::ExpandListArgument(option, this->Licenses); + cmExpandList(option, this->Licenses); if (this->Licenses.size() % 2 != 0) { cmCPackIFWLogger( WARNING, @@ -398,18 +399,18 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) this->Translations.clear(); } else if (const char* value = this->GetOption(option)) { this->Translations.clear(); - cmSystemTools::ExpandListArgument(value, this->Translations); + cmExpandList(value, this->Translations); } // QtIFW dependencies std::vector<std::string> deps; option = prefix + "DEPENDS"; if (const char* value = this->GetOption(option)) { - cmSystemTools::ExpandListArgument(value, deps); + cmExpandList(value, deps); } option = prefix + "DEPENDENCIES"; if (const char* value = this->GetOption(option)) { - cmSystemTools::ExpandListArgument(value, deps); + cmExpandList(value, deps); } for (std::string const& d : deps) { DependenceStruct dep(d); @@ -431,7 +432,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) this->AlienAutoDependOn.clear(); } else if (const char* value = this->GetOption(option)) { std::vector<std::string> depsOn; - cmSystemTools::ExpandListArgument(value, depsOn); + cmExpandList(value, depsOn); for (std::string const& d : depsOn) { DependenceStruct dep(d); if (this->Generator->Packages.count(dep.Name)) { @@ -488,7 +489,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) this->Replaces.clear(); } else if (const char* value = this->GetOption(option)) { this->Replaces.clear(); - cmSystemTools::ExpandListArgument(value, this->Replaces); + cmExpandList(value, this->Replaces); } // Requires admin rights diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index fa64d79..5b01ae6 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -2,11 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackWIXGenerator.h" +#include "cmAlgorithms.h" #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" #include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" #include "cmInstalledFile.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmUuid.h" #include <algorithm> @@ -226,7 +228,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE"); if (patchFilePath) { std::vector<std::string> patchFilePaths; - cmSystemTools::ExpandListArgument(patchFilePath, patchFilePaths); + cmExpandList(patchFilePath, patchFilePaths); for (std::string const& p : patchFilePaths) { if (!this->Patch->LoadFragments(p)) { @@ -237,7 +239,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() // if install folder is supposed to be set absolutely, the default // component guid "*" cannot be used - if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) { + if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) { this->ComponentGuidType = cmWIXSourceWriter::CMAKE_GENERATED_GUID; } @@ -300,7 +302,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraSources() if (!cpackWixExtraSources) return; - cmSystemTools::ExpandListArgument(cpackWixExtraSources, this->WixSources); + cmExpandList(cpackWixExtraSources, this->WixSources); } void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream) @@ -311,8 +313,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream) std::vector<std::string> expandedExtraObjects; - cmSystemTools::ExpandListArgument(cpackWixExtraObjects, - expandedExtraObjects); + cmExpandList(cpackWixExtraObjects, expandedExtraObjects); for (std::string const& obj : expandedExtraObjects) { stream << " " << QuotePath(obj); @@ -582,7 +583,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() std::string cmCPackWIXGenerator::GetRootFolderId() const { - if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) { + if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) { return ""; } @@ -664,8 +665,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature( std::vector<std::string> cpackPackageExecutablesList; const char* cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES"); if (cpackPackageExecutables) { - cmSystemTools::ExpandListArgument(cpackPackageExecutables, - cpackPackageExecutablesList); + cmExpandList(cpackPackageExecutables, cpackPackageExecutablesList); if (cpackPackageExecutablesList.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, @@ -680,8 +680,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature( const char* cpackPackageDesktopLinks = GetOption("CPACK_CREATE_DESKTOP_LINKS"); if (cpackPackageDesktopLinks) { - cmSystemTools::ExpandListArgument(cpackPackageDesktopLinks, - cpackPackageDesktopLinksList); + cmExpandList(cpackPackageDesktopLinks, cpackPackageDesktopLinksList); } AddDirectoryAndFileDefinitions( @@ -944,9 +943,7 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitions( shortcut.workingDirectoryId = directoryId; shortcuts.insert(cmWIXShortcuts::START_MENU, id, shortcut); - if (!desktopExecutables.empty() && - std::find(desktopExecutables.begin(), desktopExecutables.end(), - executableName) != desktopExecutables.end()) { + if (cmContains(desktopExecutables, executableName)) { shortcuts.insert(cmWIXShortcuts::DESKTOP, id, shortcut); } } @@ -1137,7 +1134,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName, return; std::vector<std::string> list; - cmSystemTools::ExpandListArgument(variableContent, list); + cmExpandList(variableContent, list); extensions.insert(list.begin(), list.end()); } @@ -1149,7 +1146,7 @@ void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName, return; std::vector<std::string> list; - cmSystemTools::ExpandListArgument(variableContent, list); + cmExpandList(variableContent, list); for (std::string const& i : list) { stream << " " << QuotePath(i); diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index 3a476f4..213ce92 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -6,6 +6,7 @@ #include <vector> #include "cmCPackLog.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" cmCPackBundleGenerator::cmCPackBundleGenerator() = default; @@ -206,7 +207,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) : ""; std::vector<std::string> relFiles; - cmSystemTools::ExpandListArgument(sign_files, relFiles); + cmExpandList(sign_files, relFiles); // sign the files supplied by the user, ie. frameworks. for (auto const& file : relFiles) { diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index cfb5efd..7c2f21a 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -8,6 +8,7 @@ #include "cmCPackLog.h" #include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cm_sys_stat.h" @@ -378,7 +379,7 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const control_tar.ClearPermissions(); std::vector<std::string> controlExtraList; - cmSystemTools::ExpandListArgument(ControlExtra, controlExtraList); + cmExpandList(ControlExtra, controlExtraList); for (std::string const& i : controlExtraList) { std::string filenamename = cmsys::SystemTools::GetFilenameName(i); std::string localcopy = WorkDir + "/" + filenamename; @@ -439,7 +440,7 @@ cmCPackDebGenerator::~cmCPackDebGenerator() = default; int cmCPackDebGenerator::InitializeInternal() { this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr"); - if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR"))) { + if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) { this->SetOption("CPACK_SET_DESTDIR", "I_ON"); } return this->Superclass::InitializeInternal(); diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 7a3742b..85faa61 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -6,6 +6,7 @@ #include "cmCPackLog.h" #include "cmDuration.h" #include "cmGeneratedFileStream.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmsys/FStream.hxx" @@ -128,8 +129,7 @@ int cmCPackDragNDropGenerator::InitializeInternal() } std::vector<std::string> languages; - cmSystemTools::ExpandListArgument( - this->GetOption("CPACK_DMG_SLA_LANGUAGES"), languages); + cmExpandList(this->GetOption("CPACK_DMG_SLA_LANGUAGES"), languages); if (languages.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPACK_DMG_SLA_LANGUAGES set but empty" << std::endl); @@ -527,7 +527,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::vector<std::string> languages; if (!oldStyle) { - cmSystemTools::ExpandListArgument(cpack_dmg_languages, languages); + cmExpandList(cpack_dmg_languages, languages); } cmGeneratedFileStream ofs(sla_r); diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index b4c7a5a..5dc6ace 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -5,6 +5,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" #include "cmMakefile.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cm_jsoncpp_value.h" @@ -149,8 +150,7 @@ int cmCPackExternalGenerator::InstallCMakeProject( bool cmCPackExternalGenerator::StagingEnabled() const { - return !cmSystemTools::IsOff( - this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING")); + return !cmIsOff(this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING")); } cmCPackExternalGenerator::cmCPackExternalVersionGenerator:: @@ -208,8 +208,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON( if (defaultDirectoryPermissions && *defaultDirectoryPermissions) { root["defaultDirectoryPermissions"] = defaultDirectoryPermissions; } - if (cmSystemTools::IsInternallyOn( - this->Parent->GetOption("CPACK_SET_DESTDIR"))) { + if (cmIsInternallyOn(this->Parent->GetOption("CPACK_SET_DESTDIR"))) { root["setDestdir"] = true; root["packagingInstallPrefix"] = this->Parent->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"); @@ -217,8 +216,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON( root["setDestdir"] = false; } - root["stripFiles"] = - !cmSystemTools::IsOff(this->Parent->GetOption("CPACK_STRIP_FILES")); + root["stripFiles"] = !cmIsOff(this->Parent->GetOption("CPACK_STRIP_FILES")); root["warnOnAbsoluteInstallDestination"] = this->Parent->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"); root["errorOnAbsoluteInstallDestination"] = diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx index 9fdafa4..b90a27c 100644 --- a/Source/CPack/cmCPackFreeBSDGenerator.cxx +++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx @@ -6,6 +6,7 @@ #include "cmCPackArchiveGenerator.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" // Needed for ::open() and ::stat() @@ -228,8 +229,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields( "desc", var_lookup("CPACK_FREEBSD_PACKAGE_DESCRIPTION")); manifest << ManifestKeyValue("www", var_lookup("CPACK_FREEBSD_PACKAGE_WWW")); std::vector<std::string> licenses; - cmSystemTools::ExpandListArgument( - var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses); + cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses); std::string licenselogic("single"); if (licenses.empty()) { cmSystemTools::SetFatalErrorOccured(); @@ -239,13 +239,11 @@ void cmCPackFreeBSDGenerator::write_manifest_fields( manifest << ManifestKeyValue("licenselogic", licenselogic); manifest << (ManifestKeyListValue("licenses") << licenses); std::vector<std::string> categories; - cmSystemTools::ExpandListArgument( - var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"), categories); + cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"), categories); manifest << (ManifestKeyListValue("categories") << categories); manifest << ManifestKeyValue("prefix", var_lookup("CMAKE_INSTALL_PREFIX")); std::vector<std::string> deps; - cmSystemTools::ExpandListArgument(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"), - deps); + cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"), deps); if (!deps.empty()) { manifest << (ManifestKeyDepsValue("deps") << deps); } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 3fd124b..f3de53c 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -180,8 +180,8 @@ int cmCPackGenerator::InstallProject() std::string bareTempInstallDirectory = this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY"); std::string tempInstallDirectoryStr = bareTempInstallDirectory; - bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR")) | - cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR")); + bool setDestDir = cmIsOn(this->GetOption("CPACK_SET_DESTDIR")) | + cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR")); if (!setDestDir) { tempInstallDirectoryStr += this->GetPackagingInstallPrefix(); } @@ -212,7 +212,7 @@ int cmCPackGenerator::InstallProject() this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS"); if (default_dir_install_permissions && *default_dir_install_permissions) { std::vector<std::string> items; - cmSystemTools::ExpandListArgument(default_dir_install_permissions, items); + cmExpandList(default_dir_install_permissions, items); for (const auto& arg : items) { if (!cmFSPermissions::stringToModeT(arg, default_dir_mode_v)) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -275,7 +275,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( tempInstallDirectoryEnv += tempInstallDirectory; cmSystemTools::PutEnv(tempInstallDirectoryEnv); std::vector<std::string> installCommandsVector; - cmSystemTools::ExpandListArgument(installCommands, installCommandsVector); + cmExpandList(installCommands, installCommandsVector); for (std::string const& ic : installCommandsVector) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << ic << std::endl); std::string output; @@ -312,8 +312,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( const char* cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES"); if (cpackIgnoreFiles) { std::vector<std::string> ignoreFilesRegexString; - cmSystemTools::ExpandListArgument(cpackIgnoreFiles, - ignoreFilesRegexString); + cmExpandList(cpackIgnoreFiles, ignoreFilesRegexString); for (std::string const& ifr : ignoreFilesRegexString) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Create ignore files regex for: " << ifr << std::endl); @@ -324,8 +323,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( this->GetOption("CPACK_INSTALLED_DIRECTORIES"); if (installDirectories && *installDirectories) { std::vector<std::string> installDirectoriesVector; - cmSystemTools::ExpandListArgument(installDirectories, - installDirectoriesVector); + cmExpandList(installDirectories, installDirectoriesVector); if (installDirectoriesVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, @@ -466,7 +464,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript( cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install scripts: " << cmakeScripts << std::endl); std::vector<std::string> cmakeScriptsVector; - cmSystemTools::ExpandListArgument(cmakeScripts, cmakeScriptsVector); + cmExpandList(cmakeScripts, cmakeScriptsVector); for (std::string const& installScript : cmakeScriptsVector) { cmCPackLogger(cmCPackLog::LOG_OUTPUT, @@ -531,7 +529,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( return 0; } std::vector<std::string> cmakeProjectsVector; - cmSystemTools::ExpandListArgument(cmakeProjects, cmakeProjectsVector); + cmExpandList(cmakeProjects, cmakeProjectsVector); std::vector<std::string>::iterator it; for (it = cmakeProjectsVector.begin(); it != cmakeProjectsVector.end(); ++it) { @@ -576,7 +574,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( const char* installTypes = this->GetOption(installTypesVar); if (installTypes && *installTypes) { std::vector<std::string> installTypesVector; - cmSystemTools::ExpandListArgument(installTypes, installTypesVector); + cmExpandList(installTypes, installTypesVector); for (std::string const& installType : installTypesVector) { project.InstallationTypes.push_back( this->GetInstallationType(project.ProjectName, installType)); @@ -588,7 +586,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( "CPACK_COMPONENTS_" + cmSystemTools::UpperCase(project.Component); const char* components = this->GetOption(componentsVar); if (components && *components) { - cmSystemTools::ExpandListArgument(components, componentsVector); + cmExpandList(components, componentsVector); for (std::string const& comp : componentsVector) { project.Components.push_back( this->GetComponent(project.ProjectName, comp)); @@ -752,7 +750,7 @@ int cmCPackGenerator::InstallCMakeProject( // CPACK_PACKAGING_INSTALL_PREFIX // I know this is tricky and awkward but it's the price for // CPACK_SET_DESTDIR backward compatibility. - if (cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) { + if (cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) { this->SetOption("CPACK_INSTALL_PREFIX", this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")); } @@ -828,7 +826,7 @@ int cmCPackGenerator::InstallCMakeProject( // strip on TRUE, ON, 1, one or several file names, but not on // FALSE, OFF, 0 and an empty string - if (!cmSystemTools::IsOff(this->GetOption("CPACK_STRIP_FILES"))) { + if (!cmIsOff(this->GetOption("CPACK_STRIP_FILES"))) { mf.AddDefinition("CMAKE_INSTALL_DO_STRIP", "1"); } // Remember the list of files before installation @@ -979,8 +977,7 @@ int cmCPackGenerator::DoPackage() return 0; } - if (cmSystemTools::IsOn( - this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) { + if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) { const char* toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); if (cmSystemTools::FileExists(toplevelDirectory)) { @@ -1030,8 +1027,7 @@ int cmCPackGenerator::DoPackage() "Remove old package file" << std::endl); cmSystemTools::RemoveFile(tempPackageFileName); } - if (cmSystemTools::IsOn( - this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) { + if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) { tempDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); } @@ -1155,14 +1151,14 @@ bool cmCPackGenerator::IsSet(const std::string& name) const bool cmCPackGenerator::IsOn(const std::string& name) const { - return cmSystemTools::IsOn(GetOption(name)); + return cmIsOn(GetOption(name)); } bool cmCPackGenerator::IsSetToOff(const std::string& op) const { const char* ret = this->MakefileMap->GetDefinition(op); if (ret && *ret) { - return cmSystemTools::IsOff(ret); + return cmIsOff(ret); } return false; } @@ -1476,7 +1472,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( component->IsRequired = this->IsOn(macroPrefix + "_REQUIRED"); component->IsDisabledByDefault = this->IsOn(macroPrefix + "_DISABLED"); component->IsDownloaded = this->IsOn(macroPrefix + "_DOWNLOADED") || - cmSystemTools::IsOn(this->GetOption("CPACK_DOWNLOAD_ALL")); + cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL")); const char* archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE"); if (archiveFile && *archiveFile) { @@ -1505,7 +1501,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( const char* installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES"); if (installTypes && *installTypes) { std::vector<std::string> installTypesVector; - cmSystemTools::ExpandListArgument(installTypes, installTypesVector); + cmExpandList(installTypes, installTypesVector); for (std::string const& installType : installTypesVector) { component->InstallationTypes.push_back( this->GetInstallationType(projectName, installType)); @@ -1516,7 +1512,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( const char* depends = this->GetOption(macroPrefix + "_DEPENDS"); if (depends && *depends) { std::vector<std::string> dependsVector; - cmSystemTools::ExpandListArgument(depends, dependsVector); + cmExpandList(depends, dependsVector); for (std::string const& depend : dependsVector) { cmCPackComponent* child = GetComponent(projectName, depend); component->Dependencies.push_back(child); diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 87c36fa..7ca343a 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -2,11 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackNSISGenerator.h" +#include "cmAlgorithms.h" #include "cmCPackComponentGroup.h" #include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmDuration.h" #include "cmGeneratedFileStream.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmsys/Directory.hxx" @@ -274,7 +276,7 @@ int cmCPackNSISGenerator::PackageFiles() if (anyDownloadedComponents) { defines += "!define CPACK_USES_DOWNLOAD\n"; - if (cmSystemTools::IsOn(this->GetOption("CPACK_ADD_REMOVE"))) { + if (cmIsOn(this->GetOption("CPACK_ADD_REMOVE"))) { defines += "!define CPACK_NSIS_ADD_REMOVE\n"; } } @@ -321,8 +323,7 @@ int cmCPackNSISGenerator::PackageFiles() int cmCPackNSISGenerator::InitializeInternal() { - if (cmSystemTools::IsOn( - this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) { + if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) { cmCPackLogger( cmCPackLog::LOG_WARNING, "NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. " @@ -459,8 +460,7 @@ int cmCPackNSISGenerator::InitializeInternal() "CPACK_CREATE_DESKTOP_LINKS: " << cpackPackageDeskTopLinks << std::endl); - cmSystemTools::ExpandListArgument(cpackPackageDeskTopLinks, - cpackPackageDesktopLinksVector); + cmExpandList(cpackPackageDeskTopLinks, cpackPackageDesktopLinksVector); for (std::string const& cpdl : cpackPackageDesktopLinksVector) { cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: " << cpdl << std::endl); @@ -479,8 +479,7 @@ int cmCPackNSISGenerator::InitializeInternal() "The cpackPackageExecutables: " << cpackPackageExecutables << "." << std::endl); std::vector<std::string> cpackPackageExecutablesVector; - cmSystemTools::ExpandListArgument(cpackPackageExecutables, - cpackPackageExecutablesVector); + cmExpandList(cpackPackageExecutables, cpackPackageExecutablesVector); if (cpackPackageExecutablesVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, @@ -502,10 +501,7 @@ int cmCPackNSISGenerator::InitializeInternal() << ".lnk\"" << std::endl; // see if CPACK_CREATE_DESKTOP_LINK_ExeName is on // if so add a desktop link - if (!cpackPackageDesktopLinksVector.empty() && - std::find(cpackPackageDesktopLinksVector.begin(), - cpackPackageDesktopLinksVector.end(), - execName) != cpackPackageDesktopLinksVector.end()) { + if (cmContains(cpackPackageDesktopLinksVector, execName)) { str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n"; str << " CreateShortCut \"$DESKTOP\\" << linkName << R"(.lnk" "$INSTDIR\)" << cpackNsisExecutablesDirectory << "\\" @@ -536,7 +532,7 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str, cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackMenuLinks: " << cpackMenuLinks << "." << std::endl); std::vector<std::string> cpackMenuLinksVector; - cmSystemTools::ExpandListArgument(cpackMenuLinks, cpackMenuLinksVector); + cmExpandList(cpackMenuLinks, cpackMenuLinksVector); if (cpackMenuLinksVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, @@ -722,8 +718,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( // size of the installed component. std::string zipListFileName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); zipListFileName += "/winZip.filelist"; - bool needQuotesInFile = - cmSystemTools::IsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES")); + bool needQuotesInFile = cmIsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES")); unsigned long totalSize = 0; { // the scope is needed for cmGeneratedFileStream cmGeneratedFileStream out(zipListFileName); diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 41470c9..7cc48f4 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -8,6 +8,7 @@ #include "cmCPackLog.h" #include "cmDuration.h" #include "cmGeneratedFileStream.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cm_sys_stat.h" @@ -29,8 +30,7 @@ int cmCPackOSXX11Generator::PackageFiles() std::ostringstream str; std::ostringstream deleteStr; std::vector<std::string> cpackPackageExecutablesVector; - cmSystemTools::ExpandListArgument(cpackPackageExecutables, - cpackPackageExecutablesVector); + cmExpandList(cpackPackageExecutables, cpackPackageExecutablesVector); if (cpackPackageExecutablesVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 33ab62b..9ffebf5 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -12,6 +12,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackGenerator.h" #include "cmCPackLog.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" cmCPackRPMGenerator::cmCPackRPMGenerator() = default; @@ -21,7 +22,7 @@ cmCPackRPMGenerator::~cmCPackRPMGenerator() = default; int cmCPackRPMGenerator::InitializeInternal() { this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr"); - if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR"))) { + if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) { this->SetOption("CPACK_SET_DESTDIR", "I_ON"); } /* Replace space in CPACK_PACKAGE_NAME in order to avoid diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index ae56adb..3cf0c10 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -25,6 +25,7 @@ #include "cmMakefile.h" #include "cmState.h" #include "cmStateSnapshot.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmake.h" @@ -332,7 +333,7 @@ int main(int argc, char const* const* argv) "CPack generator not specified" << std::endl); } else { std::vector<std::string> generatorsVector; - cmSystemTools::ExpandListArgument(genList, generatorsVector); + cmExpandList(genList, generatorsVector); for (std::string const& gen : generatorsVector) { cmMakefile::ScopePushPop raii(&globalMF); cmMakefile* mf = &globalMF; |