find_package: Explicitly normalize CONFIG file path as it exists on disk

This was missed in commit 9d44a77454 (find_*: Explicitly normalize found
paths as they exist on disk, 2024-10-17).
This commit is contained in:
Brad King
2024-12-12 11:36:40 -05:00
parent f4428d9784
commit 8d6b76771d

View File

@@ -2410,8 +2410,6 @@ bool cmFindPackageCommand::CheckDirectory(std::string const& dir)
// Look for the file in this directory.
if (this->FindConfigFile(d, this->FileFound)) {
// Remove duplicate slashes.
cmSystemTools::ConvertToUnixSlashes(this->FileFound);
return true;
}
return false;
@@ -2429,6 +2427,8 @@ bool cmFindPackageCommand::FindConfigFile(std::string const& dir,
// Allow resolving symlinks when the config file is found through a link
if (this->UseRealPath) {
file = cmSystemTools::GetRealPath(file);
} else {
file = cmSystemTools::ToNormalizedPathOnDisk(file);
}
return true;
}