summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-19 15:08:49 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-19 15:08:49 (GMT)
commit0356b81525019e054be5b6edc0c0f7ca51249f54 (patch)
treef1601e00b556daae032b90b703a1be6b9d4fa87b /Source/cmFindPackageCommand.cxx
parente61d872839a84a5ab7a5e8489008ffed9b83782e (diff)
downloadCMake-0356b81525019e054be5b6edc0c0f7ca51249f54.zip
CMake-0356b81525019e054be5b6edc0c0f7ca51249f54.tar.gz
CMake-0356b81525019e054be5b6edc0c0f7ca51249f54.tar.bz2
find_package: Fix regression in searching root prefix
Fix the check added by commit 2ff1693066 (find_package: avoid showing files as directories when searching config files, 2020-09-30, v3.19.0-rc1~67^2) to avoid skipping the root prefix `/`. Fixes: #21324
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index c988b59..92b1e80 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1984,7 +1984,7 @@ cmFileListGeneratorBase* cmFileListGeneratorBase::SetNext(
bool cmFileListGeneratorBase::Consider(std::string const& fullPath,
cmFileList& listing)
{
- if (!cmSystemTools::FileIsDirectory(fullPath)) {
+ if (!fullPath.empty() && !cmSystemTools::FileIsDirectory(fullPath)) {
return false;
}
if (this->Next) {