summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5256fd0..5e5859b 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -786,6 +786,19 @@ int cmake::AddCMakePaths()
cMakeSelf = cmSystemTools::GetRealPath(cMakeSelf.c_str());
cMakeSelf += "/cmake";
cMakeSelf += cmSystemTools::GetExecutableExtension();
+#if __APPLE__
+ // on the apple this might be the gui bundle
+ if(!cmSystemTools::FileExists(cMakeSelf.c_str()))
+ {
+ cMakeSelf = cmSystemTools::GetExecutableDirectory();
+ cMakeSelf = cmSystemTools::GetRealPath(cMakeSelf.c_str());
+ cMakeSelf += "../../../..";
+ cMakeSelf = cmSystemTools::GetRealPath(cMakeSelf.c_str());
+ cMakeSelf = cmSystemTools::CollapseFullPath(cMakeSelf.c_str());
+ cMakeSelf += "/cmake";
+ std::cerr << cMakeSelf.c_str() << "\n";
+ }
+#endif
if(!cmSystemTools::FileExists(cMakeSelf.c_str()))
{
cmSystemTools::Error("CMake executable cannot be found at ",