diff options
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 11 |
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; |