diff options
author | Brad King <brad.king@kitware.com> | 2018-01-25 13:30:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-25 13:30:25 (GMT) |
commit | 312512e2baa608e0eaaaa893114f07e40044f8b2 (patch) | |
tree | b4a615201b119d5c35e66c491e1cbb88469ed069 | |
parent | e46ca12acf7b166eb865d4818d18a769219368a5 (diff) | |
parent | c3b80e86640630036e855775692268531e94f3c1 (diff) | |
download | CMake-312512e2baa608e0eaaaa893114f07e40044f8b2.zip CMake-312512e2baa608e0eaaaa893114f07e40044f8b2.tar.gz CMake-312512e2baa608e0eaaaa893114f07e40044f8b2.tar.bz2 |
Merge topic 'windows-resources-through-link'
c3b80e86 Windows: Add support for running CMake tools through a symlink
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1680
-rw-r--r-- | Source/cmSystemTools.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 06b0b3c..ce08465 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2107,8 +2107,12 @@ void cmSystemTools::FindCMakeResources(const char* argv0) (void)argv0; // ignore this on windows wchar_t modulepath[_MAX_PATH]; ::GetModuleFileNameW(NULL, modulepath, sizeof(modulepath)); - exe_dir = - cmSystemTools::GetFilenamePath(cmsys::Encoding::ToNarrow(modulepath)); + std::string path = cmsys::Encoding::ToNarrow(modulepath); + std::string realPath = cmSystemTools::GetRealPath(path, NULL); + if (realPath.empty()) { + realPath = path; + } + exe_dir = cmSystemTools::GetFilenamePath(realPath); #elif defined(__APPLE__) (void)argv0; // ignore this on OS X #define CM_EXE_PATH_LOCAL_SIZE 16384 |