Skip to content

Commit 2beed5a

Browse files
KyleFromKitwarekwrobot
authored andcommitted
Merge topic 'cmExpandList'
2f6495e cmSystemTools: Remove ExpandListArgument methods f4f3c68 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument ff42dec cmStringAlgorithms: Add cmExpandList functions Acked-by: Kitware Robot <[email protected]> Merge-request: !3682
2 parents dcf2beb + 2f6495e commit 2beed5a

File tree

93 files changed

+492
-508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+492
-508
lines changed

Source/CPack/IFW/cmCPackIFWCommon.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "cmCPackGenerator.h"
66
#include "cmCPackIFWGenerator.h"
77
#include "cmCPackLog.h" // IWYU pragma: keep
8+
#include "cmStringAlgorithms.h"
89
#include "cmSystemTools.h"
910
#include "cmTimestamp.h"
1011
#include "cmVersionConfig.h"
@@ -78,7 +79,7 @@ void cmCPackIFWCommon::ExpandListArgument(
7879
const std::string& arg, std::map<std::string, std::string>& argsOut)
7980
{
8081
std::vector<std::string> args;
81-
cmSystemTools::ExpandListArgument(arg, args, false);
82+
cmExpandList(arg, args, false);
8283
if (args.empty()) {
8384
return;
8485
}
@@ -100,7 +101,7 @@ void cmCPackIFWCommon::ExpandListArgument(
100101
const std::string& arg, std::multimap<std::string, std::string>& argsOut)
101102
{
102103
std::vector<std::string> args;
103-
cmSystemTools::ExpandListArgument(arg, args, false);
104+
cmExpandList(arg, args, false);
104105
if (args.empty()) {
105106
return;
106107
}

Source/CPack/IFW/cmCPackIFWGenerator.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "cmCPackLog.h" // IWYU pragma: keep
1212
#include "cmDuration.h"
1313
#include "cmGeneratedFileStream.h"
14+
#include "cmStringAlgorithms.h"
1415
#include "cmSystemTools.h"
1516

1617
#include <sstream>
@@ -292,14 +293,14 @@ int cmCPackIFWGenerator::InitializeInternal()
292293
// Additional packages dirs
293294
this->PkgsDirsVector.clear();
294295
if (const char* dirs = this->GetOption("CPACK_IFW_PACKAGES_DIRECTORIES")) {
295-
cmSystemTools::ExpandListArgument(dirs, this->PkgsDirsVector);
296+
cmExpandList(dirs, this->PkgsDirsVector);
296297
}
297298

298299
// Additional repositories dirs
299300
this->RepoDirsVector.clear();
300301
if (const char* dirs =
301302
this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) {
302-
cmSystemTools::ExpandListArgument(dirs, this->RepoDirsVector);
303+
cmExpandList(dirs, this->RepoDirsVector);
303304
}
304305

305306
// Installer
@@ -317,7 +318,7 @@ int cmCPackIFWGenerator::InitializeInternal()
317318
// Repositories
318319
if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) {
319320
std::vector<std::string> RepoAllVector;
320-
cmSystemTools::ExpandListArgument(RepoAllStr, RepoAllVector);
321+
cmExpandList(RepoAllStr, RepoAllVector);
321322
for (std::string const& r : RepoAllVector) {
322323
this->GetRepository(r);
323324
}

Source/CPack/IFW/cmCPackIFWInstaller.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
245245
if (const char* optIFW_PACKAGE_RESOURCES =
246246
this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) {
247247
this->Resources.clear();
248-
cmSystemTools::ExpandListArgument(optIFW_PACKAGE_RESOURCES,
249-
this->Resources);
248+
cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
250249
}
251250
}
252251

Source/CPack/IFW/cmCPackIFWPackage.cxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "cmCPackIFWInstaller.h"
99
#include "cmCPackLog.h" // IWYU pragma: keep
1010
#include "cmGeneratedFileStream.h"
11+
#include "cmStringAlgorithms.h"
1112
#include "cmSystemTools.h"
1213
#include "cmTimestamp.h"
1314
#include "cmXMLWriter.h"
@@ -196,7 +197,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
196197
// User interfaces
197198
if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) {
198199
this->UserInterfaces.clear();
199-
cmSystemTools::ExpandListArgument(option, this->UserInterfaces);
200+
cmExpandList(option, this->UserInterfaces);
200201
}
201202

202203
// CMake dependencies
@@ -209,7 +210,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
209210
// Licenses
210211
if (const char* option = this->GetOption(prefix + "LICENSES")) {
211212
this->Licenses.clear();
212-
cmSystemTools::ExpandListArgument(option, this->Licenses);
213+
cmExpandList(option, this->Licenses);
213214
if (this->Licenses.size() % 2 != 0) {
214215
cmCPackIFWLogger(
215216
WARNING,
@@ -281,13 +282,13 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
281282
// User interfaces
282283
if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) {
283284
this->UserInterfaces.clear();
284-
cmSystemTools::ExpandListArgument(option, this->UserInterfaces);
285+
cmExpandList(option, this->UserInterfaces);
285286
}
286287

287288
// Licenses
288289
if (const char* option = this->GetOption(prefix + "LICENSES")) {
289290
this->Licenses.clear();
290-
cmSystemTools::ExpandListArgument(option, this->Licenses);
291+
cmExpandList(option, this->Licenses);
291292
if (this->Licenses.size() % 2 != 0) {
292293
cmCPackIFWLogger(
293294
WARNING,
@@ -398,18 +399,18 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
398399
this->Translations.clear();
399400
} else if (const char* value = this->GetOption(option)) {
400401
this->Translations.clear();
401-
cmSystemTools::ExpandListArgument(value, this->Translations);
402+
cmExpandList(value, this->Translations);
402403
}
403404

404405
// QtIFW dependencies
405406
std::vector<std::string> deps;
406407
option = prefix + "DEPENDS";
407408
if (const char* value = this->GetOption(option)) {
408-
cmSystemTools::ExpandListArgument(value, deps);
409+
cmExpandList(value, deps);
409410
}
410411
option = prefix + "DEPENDENCIES";
411412
if (const char* value = this->GetOption(option)) {
412-
cmSystemTools::ExpandListArgument(value, deps);
413+
cmExpandList(value, deps);
413414
}
414415
for (std::string const& d : deps) {
415416
DependenceStruct dep(d);
@@ -431,7 +432,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
431432
this->AlienAutoDependOn.clear();
432433
} else if (const char* value = this->GetOption(option)) {
433434
std::vector<std::string> depsOn;
434-
cmSystemTools::ExpandListArgument(value, depsOn);
435+
cmExpandList(value, depsOn);
435436
for (std::string const& d : depsOn) {
436437
DependenceStruct dep(d);
437438
if (this->Generator->Packages.count(dep.Name)) {
@@ -488,7 +489,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
488489
this->Replaces.clear();
489490
} else if (const char* value = this->GetOption(option)) {
490491
this->Replaces.clear();
491-
cmSystemTools::ExpandListArgument(value, this->Replaces);
492+
cmExpandList(value, this->Replaces);
492493
}
493494

494495
// Requires admin rights

Source/CPack/WiX/cmCPackWIXGenerator.cxx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "cmCryptoHash.h"
88
#include "cmGeneratedFileStream.h"
99
#include "cmInstalledFile.h"
10+
#include "cmStringAlgorithms.h"
1011
#include "cmSystemTools.h"
1112
#include "cmUuid.h"
1213
#include <algorithm>
@@ -226,7 +227,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
226227
const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
227228
if (patchFilePath) {
228229
std::vector<std::string> patchFilePaths;
229-
cmSystemTools::ExpandListArgument(patchFilePath, patchFilePaths);
230+
cmExpandList(patchFilePath, patchFilePaths);
230231

231232
for (std::string const& p : patchFilePaths) {
232233
if (!this->Patch->LoadFragments(p)) {
@@ -300,7 +301,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
300301
if (!cpackWixExtraSources)
301302
return;
302303

303-
cmSystemTools::ExpandListArgument(cpackWixExtraSources, this->WixSources);
304+
cmExpandList(cpackWixExtraSources, this->WixSources);
304305
}
305306

306307
void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
@@ -311,8 +312,7 @@ void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
311312

312313
std::vector<std::string> expandedExtraObjects;
313314

314-
cmSystemTools::ExpandListArgument(cpackWixExtraObjects,
315-
expandedExtraObjects);
315+
cmExpandList(cpackWixExtraObjects, expandedExtraObjects);
316316

317317
for (std::string const& obj : expandedExtraObjects) {
318318
stream << " " << QuotePath(obj);
@@ -664,8 +664,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
664664
std::vector<std::string> cpackPackageExecutablesList;
665665
const char* cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
666666
if (cpackPackageExecutables) {
667-
cmSystemTools::ExpandListArgument(cpackPackageExecutables,
668-
cpackPackageExecutablesList);
667+
cmExpandList(cpackPackageExecutables, cpackPackageExecutablesList);
669668
if (cpackPackageExecutablesList.size() % 2 != 0) {
670669
cmCPackLogger(
671670
cmCPackLog::LOG_ERROR,
@@ -680,8 +679,7 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
680679
const char* cpackPackageDesktopLinks =
681680
GetOption("CPACK_CREATE_DESKTOP_LINKS");
682681
if (cpackPackageDesktopLinks) {
683-
cmSystemTools::ExpandListArgument(cpackPackageDesktopLinks,
684-
cpackPackageDesktopLinksList);
682+
cmExpandList(cpackPackageDesktopLinks, cpackPackageDesktopLinksList);
685683
}
686684

687685
AddDirectoryAndFileDefinitions(
@@ -1137,7 +1135,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
11371135
return;
11381136

11391137
std::vector<std::string> list;
1140-
cmSystemTools::ExpandListArgument(variableContent, list);
1138+
cmExpandList(variableContent, list);
11411139
extensions.insert(list.begin(), list.end());
11421140
}
11431141

@@ -1149,7 +1147,7 @@ void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName,
11491147
return;
11501148

11511149
std::vector<std::string> list;
1152-
cmSystemTools::ExpandListArgument(variableContent, list);
1150+
cmExpandList(variableContent, list);
11531151

11541152
for (std::string const& i : list) {
11551153
stream << " " << QuotePath(i);

Source/CPack/cmCPackBundleGenerator.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <vector>
77

88
#include "cmCPackLog.h"
9+
#include "cmStringAlgorithms.h"
910
#include "cmSystemTools.h"
1011

1112
cmCPackBundleGenerator::cmCPackBundleGenerator() = default;
@@ -206,7 +207,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
206207
: "";
207208

208209
std::vector<std::string> relFiles;
209-
cmSystemTools::ExpandListArgument(sign_files, relFiles);
210+
cmExpandList(sign_files, relFiles);
210211

211212
// sign the files supplied by the user, ie. frameworks.
212213
for (auto const& file : relFiles) {

Source/CPack/cmCPackDebGenerator.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "cmCPackLog.h"
99
#include "cmCryptoHash.h"
1010
#include "cmGeneratedFileStream.h"
11+
#include "cmStringAlgorithms.h"
1112
#include "cmSystemTools.h"
1213
#include "cm_sys_stat.h"
1314

@@ -378,7 +379,7 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
378379
control_tar.ClearPermissions();
379380

380381
std::vector<std::string> controlExtraList;
381-
cmSystemTools::ExpandListArgument(ControlExtra, controlExtraList);
382+
cmExpandList(ControlExtra, controlExtraList);
382383
for (std::string const& i : controlExtraList) {
383384
std::string filenamename = cmsys::SystemTools::GetFilenameName(i);
384385
std::string localcopy = WorkDir + "/" + filenamename;

Source/CPack/cmCPackDragNDropGenerator.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "cmCPackLog.h"
77
#include "cmDuration.h"
88
#include "cmGeneratedFileStream.h"
9+
#include "cmStringAlgorithms.h"
910
#include "cmSystemTools.h"
1011

1112
#include "cmsys/FStream.hxx"
@@ -128,8 +129,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
128129
}
129130

130131
std::vector<std::string> languages;
131-
cmSystemTools::ExpandListArgument(
132-
this->GetOption("CPACK_DMG_SLA_LANGUAGES"), languages);
132+
cmExpandList(this->GetOption("CPACK_DMG_SLA_LANGUAGES"), languages);
133133
if (languages.empty()) {
134134
cmCPackLogger(cmCPackLog::LOG_ERROR,
135135
"CPACK_DMG_SLA_LANGUAGES set but empty" << std::endl);
@@ -527,7 +527,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
527527

528528
std::vector<std::string> languages;
529529
if (!oldStyle) {
530-
cmSystemTools::ExpandListArgument(cpack_dmg_languages, languages);
530+
cmExpandList(cpack_dmg_languages, languages);
531531
}
532532

533533
cmGeneratedFileStream ofs(sla_r);

Source/CPack/cmCPackFreeBSDGenerator.cxx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "cmCPackArchiveGenerator.h"
77
#include "cmCPackLog.h"
88
#include "cmGeneratedFileStream.h"
9+
#include "cmStringAlgorithms.h"
910
#include "cmSystemTools.h"
1011

1112
// Needed for ::open() and ::stat()
@@ -228,8 +229,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
228229
"desc", var_lookup("CPACK_FREEBSD_PACKAGE_DESCRIPTION"));
229230
manifest << ManifestKeyValue("www", var_lookup("CPACK_FREEBSD_PACKAGE_WWW"));
230231
std::vector<std::string> licenses;
231-
cmSystemTools::ExpandListArgument(
232-
var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses);
232+
cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses);
233233
std::string licenselogic("single");
234234
if (licenses.empty()) {
235235
cmSystemTools::SetFatalErrorOccured();
@@ -239,13 +239,11 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
239239
manifest << ManifestKeyValue("licenselogic", licenselogic);
240240
manifest << (ManifestKeyListValue("licenses") << licenses);
241241
std::vector<std::string> categories;
242-
cmSystemTools::ExpandListArgument(
243-
var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"), categories);
242+
cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_CATEGORIES"), categories);
244243
manifest << (ManifestKeyListValue("categories") << categories);
245244
manifest << ManifestKeyValue("prefix", var_lookup("CMAKE_INSTALL_PREFIX"));
246245
std::vector<std::string> deps;
247-
cmSystemTools::ExpandListArgument(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"),
248-
deps);
246+
cmExpandList(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"), deps);
249247
if (!deps.empty()) {
250248
manifest << (ManifestKeyDepsValue("deps") << deps);
251249
}

0 commit comments

Comments
 (0)