summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-03-28 18:29:29 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-03-28 18:29:29 (GMT)
commitcae34d2df3e3478db69ef1c99ddd649673f64007 (patch)
tree3c4b4440c52d983e245db99992668fbaa1a03c0d /Source
parente40fe909a62df9e073aa597646e048e7b7aa3a37 (diff)
downloadCMake-cae34d2df3e3478db69ef1c99ddd649673f64007.zip
CMake-cae34d2df3e3478db69ef1c99ddd649673f64007.tar.gz
CMake-cae34d2df3e3478db69ef1c99ddd649673f64007.tar.bz2
ENH: try to fix mac symlinks to the executable
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSystemTools.cxx2
-rw-r--r--Source/cmake.cxx4
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)
{