MCPcopy Create free account
hub / github.com/Kitware/CMake / ResolveSymlinkToOwnExecutable

Function ResolveSymlinkToOwnExecutable

Source/cmSystemTools.cxx:3067–3087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3065
3066#ifndef CMAKE_BOOTSTRAP
3067bool ResolveSymlinkToOwnExecutable(std::string& exe, std::string& exe_dir)
3068{
3069 std::string linked_exe;
3070 if (!cmSystemTools::ReadSymlink(exe, linked_exe)) {
3071 return false;
3072 }
3073# if defined(__APPLE__)
3074 // Ignore "cmake-gui -> ../MacOS/CMake".
3075 if (IsCMakeAppBundleExe(linked_exe)) {
3076 return false;
3077 }
3078# endif
3079 if (cmSystemTools::FileIsFullPath(linked_exe)) {
3080 exe = std::move(linked_exe);
3081 } else {
3082 exe = cmStrCat(exe_dir, '/', std::move(linked_exe));
3083 }
3084 exe = cmSystemTools::ToNormalizedPathOnDisk(std::move(exe));
3085 exe_dir = cmSystemTools::GetFilenamePath(exe);
3086 return true;
3087}
3088
3089bool FindCMakeResourcesInInstallTree(std::string const& exe_dir)
3090{

Callers 1

FindCMakeResourcesMethod · 0.85

Calls 3

IsCMakeAppBundleExeFunction · 0.85
moveFunction · 0.85
cmStrCatFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…