summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-01 11:57:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-01 11:57:23 (GMT)
commit95aa5c40cfd2853fa920609714c20e0473312229 (patch)
tree85fefcea54ed0fd44ca63c2c6da7da7b65ebe955
parent9fc742041ba16f11de5c370522d79cc382a0ec68 (diff)
parent2ff16930662474b8450c83d06884f3f1b3f3c747 (diff)
downloadCMake-95aa5c40cfd2853fa920609714c20e0473312229.zip
CMake-95aa5c40cfd2853fa920609714c20e0473312229.tar.gz
CMake-95aa5c40cfd2853fa920609714c20e0473312229.tar.bz2
Merge topic 'find_package-check-dir'
2ff1693066 find_package: avoid showing files as directories when searching config files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5301
-rw-r--r--Source/cmFindPackageCommand.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 86251d2..c988b59 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1984,6 +1984,9 @@ cmFileListGeneratorBase* cmFileListGeneratorBase::SetNext(
bool cmFileListGeneratorBase::Consider(std::string const& fullPath,
cmFileList& listing)
{
+ if (!cmSystemTools::FileIsDirectory(fullPath)) {
+ return false;
+ }
if (this->Next) {
return this->Next->Search(fullPath + "/", listing);
}
@@ -2238,10 +2241,8 @@ private:
// Look for directories among the matches.
for (std::string const& f : files) {
- if (cmSystemTools::FileIsDirectory(f)) {
- if (this->Consider(f, lister)) {
- return true;
- }
+ if (this->Consider(f, lister)) {
+ return true;
}
}
return false;