From cae34d2df3e3478db69ef1c99ddd649673f64007 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 28 Mar 2008 14:29:29 -0400 Subject: ENH: try to fix mac symlinks to the executable --- Source/cmSystemTools.cxx | 2 ++ Source/cmake.cxx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index d4dee28..32c7797 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2107,6 +2107,8 @@ void cmSystemTools::FindExecutableDirectory(const char* argv0) std::string exe; if(cmSystemTools::FindProgramPath(argv0, exe, errorMsg)) { + // remove symlinks + exe = cmSystemTools::GetRealPath(exe.c_str()); cmSystemToolsExecutableDirectory = cmSystemTools::GetFilenamePath(exe.c_str()); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 02e1770..88aed1d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -858,8 +858,8 @@ int cmake::AddCMakePaths() if(!cmSystemTools::FileExists(modules.c_str())) { // next try exe/.. - cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str()); - cMakeRoot = cmSystemTools::GetRealPath(cMakeRoot.c_str()); + cMakeRoot = cmSystemTools::GetRealPath(cMakeSelf.c_str()); + cMakeRoot = cmSystemTools::GetProgramPath(cMakeRoot.c_str()); std::string::size_type slashPos = cMakeRoot.rfind("/"); if(slashPos != std::string::npos) { -- cgit v0.12