mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 12:19:54 -05:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user