mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 22:37:30 +08:00
cmake: Explicitly look up on-disk case of input paths on Windows
KWSys's `CollapseFullPath` no longer looks up the actual case on disk. Add the lookup explicitly where we need it: * `ToNormalizedPathOnDisk` * `file(REAL_PATH)` * `get_filename_component(... ABSOLUTE)` Fixes: #20214
This commit is contained in:
@@ -1420,6 +1420,7 @@ bool HandleRealPathCommand(std::vector<std::string> const& args,
|
||||
std::string oldPolicyPath =
|
||||
cmSystemTools::CollapseFullPath(input, *arguments.BaseDirectory);
|
||||
oldPolicyPath = cmSystemTools::GetRealPath(oldPolicyPath);
|
||||
oldPolicyPath = cmSystemTools::GetActualCaseForPath(oldPolicyPath);
|
||||
if (warnAbout152) {
|
||||
computeNewPath(input, realPath);
|
||||
if (oldPolicyPath != realPath) {
|
||||
|
@@ -113,6 +113,7 @@ bool cmGetFilenameComponentCommand(std::vector<std::string> const& args,
|
||||
// Resolve symlinks if possible
|
||||
result = cmSystemTools::GetRealPath(result);
|
||||
}
|
||||
result = cmSystemTools::GetActualCaseForPath(result);
|
||||
} else {
|
||||
std::string err = "unknown component " + args[2];
|
||||
status.SetError(err);
|
||||
|
@@ -1664,6 +1664,9 @@ std::string cmSystemTools::ToNormalizedPathOnDisk(std::string p)
|
||||
{
|
||||
p = cmSystemTools::CollapseFullPath(p);
|
||||
cmSystemTools::ConvertToUnixSlashes(p);
|
||||
#ifdef _WIN32
|
||||
p = cmSystemTools::GetActualCaseForPathCached(p);
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user