summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-04-14 14:48:16 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-04-24 08:41:10 (GMT)
commite08ba229ee3107bcb814ca45bc9c72a48abf1ba2 (patch)
treec34d2ca05820acbb31202c5bdbc102059441076b /Source/CPack
parent51b0d45d9120d4bca5c7285d5e6b2f80db5a8310 (diff)
downloadCMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.zip
CMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.tar.gz
CMake-e08ba229ee3107bcb814ca45bc9c72a48abf1ba2.tar.bz2
CMake code rely on cmList class for CMake lists management (part. 1)
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/IFW/cmCPackIFWCommon.cxx15
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx5
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx3
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx12
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.cxx27
-rw-r--r--Source/CPack/cmCPackGenerator.cxx55
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx22
-rw-r--r--Source/CPack/cpack.cxx5
11 files changed, 73 insertions, 82 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx
index 5d995c3..4ff3a10 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.cxx
+++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx
@@ -5,12 +5,11 @@
#include <cstddef> // IWYU pragma: keep
#include <sstream>
#include <utility>
-#include <vector>
#include "cmCPackGenerator.h"
#include "cmCPackIFWGenerator.h"
#include "cmCPackLog.h" // IWYU pragma: keep
-#include "cmStringAlgorithms.h"
+#include "cmList.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
#include "cmVersionConfig.h"
@@ -76,12 +75,12 @@ bool cmCPackIFWCommon::IsVersionEqual(const char* version) const
void cmCPackIFWCommon::ExpandListArgument(
const std::string& arg, std::map<std::string, std::string>& argsOut)
{
- std::vector<std::string> args = cmExpandedList(arg, false);
+ cmList args{ arg };
if (args.empty()) {
return;
}
- std::size_t i = 0;
+ cmList::index_type i = 0;
std::size_t c = args.size();
if (c % 2) {
argsOut[""] = args[i];
@@ -89,7 +88,7 @@ void cmCPackIFWCommon::ExpandListArgument(
}
--c;
- for (; i < c; i += 2) {
+ for (; i < static_cast<cmList::index_type>(c); i += 2) {
argsOut[args[i]] = args[i + 1];
}
}
@@ -97,12 +96,12 @@ void cmCPackIFWCommon::ExpandListArgument(
void cmCPackIFWCommon::ExpandListArgument(
const std::string& arg, std::multimap<std::string, std::string>& argsOut)
{
- std::vector<std::string> args = cmExpandedList(arg, false);
+ cmList args{ arg };
if (args.empty()) {
return;
}
- std::size_t i = 0;
+ cmList::index_type i = 0;
std::size_t c = args.size();
if (c % 2) {
argsOut.insert(std::pair<std::string, std::string>("", args[i]));
@@ -110,7 +109,7 @@ void cmCPackIFWCommon::ExpandListArgument(
}
--c;
- for (; i < c; i += 2) {
+ for (; i < static_cast<cmList::index_type>(c); i += 2) {
argsOut.insert(std::pair<std::string, std::string>(args[i], args[i + 1]));
}
}
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index bc14eb4..5724175 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -14,6 +14,7 @@
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
@@ -409,8 +410,8 @@ int cmCPackIFWGenerator::InitializeInternal()
// Repositories
if (cmValue RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) {
- std::vector<std::string> RepoAllVector = cmExpandedList(RepoAllStr);
- for (std::string const& r : RepoAllVector) {
+ cmList RepoAllList{ RepoAllStr };
+ for (std::string const& r : RepoAllList) {
this->GetRepository(r);
}
}
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index 1668fb5..b759eff 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -15,6 +15,7 @@
#include "cmCPackIFWInstaller.h"
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
@@ -455,7 +456,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
if (this->IsSetToEmpty(option)) {
this->AlienAutoDependOn.clear();
} else if (cmValue value = this->GetOption(option)) {
- std::vector<std::string> depsOn = cmExpandedList(value);
+ cmList depsOn{ value };
for (std::string const& d : depsOn) {
DependenceStruct dep(d);
if (this->Generator->Packages.count(dep.Name)) {
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index aeb3db3..1ce346f 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -18,6 +18,7 @@
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
#include "cmInstalledFile.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmUuid.h"
@@ -239,7 +240,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
cmValue patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
if (patchFilePath) {
- std::vector<std::string> patchFilePaths = cmExpandedList(patchFilePath);
+ cmList patchFilePaths{ patchFilePath };
for (std::string const& p : patchFilePaths) {
if (!this->Patch->LoadFragments(p)) {
@@ -322,8 +323,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
if (!cpackWixExtraObjects)
return;
- std::vector<std::string> expandedExtraObjects =
- cmExpandedList(cpackWixExtraObjects);
+ cmList expandedExtraObjects{ cpackWixExtraObjects };
for (std::string const& obj : expandedExtraObjects) {
stream << " " << QuotePath(obj);
@@ -1160,7 +1160,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
if (!variableContent)
return;
- std::vector<std::string> list = cmExpandedList(variableContent);
+ cmList list{ variableContent };
extensions.insert(list.begin(), list.end());
}
@@ -1172,7 +1172,7 @@ void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
return;
}
- std::vector<std::string> list = cmExpandedList(variableContent);
+ cmList list{ variableContent };
for (std::string const& str : list) {
auto pos = str.find('=');
if (pos != std::string::npos) {
@@ -1200,7 +1200,7 @@ void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName,
if (!variableContent)
return;
- std::vector<std::string> list = cmExpandedList(variableContent);
+ cmList list{ variableContent };
for (std::string const& i : list) {
stream << " " << QuotePath(i);
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index b3d425a..7e6e473 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -6,6 +6,7 @@
#include <vector>
#include "cmCPackLog.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
@@ -191,7 +192,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
cmValue sign_files = this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_FILES");
- std::vector<std::string> relFiles = cmExpandedList(sign_files);
+ cmList relFiles{ sign_files };
// 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 6ba28d1..34c56c9 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -20,6 +20,7 @@
#include "cmCPackLog.h"
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
@@ -427,8 +428,7 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
// default
control_tar.ClearPermissions();
- std::vector<std::string> controlExtraList =
- cmExpandedList(this->ControlExtra);
+ cmList controlExtraList{ this->ControlExtra };
for (std::string const& i : controlExtraList) {
std::string filenamename = cmsys::SystemTools::GetFilenameName(i);
std::string localcopy = this->WorkDir + "/" + filenamename;
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 68e7ba3..2a0409d 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -19,6 +19,7 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
@@ -128,8 +129,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
return 0;
}
- std::vector<std::string> languages =
- cmExpandedList(this->GetOption("CPACK_DMG_SLA_LANGUAGES"));
+ cmList languages{ this->GetOption("CPACK_DMG_SLA_LANGUAGES") };
if (languages.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_DMG_SLA_LANGUAGES set but empty" << std::endl);
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx
index ea7b24b..0840e33 100644
--- a/Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -2,15 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackFreeBSDGenerator.h"
-#include "cmArchiveWrite.h"
-#include "cmCPackArchiveGenerator.h"
-#include "cmCPackLog.h"
-#include "cmGeneratedFileStream.h"
-#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
-#include "cmWorkingDirectory.h"
-
-// Needed for ::open() and ::stat()
#include <algorithm>
#include <ostream>
#include <utility>
@@ -21,6 +12,15 @@
#include <sys/stat.h>
+#include "cmArchiveWrite.h"
+#include "cmCPackArchiveGenerator.h"
+#include "cmCPackLog.h"
+#include "cmGeneratedFileStream.h"
+#include "cmList.h"
+#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
+#include "cmWorkingDirectory.h"
+
// Suffix used to tell libpkg what compression to use
static const char FreeBSDPackageCompression[] = "txz";
static const char FreeBSDPackageSuffix_17[] = ".pkg";
@@ -292,8 +292,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
manifest << ManifestKeyValue(
"desc", var_lookup("CPACK_FREEBSD_PACKAGE_DESCRIPTION"));
manifest << ManifestKeyValue("www", var_lookup("CPACK_FREEBSD_PACKAGE_WWW"));
- std::vector<std::string> licenses =
- cmExpandedList(var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"));
+ cmList licenses{ var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE") };
std::string licenselogic("single");
if (licenses.empty()) {
cmSystemTools::SetFatalErrorOccurred();
@@ -302,12 +301,10 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
}
manifest << ManifestKeyValue("licenselogic", licenselogic);
manifest << (ManifestKeyListValue("licenses") << licenses);
- std::vector<std::string> categories =
- cmExpandedList(var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"));
+ cmList categories{ var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES") };
manifest << (ManifestKeyListValue("categories") << categories);
manifest << ManifestKeyValue("prefix", var_lookup("CMAKE_INSTALL_PREFIX"));
- std::vector<std::string> deps =
- cmExpandedList(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"));
+ cmList deps{ var_lookup("CPACK_FREEBSD_PACKAGE_DEPS") };
if (!deps.empty()) {
manifest << (ManifestKeyDepsValue("deps") << deps);
}
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 2ac5b3d..83194a6 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -19,6 +19,7 @@
#include "cmFileTimes.h"
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
+#include "cmList.h"
#include "cmMakefile.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
@@ -216,8 +217,7 @@ int cmCPackGenerator::InstallProject()
cmValue default_dir_install_permissions =
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
if (cmNonempty(default_dir_install_permissions)) {
- std::vector<std::string> items =
- cmExpandedList(default_dir_install_permissions);
+ cmList items{ default_dir_install_permissions };
for (const auto& arg : items) {
if (!cmFSPermissions::stringToModeT(arg, default_dir_mode_v)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -266,7 +266,7 @@ int cmCPackGenerator::InstallProject()
// Run pre-build actions
cmValue preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS");
if (preBuildScripts) {
- const auto scripts = cmExpandedList(preBuildScripts, false);
+ const cmList scripts{ preBuildScripts };
for (const auto& script : scripts) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"Executing pre-build script: " << script << std::endl);
@@ -296,8 +296,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
std::string tempInstallDirectoryEnv =
cmStrCat("CMAKE_INSTALL_PREFIX=", tempInstallDirectory);
cmSystemTools::PutEnv(tempInstallDirectoryEnv);
- std::vector<std::string> installCommandsVector =
- cmExpandedList(installCommands);
+ cmList installCommandsVector{ installCommands };
for (std::string const& ic : installCommandsVector) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << ic << std::endl);
std::string output;
@@ -333,8 +332,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
std::vector<cmsys::RegularExpression> ignoreFilesRegex;
cmValue cpackIgnoreFiles = this->GetOption("CPACK_IGNORE_FILES");
if (cpackIgnoreFiles) {
- std::vector<std::string> ignoreFilesRegexString =
- cmExpandedList(cpackIgnoreFiles);
+ cmList ignoreFilesRegexString{ cpackIgnoreFiles };
for (std::string const& ifr : ignoreFilesRegexString) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Create ignore files regex for: " << ifr << std::endl);
@@ -343,9 +341,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
}
cmValue installDirectories = this->GetOption("CPACK_INSTALLED_DIRECTORIES");
if (cmNonempty(installDirectories)) {
- std::vector<std::string> installDirectoriesVector =
- cmExpandedList(installDirectories);
- if (installDirectoriesVector.size() % 2 != 0) {
+ cmList installDirectoriesList{ installDirectories };
+ if (installDirectoriesList.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"CPACK_INSTALLED_DIRECTORIES should contain pairs of <directory> "
@@ -355,10 +352,10 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
<< std::endl);
return 0;
}
- std::vector<std::string>::iterator it;
+ cmList::iterator it;
const std::string& tempDir = tempInstallDirectory;
- for (it = installDirectoriesVector.begin();
- it != installDirectoriesVector.end(); ++it) {
+ for (it = installDirectoriesList.begin();
+ it != installDirectoriesList.end(); ++it) {
std::vector<std::pair<std::string, std::string>> symlinkedFiles;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl);
cmsys::Glob gl;
@@ -485,7 +482,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
if (cmakeScripts && !cmakeScripts->empty()) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install scripts: " << cmakeScripts << std::endl);
- std::vector<std::string> cmakeScriptsVector = cmExpandedList(cmakeScripts);
+ cmList cmakeScriptsVector{ cmakeScripts };
for (std::string const& installScript : cmakeScriptsVector) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
@@ -549,14 +546,12 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
<< std::endl);
return 0;
}
- std::vector<std::string> cmakeProjectsVector =
- cmExpandedList(cmakeProjects);
- std::vector<std::string>::iterator it;
- for (it = cmakeProjectsVector.begin(); it != cmakeProjectsVector.end();
- ++it) {
- if (it + 1 == cmakeProjectsVector.end() ||
- it + 2 == cmakeProjectsVector.end() ||
- it + 3 == cmakeProjectsVector.end()) {
+ cmList cmakeProjectsList{ cmakeProjects };
+ cmList::iterator it;
+ for (it = cmakeProjectsList.begin(); it != cmakeProjectsList.end(); ++it) {
+ if (it + 1 == cmakeProjectsList.end() ||
+ it + 2 == cmakeProjectsList.end() ||
+ it + 3 == cmakeProjectsList.end()) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"Not enough items on list: CPACK_INSTALL_CMAKE_PROJECTS. "
@@ -594,9 +589,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES";
cmValue installTypes = this->GetOption(installTypesVar);
if (cmNonempty(installTypes)) {
- std::vector<std::string> installTypesVector =
- cmExpandedList(installTypes);
- for (std::string const& installType : installTypesVector) {
+ cmList installTypesList{ installTypes };
+ for (std::string const& installType : installTypesList) {
project.InstallationTypes.push_back(
this->GetInstallationType(project.ProjectName, installType));
}
@@ -1129,7 +1123,7 @@ int cmCPackGenerator::DoPackage()
this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES",
cmJoin(this->packageFileNames, ";"));
- const auto scripts = cmExpandedList(postBuildScripts, false);
+ const cmList scripts{ postBuildScripts };
for (const auto& script : scripts) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"Executing post-build script: " << script << std::endl);
@@ -1595,9 +1589,8 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
// Determine the installation types.
cmValue installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES");
if (cmNonempty(installTypes)) {
- std::vector<std::string> installTypesVector =
- cmExpandedList(installTypes);
- for (std::string const& installType : installTypesVector) {
+ cmList installTypesList{ installTypes };
+ for (auto const& installType : installTypesList) {
component->InstallationTypes.push_back(
this->GetInstallationType(projectName, installType));
}
@@ -1606,8 +1599,8 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
// Determine the component dependencies.
cmValue depends = this->GetOption(macroPrefix + "_DEPENDS");
if (cmNonempty(depends)) {
- std::vector<std::string> dependsVector = cmExpandedList(depends);
- for (std::string const& depend : dependsVector) {
+ cmList dependsList{ depends };
+ for (auto const& depend : dependsList) {
cmCPackComponent* child = this->GetComponent(projectName, depend);
component->Dependencies.push_back(child);
child->ReverseDependencies.push_back(component);
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index d7119c5..38a9d59 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -19,6 +19,7 @@
#include "cmCPackLog.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
@@ -569,9 +570,8 @@ int cmCPackNSISGenerator::InitializeInternal()
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"The cpackPackageExecutables: " << cpackPackageExecutables
<< "." << std::endl);
- std::vector<std::string> cpackPackageExecutablesVector =
- cmExpandedList(cpackPackageExecutables);
- if (cpackPackageExecutablesVector.size() % 2 != 0) {
+ cmList cpackPackageExecutablesList{ cpackPackageExecutables };
+ if (cpackPackageExecutablesList.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"CPACK_PACKAGE_EXECUTABLES should contain pairs of <executable> and "
@@ -579,9 +579,9 @@ int cmCPackNSISGenerator::InitializeInternal()
<< std::endl);
return 0;
}
- std::vector<std::string>::iterator it;
- for (it = cpackPackageExecutablesVector.begin();
- it != cpackPackageExecutablesVector.end(); ++it) {
+ cmList::iterator it;
+ for (it = cpackPackageExecutablesList.begin();
+ it != cpackPackageExecutablesList.end(); ++it) {
std::string execName = *it;
++it;
std::string linkName = *it;
@@ -622,9 +622,8 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
}
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"The cpackMenuLinks: " << cpackMenuLinks << "." << std::endl);
- std::vector<std::string> cpackMenuLinksVector =
- cmExpandedList(cpackMenuLinks);
- if (cpackMenuLinksVector.size() % 2 != 0) {
+ cmList cpackMenuLinksList{ cpackMenuLinks };
+ if (cpackMenuLinksList.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"CPACK_NSIS_MENU_LINKS should contain pairs of <shortcut target> and "
@@ -636,9 +635,8 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
static cmsys::RegularExpression urlRegex(
"^(mailto:|(ftps?|https?|news)://).*$");
- std::vector<std::string>::iterator it;
- for (it = cpackMenuLinksVector.begin(); it != cpackMenuLinksVector.end();
- ++it) {
+ cmList::iterator it;
+ for (it = cpackMenuLinksList.begin(); it != cpackMenuLinksList.end(); ++it) {
std::string sourceName = *it;
const bool url = urlRegex.find(sourceName);
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 234bc59..90716e6 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -29,6 +29,7 @@
#include "cmDocumentationEntry.h"
#include "cmGlobalGenerator.h"
#include "cmJSONState.h"
+#include "cmList.h"
#include "cmMakefile.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
@@ -509,8 +510,8 @@ int main(int argc, char const* const* argv)
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"CPack generator not specified\n");
} else {
- std::vector<std::string> generatorsVector = cmExpandedList(*genList);
- for (std::string const& gen : generatorsVector) {
+ cmList generatorsList{ *genList };
+ for (std::string const& gen : generatorsList) {
cmMakefile::ScopePushPop raii(&globalMF);
cmMakefile* mf = &globalMF;
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,