diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-25 19:54:23 +0200 |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2023-04-29 09:54:31 +0200 |
commit | 241304190ffdf9cc7d4ede0601da370b111468cc (patch) | |
tree | e35dd7fe5c89da1eed3abe10f37abe3586e64df7 /Source/cmFindCommon.cxx | |
parent | 87fe031a0703f07b8636f8ea59b6746788e71869 (diff) | |
download | cmake-241304190ffdf9cc7d4ede0601da370b111468cc.tar.gz |
CMake code rely on cmList class for CMake lists management (part. 2)
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r-- | Source/cmFindCommon.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index c3fb9077da..bec6369211 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -9,6 +9,7 @@ #include <cmext/algorithm> #include "cmExecutionStatus.h" +#include "cmList.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" @@ -238,9 +239,9 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) } // Construct the list of path roots with no trailing slashes. - std::vector<std::string> roots; + cmList roots; if (rootPath) { - cmExpandList(*rootPath, roots); + roots.assign(*rootPath); } if (sysrootCompile) { roots.emplace_back(*sysrootCompile); @@ -251,14 +252,14 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) if (sysroot) { roots.emplace_back(*sysroot); } - for (std::string& r : roots) { + for (auto& r : roots) { cmSystemTools::ConvertToUnixSlashes(r); } cmValue stagePrefix = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX"); // Copy the original set of unrooted paths. - std::vector<std::string> unrootedPaths = paths; + auto unrootedPaths = paths; paths.clear(); auto isSameDirectoryOrSubDirectory = [](std::string const& l, @@ -267,8 +268,8 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) cmSystemTools::IsSubDirectory(l, r); }; - for (std::string const& r : roots) { - for (std::string const& up : unrootedPaths) { + for (auto const& r : roots) { + for (auto const& up : unrootedPaths) { // Place the unrooted path under the current root if it is not // already inside. Skip the unrooted path if it is relative to // a user home directory or is empty. @@ -308,7 +309,7 @@ void cmFindCommon::GetIgnoredPaths(std::vector<std::string>& ignore) // Construct the list of path roots with no trailing slashes. for (const char* pathName : paths) { // Get the list of paths to ignore from the variable. - this->Makefile->GetDefExpandList(pathName, ignore); + cmList::append(ignore, this->Makefile->GetDefinition(pathName)); } for (std::string& i : ignore) { @@ -333,7 +334,7 @@ void cmFindCommon::GetIgnoredPrefixPaths(std::vector<std::string>& ignore) // Construct the list of path roots with no trailing slashes. for (const char* pathName : paths) { // Get the list of paths to ignore from the variable. - this->Makefile->GetDefExpandList(pathName, ignore); + cmList::append(ignore, this->Makefile->GetDefinition(pathName)); } for (std::string& i : ignore) { |