Bläddra i källkod

ENH: try to fix mac symlinks to the executable

Bill Hoffman 17 år sedan
förälder
incheckning
cae34d2df3
2 ändrade filer med 4 tillägg och 2 borttagningar
  1. 2 0
      Source/cmSystemTools.cxx
  2. 2 2
      Source/cmake.cxx

+ 2 - 0
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());
     }

+ 2 - 2
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)
       {