summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-04-25 17:54:23 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-04-29 07:54:31 (GMT)
commit241304190ffdf9cc7d4ede0601da370b111468cc (patch)
treee35dd7fe5c89da1eed3abe10f37abe3586e64df7 /Source/CPack
parent87fe031a0703f07b8636f8ea59b6746788e71869 (diff)
downloadCMake-241304190ffdf9cc7d4ede0601da370b111468cc.zip
CMake-241304190ffdf9cc7d4ede0601da370b111468cc.tar.gz
CMake-241304190ffdf9cc7d4ede0601da370b111468cc.tar.bz2
CMake code rely on cmList class for CMake lists management (part. 2)
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx1
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx8
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx8
-rw-r--r--Source/CPack/WiX/cmWIXAccessControlList.cxx5
-rw-r--r--Source/CPack/WiX/cmWIXShortcut.cxx5
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackGenerator.cxx25
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx14
9 files changed, 36 insertions, 40 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index 69440d9..a77c22f 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -12,6 +12,7 @@
#include "cmCPackIFWRepository.h"
#include "cmCPackLog.h" // IWYU pragma: keep
#include "cmGeneratedFileStream.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index b759eff..083f1ef 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -428,16 +428,16 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
}
// QtIFW dependencies
- std::vector<std::string> deps;
+ cmList deps;
option = prefix + "DEPENDS";
if (cmValue value = this->GetOption(option)) {
- cmExpandList(value, deps);
+ deps.assign(value);
}
option = prefix + "DEPENDENCIES";
if (cmValue value = this->GetOption(option)) {
- cmExpandList(value, deps);
+ deps.append(value);
}
- for (std::string const& d : deps) {
+ for (auto const& d : deps) {
DependenceStruct dep(d);
if (this->Generator->Packages.count(dep.Name)) {
cmCPackIFWPackage& depPkg = this->Generator->Packages[dep.Name];
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 1ce346f..1ea78fd 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -681,10 +681,10 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
featureDefinitions.BeginElement("FeatureRef");
featureDefinitions.AddAttribute("Id", featureId);
- std::vector<std::string> cpackPackageExecutablesList;
+ cmList cpackPackageExecutablesList;
cmValue cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
if (cpackPackageExecutables) {
- cmExpandList(cpackPackageExecutables, cpackPackageExecutablesList);
+ cpackPackageExecutablesList.assign(cpackPackageExecutables);
if (cpackPackageExecutablesList.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
@@ -695,10 +695,10 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
}
}
- std::vector<std::string> cpackPackageDesktopLinksList;
+ cmList cpackPackageDesktopLinksList;
cmValue cpackPackageDesktopLinks = GetOption("CPACK_CREATE_DESKTOP_LINKS");
if (cpackPackageDesktopLinks) {
- cmExpandList(cpackPackageDesktopLinks, cpackPackageDesktopLinksList);
+ cpackPackageDesktopLinksList.assign(cpackPackageDesktopLinks);
}
AddDirectoryAndFileDefinitions(
diff --git a/Source/CPack/WiX/cmWIXAccessControlList.cxx b/Source/CPack/WiX/cmWIXAccessControlList.cxx
index 9685a7f..2261a66 100644
--- a/Source/CPack/WiX/cmWIXAccessControlList.cxx
+++ b/Source/CPack/WiX/cmWIXAccessControlList.cxx
@@ -19,10 +19,9 @@ cmWIXAccessControlList::cmWIXAccessControlList(
bool cmWIXAccessControlList::Apply()
{
- std::vector<std::string> entries;
- this->InstalledFile.GetPropertyAsList("CPACK_WIX_ACL", entries);
+ auto entries = this->InstalledFile.GetPropertyAsList("CPACK_WIX_ACL");
- for (std::string const& entry : entries) {
+ for (auto const& entry : entries) {
this->CreatePermissionElement(entry);
}
diff --git a/Source/CPack/WiX/cmWIXShortcut.cxx b/Source/CPack/WiX/cmWIXShortcut.cxx
index cd1988a..c3eb219 100644
--- a/Source/CPack/WiX/cmWIXShortcut.cxx
+++ b/Source/CPack/WiX/cmWIXShortcut.cxx
@@ -91,10 +91,9 @@ void cmWIXShortcuts::CreateFromProperty(std::string const& propertyName,
std::string const& directoryId,
cmInstalledFile const& installedFile)
{
- std::vector<std::string> list;
- installedFile.GetPropertyAsList(propertyName, list);
+ auto list = installedFile.GetPropertyAsList(propertyName);
- for (std::string const& label : list) {
+ for (auto const& label : list) {
cmWIXShortcut shortcut;
shortcut.label = label;
shortcut.workingDirectoryId = directoryId;
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 2a0409d..768bfbe 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -543,9 +543,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::string sla_xml =
cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/sla.xml");
- std::vector<std::string> languages;
+ cmList languages;
if (!oldStyle) {
- cmExpandList(cpack_dmg_languages, languages);
+ languages.assign(cpack_dmg_languages);
}
std::vector<uint16_t> header_data;
@@ -574,7 +574,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
header_data.push_back(0);
header_data.push_back(languages.size());
- for (size_t i = 0; i < languages.size(); ++i) {
+ for (cmList::size_type i = 0; i < languages.size(); ++i) {
CFStringRef language_cfstring = CFStringCreateWithCString(
nullptr, languages[i].c_str(), kCFStringEncodingUTF8);
CFStringRef iso_language =
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 4c92592..8ba015c 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -15,8 +15,8 @@
#include "cmCPackComponentGroup.h"
#include "cmCPackLog.h"
+#include "cmList.h"
#include "cmMakefile.h"
-#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
@@ -79,7 +79,7 @@ int cmCPackExternalGenerator::PackageFiles()
cmValue builtPackages = this->GetOption("CPACK_EXTERNAL_BUILT_PACKAGES");
if (builtPackages) {
- cmExpandList(builtPackages, this->packageFileNames, false);
+ cmExpandList(builtPackages, this->packageFileNames);
}
}
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 83194a6..afd85cd 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -573,7 +573,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
++it;
project.SubDirectory = *it;
- std::vector<std::string> componentsVector;
+ cmList componentsList;
bool componentInstall = false;
/*
@@ -588,7 +588,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string installTypesVar = "CPACK_" +
cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES";
cmValue installTypes = this->GetOption(installTypesVar);
- if (cmNonempty(installTypes)) {
+ if (!installTypes.IsEmpty()) {
cmList installTypesList{ installTypes };
for (std::string const& installType : installTypesList) {
project.InstallationTypes.push_back(
@@ -600,23 +600,23 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string componentsVar =
"CPACK_COMPONENTS_" + cmSystemTools::UpperCase(project.Component);
cmValue components = this->GetOption(componentsVar);
- if (cmNonempty(components)) {
- cmExpandList(components, componentsVector);
- for (std::string const& comp : componentsVector) {
+ if (!components.IsEmpty()) {
+ componentsList.assign(components);
+ for (auto const& comp : componentsList) {
project.Components.push_back(
this->GetComponent(project.ProjectName, comp));
}
componentInstall = true;
}
}
- if (componentsVector.empty()) {
- componentsVector.push_back(project.Component);
+ if (componentsList.empty()) {
+ componentsList.push_back(project.Component);
}
- std::vector<std::string> buildConfigs;
+ cmList buildConfigs;
// Try get configuration names given via `-C` CLI option
- cmExpandList(this->GetOption("CPACK_BUILD_CONFIG"), buildConfigs);
+ buildConfigs.assign(this->GetOption("CPACK_BUILD_CONFIG"));
// Remove duplicates
std::sort(buildConfigs.begin(), buildConfigs.end());
@@ -655,7 +655,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
<< buildConfig << ']'
<< std::endl);
// Run the installation for each component
- for (std::string const& component : componentsVector) {
+ for (std::string const& component : componentsList) {
if (!this->InstallCMakeProject(
setDestDir, project.Directory, baseTempInstallDirectory,
default_dir_mode, component, componentInstall,
@@ -888,9 +888,8 @@ int cmCPackGenerator::InstallCMakeProject(
mf.AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", "1");
}
- std::vector<std::string> custom_variables;
- this->MakefileMap->GetDefExpandList("CPACK_CUSTOM_INSTALL_VARIABLES",
- custom_variables);
+ cmList custom_variables{ this->MakefileMap->GetDefinition(
+ "CPACK_CUSTOM_INSTALL_VARIABLES") };
for (auto const& custom_variable : custom_variables) {
std::string value;
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 38a9d59..7749b29 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -246,8 +246,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::string nsisPreArguments;
if (cmValue nsisArguments =
this->GetOption("CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS")) {
- std::vector<std::string> expandedArguments;
- cmExpandList(nsisArguments, expandedArguments);
+ cmList expandedArguments{ nsisArguments };
for (auto& arg : expandedArguments) {
if (!cmHasPrefix(arg, NSIS_OPT)) {
@@ -260,8 +259,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::string nsisPostArguments;
if (cmValue nsisArguments =
this->GetOption("CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS")) {
- std::vector<std::string> expandedArguments;
- cmExpandList(nsisArguments, expandedArguments);
+ cmList expandedArguments{ nsisArguments };
for (auto& arg : expandedArguments) {
if (!cmHasPrefix(arg, NSIS_OPT)) {
nsisPostArguments = cmStrCat(nsisPostArguments, NSIS_OPT);
@@ -546,14 +544,14 @@ int cmCPackNSISGenerator::InitializeInternal()
this->GetOption("CPACK_CREATE_DESKTOP_LINKS");
cmValue cpackNsisExecutablesDirectory =
this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY");
- std::vector<std::string> cpackPackageDesktopLinksVector;
+ cmList cpackPackageDesktopLinksList;
if (cpackPackageDeskTopLinks) {
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"CPACK_CREATE_DESKTOP_LINKS: " << cpackPackageDeskTopLinks
<< std::endl);
- cmExpandList(cpackPackageDeskTopLinks, cpackPackageDesktopLinksVector);
- for (std::string const& cpdl : cpackPackageDesktopLinksVector) {
+ cpackPackageDesktopLinksList.assign(cpackPackageDeskTopLinks);
+ for (std::string const& cpdl : cpackPackageDesktopLinksList) {
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"CPACK_CREATE_DESKTOP_LINKS: " << cpdl << std::endl);
}
@@ -592,7 +590,7 @@ int cmCPackNSISGenerator::InitializeInternal()
<< ".lnk\"" << std::endl;
// see if CPACK_CREATE_DESKTOP_LINK_ExeName is on
// if so add a desktop link
- if (cm::contains(cpackPackageDesktopLinksVector, execName)) {
+ if (cm::contains(cpackPackageDesktopLinksList, execName)) {
str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
str << " CreateShortCut \"$DESKTOP\\" << linkName
<< R"(.lnk" "$INSTDIR\)" << cpackNsisExecutablesDirectory << "\\"