summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-17 15:59:47 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-17 16:09:12 (GMT)
commit3287ba02540ae94d6b0105f84e930aa19cf61b19 (patch)
treeb5e49885822130c1e019ebf2419081cd20f3fc00 /Source/cmSystemTools.cxx
parentdbdd25bc95af100633008a31f1bbdf7146e211f7 (diff)
downloadCMake-3287ba02540ae94d6b0105f84e930aa19cf61b19.zip
CMake-3287ba02540ae94d6b0105f84e930aa19cf61b19.tar.gz
CMake-3287ba02540ae94d6b0105f84e930aa19cf61b19.tar.bz2
Make CMAKE_ROOT independent of case of path used to invoke cmake
We compute the location of `CMAKE_ROOT` and other resources relative to the location of our own executable. On some platforms this path is computed in a way that depends on the case of the path used to invoke the executable. Convert the result to the actual case preserved by the filesystem on disk in order to make it consistent regardless of how the executable is launched. This approach generalizes the fix made by commit v3.8.0-rc1~71^2 (cmSystemTools: use the actual case for root detection, 2017-01-18). Issue: #16648
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 9efc13b..b3a7248 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1978,6 +1978,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
// ???
}
#endif
+ exe_dir = cmSystemTools::GetActualCaseForPath(exe_dir);
cmSystemToolsCMakeCommand = exe_dir;
cmSystemToolsCMakeCommand += "/cmake";
cmSystemToolsCMakeCommand += cmSystemTools::GetExecutableExtension();
@@ -2015,8 +2016,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
// Install tree has
// - "<prefix><CMAKE_BIN_DIR>/cmake"
// - "<prefix><CMAKE_DATA_DIR>"
- const std::string actual_case = cmSystemTools::GetActualCaseForPath(exe_dir);
- if (cmHasSuffix(actual_case, CMAKE_BIN_DIR)) {
+ if (cmHasSuffix(exe_dir, CMAKE_BIN_DIR)) {
std::string const prefix =
exe_dir.substr(0, exe_dir.size() - strlen(CMAKE_BIN_DIR));
cmSystemToolsCMakeRoot = prefix + CMAKE_DATA_DIR;