summaryrefslogtreecommitdiff
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-01-28 16:15:17 -0500
committerKyle Edwards <kyle.edwards@kitware.com>2022-01-31 10:41:04 -0500
commit11f97d196880e78717211ab68138e9ff922ec826 (patch)
tree400e8f63b976ecc00afd03b4ce66ca44c27040c7 /Source/cmFindPackageCommand.cxx
parent30e5c1d92baf6e5ac0daed4e4debcdf208968a65 (diff)
downloadcmake-11f97d196880e78717211ab68138e9ff922ec826.tar.gz
find_package(): Refactor CMAKE_[SYSTEM_]IGNORE_PATH
In the old implementation, CMAKE_[SYSTEM_]IGNORE_PATH was handled in cmFindCommon. Move it into cmFindPackageCommand.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 6d788e4790..c468a3cbed 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1346,7 +1346,7 @@ void cmFindPackageCommand::ComputePrefixes()
}
this->FillPrefixesUserGuess();
- this->ComputeFinalPaths();
+ this->ComputeFinalPaths(IgnorePaths::No);
}
void cmFindPackageCommand::FillPrefixesPackageRoot()
@@ -2286,6 +2286,15 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
return false;
}
+ // Skip this if it's in ignored paths.
+ std::string prefixWithoutSlash = prefix_in;
+ if (prefixWithoutSlash != "/" && prefixWithoutSlash.back() == '/') {
+ prefixWithoutSlash.erase(prefixWithoutSlash.length() - 1);
+ }
+ if (this->IgnoredPaths.count(prefixWithoutSlash)) {
+ return false;
+ }
+
// PREFIX/ (useful on windows or in build trees)
if (this->SearchDirectory(prefix_in)) {
return true;