diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-14 14:48:16 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-24 08:41:10 (GMT) |
commit | e08ba229ee3107bcb814ca45bc9c72a48abf1ba2 (patch) | |
tree | c34d2ca05820acbb31202c5bdbc102059441076b /Source/CPack/IFW | |
parent | 51b0d45d9120d4bca5c7285d5e6b2f80db5a8310 (diff) | |
download | CMake-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/IFW')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWCommon.cxx | 15 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.cxx | 3 |
3 files changed, 12 insertions, 11 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)) { |