CMake: Improve cmake setup on Apple

Users tend to select cmake.app, which is actually a GUI for cmake and
not what Creator expects. So check for the proper binary in the bundle
and return that if it exists.

Change-Id: I1668baa6236ee4ae88da200cef257b636f7a9e72
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2016-09-14 12:56:32 +02:00
parent 2244e2b26c
commit dfbb0b64b9

View File

@@ -139,6 +139,12 @@ QVariantMap CMakeTool::toMap() const
Utils::FileName CMakeTool::cmakeExecutable() const Utils::FileName CMakeTool::cmakeExecutable() const
{ {
if (Utils::HostOsInfo::isMacHost() && m_executable.endsWith(".app")) {
Utils::FileName toTest = m_executable;
toTest = toTest.appendPath("Contents/bin/cmake");
if (toTest.exists())
return toTest;
}
return m_executable; return m_executable;
} }