summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog
diff options
context:
space:
mode:
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/CMakeLists.txt7
-rw-r--r--Source/QtDialog/CMakeSetup.cxx3
-rw-r--r--Source/QtDialog/QCMake.cxx25
3 files changed, 10 insertions, 25 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 15f9ef1..88a9fc9 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -118,6 +118,13 @@ if(APPLE)
# TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "Copyright 2000-2013 Kitware, Inc."
)
+
+ # Create a symlink in the build tree to provide a "cmake-gui" next
+ # to the "cmake" executable that refers to the application bundle.
+ add_custom_command(TARGET cmake-gui POST_BUILD
+ COMMAND ln -sf ${CMAKE_BUNDLE_NAME}.app/Contents/MacOS/${CMAKE_BUNDLE_NAME}
+ $<TARGET_FILE_DIR:cmake>/cmake-gui
+ )
endif()
set(CMAKE_INSTALL_DESTINATION_ARGS
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}")
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 095aeb6..408bb4c 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -48,7 +48,7 @@ static const char * cmDocumentationOptions[][2] =
int main(int argc, char** argv)
{
- cmSystemTools::FindExecutableDirectory(argv[0]);
+ cmSystemTools::FindCMakeResources(argv[0]);
// check docs first so that X is not need to get docs
// do docs, if args were given
cmDocumentation doc;
@@ -58,7 +58,6 @@ int main(int argc, char** argv)
// Construct and print requested documentation.
cmake hcm;
hcm.AddCMakePaths();
- doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
std::vector<cmDocumentationEntry> generators;
hcm.GetGeneratorDocumentation(generators);
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 0d01181..0fe5f8c 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -33,34 +33,13 @@ QCMake::QCMake(QObject* p)
qRegisterMetaType<QCMakeProperty>();
qRegisterMetaType<QCMakePropertyList>();
- QDir execDir(QCoreApplication::applicationDirPath());
-
-#if defined(Q_OS_MAC)
- if(execDir.exists("../bin/cmake"))
- {
- execDir.cd("../bin");
- }
- else
- {
- execDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment)
- }
-#endif
-
- QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension());
- cmakeCommand = execDir.filePath(cmakeCommand);
-
cmSystemTools::DisableRunCommandOutput();
cmSystemTools::SetRunCommandHideConsole(true);
cmSystemTools::SetErrorCallback(QCMake::errorCallback, this);
- cmSystemTools::FindExecutableDirectory(cmakeCommand.toLocal8Bit().data());
this->CMakeInstance = new cmake;
- this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data());
-#if defined(Q_OS_MAC)
- this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui");
-#else
- this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
-#endif
+ this->CMakeInstance->SetCMakeEditCommand(
+ cmSystemTools::GetCMakeGUICommand());
this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this);