summaryrefslogtreecommitdiff
path: root/Source/cmSearchPath.h
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-02-01 14:42:54 -0500
committerKyle Edwards <kyle.edwards@kitware.com>2022-02-02 11:09:00 -0500
commitbd805a51ae4b5be5be6bbadf4afab108fcf4ddb3 (patch)
tree9f487e27f9af0ef2b9c092919c1165c85bb4bc11 /Source/cmSearchPath.h
parent92459258108c0036808f29f83a8503fea18ccee9 (diff)
downloadcmake-bd805a51ae4b5be5be6bbadf4afab108fcf4ddb3.tar.gz
Refactor: Keep track of prefixes in cmSearchPath
Diffstat (limited to 'Source/cmSearchPath.h')
-rw-r--r--Source/cmSearchPath.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h
index 09f9722886..08f9cfa92d 100644
--- a/Source/cmSearchPath.h
+++ b/Source/cmSearchPath.h
@@ -29,7 +29,18 @@ public:
cmSearchPath(const cmSearchPath&) = default;
cmSearchPath& operator=(const cmSearchPath&) = default;
- const std::vector<std::string>& GetPaths() const { return this->Paths; }
+ struct PathWithPrefix
+ {
+ std::string Path;
+ std::string Prefix;
+
+ bool operator<(const PathWithPrefix& other) const
+ {
+ return this->Path < other.Path ||
+ (this->Path == other.Path && this->Prefix < other.Prefix);
+ }
+ };
+ const std::vector<PathWithPrefix>& GetPaths() const { return this->Paths; }
std::size_t size() const { return this->Paths.size(); }
void ExtractWithout(const std::set<std::string>& ignore,
@@ -47,8 +58,9 @@ public:
const char* base = nullptr);
protected:
- void AddPathInternal(const std::string& path, const char* base = nullptr);
+ void AddPathInternal(const std::string& path, const std::string& prefix,
+ const char* base = nullptr);
cmFindCommon* FC;
- std::vector<std::string> Paths;
+ std::vector<PathWithPrefix> Paths;
};