浏览代码

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).
Brad King 11 月之前
父节点
当前提交
8d6b76771d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Source/cmFindPackageCommand.cxx

+ 2 - 2
Source/cmFindPackageCommand.cxx

@@ -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;
     }