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
This commit is contained in:
Brad King
2020-10-19 11:08:49 -04:00
parent e61d872839
commit 0356b81525
+1 -1
View File
@@ -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) {