diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-02-16 18:05:03 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-02-16 18:05:03 (GMT) |
commit | 22927ede1e74e43ad78699ff4082d8b78e50599c (patch) | |
tree | 6f6bd3e1613623e7f9e7356ef798a02fe553df84 | |
parent | 337c1f0b7230d6b0b4674d1d7168eef5a6dce6cd (diff) | |
download | CMake-22927ede1e74e43ad78699ff4082d8b78e50599c.zip CMake-22927ede1e74e43ad78699ff4082d8b78e50599c.tar.gz CMake-22927ede1e74e43ad78699ff4082d8b78e50599c.tar.bz2 |
ENH: support for cpack and install of cmake-gui as mac app bundle
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | Source/QtDialog/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 10 | ||||
-rw-r--r-- | Source/QtDialog/QtDialogCPack.cmake.in | 9 | ||||
-rw-r--r-- | Source/cmBootstrapCommands.cxx | 3 | ||||
-rw-r--r-- | Source/cmCommands.cxx | 3 | ||||
-rw-r--r-- | Source/cmInstallProgramsCommand.cxx | 2 | ||||
-rwxr-xr-x | bootstrap | 4 |
8 files changed, 42 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 59bcc30..38e0d3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -412,6 +412,17 @@ IF(BUILD_CursesDialog) ENDIF(BUILD_CursesDialog) IF(BUILD_QtDialog) + IF(APPLE) + SET(CMAKE_INSTALL_SUBDIR + "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}") + IF(CMake_VERSION_DATE) + SET(CMAKE_INSTALL_SUBDIR + "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_DATE}") + ENDIF(CMake_VERSION_DATE) + SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SUBDIR}") + SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SUBDIR}/cmake-gui.app/Contents") + ENDIF(APPLE) + SET(QT_NEED_RPATH FALSE) IF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") SET(QT_NEED_RPATH TRUE) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 1b9119c..31d8309 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -54,10 +54,15 @@ ELSE(NOT QT4_FOUND) ADD_EXECUTABLE(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS}) TARGET_LINK_LIBRARIES(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES}) + IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) + SET(CMAKE_INSTALL_DESTINATION_ARGS + BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") + ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) # if qt is not static and we are on windows then skip the install # I don't want to distribute qt dlls IF(CMAKE_PACKAGE_QTGUI) - INSTALL_TARGETS(/bin cmake-gui) + INSTALL(TARGETS cmake-gui RUNTIME DESTINATION bin + ${CMAKE_INSTALL_DESTINATION_ARGS}) ENDIF(CMAKE_PACKAGE_QTGUI) ENDIF(NOT QT4_FOUND) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 047abde..4f4ce37 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -34,13 +34,19 @@ QCMake::QCMake(QObject* p) QDir execDir(QCoreApplication::applicationDirPath()); #if defined(Q_OS_MAC) - execDir.cd("../../../"); + 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")+cmSystemTools::GetExecutableExtension(); cmakeCommand = execDir.filePath(cmakeCommand); - cmSystemTools::DisableRunCommandOutput(); cmSystemTools::SetRunCommandHideConsole(true); cmSystemTools::SetErrorCallback(QCMake::errorCallback, this); diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in index 24dda01..fc1fa79 100644 --- a/Source/QtDialog/QtDialogCPack.cmake.in +++ b/Source/QtDialog/QtDialogCPack.cmake.in @@ -1,4 +1,13 @@ +SET(IS_APPLE @APPLE@) SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@) + IF(CMAKE_PACKAGE_QTGUI) SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "cmake-gui" "cmake-gui(beta)") +IF(IS_APPLE) + # for apple install we set the install prefix to /Applications and then install + # cmake into the bundle for cmake-gui + SET(CPACK_SET_DESTDIR TRUE) +ENDIF(IS_APPLE) ENDIF(CMAKE_PACKAGE_QTGUI) + + diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx index af9bf3d..e7c0d2e 100644 --- a/Source/cmBootstrapCommands.cxx +++ b/Source/cmBootstrapCommands.cxx @@ -66,6 +66,8 @@ #include "cmIncludeDirectoryCommand.cxx" #include "cmIncludeRegularExpressionCommand.cxx" #include "cmInstallFilesCommand.cxx" +#include "cmInstallCommandArguments.cxx" +#include "cmInstallCommand.cxx" #include "cmInstallTargetsCommand.cxx" #include "cmLinkDirectoriesCommand.cxx" #include "cmListCommand.cxx" @@ -132,6 +134,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands) commands.push_back(new cmIncludeCommand); commands.push_back(new cmIncludeDirectoryCommand); commands.push_back(new cmIncludeRegularExpressionCommand); + commands.push_back(new cmInstallCommand); commands.push_back(new cmInstallFilesCommand); commands.push_back(new cmInstallTargetsCommand); commands.push_back(new cmLinkDirectoriesCommand); diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 42ec776..d719d55 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -26,8 +26,6 @@ #include "cmFLTKWrapUICommand.cxx" #include "cmGetTestPropertyCommand.cxx" #include "cmIncludeExternalMSProjectCommand.cxx" -#include "cmInstallCommand.cxx" -#include "cmInstallCommandArguments.cxx" #include "cmInstallProgramsCommand.cxx" #include "cmLinkLibrariesCommand.cxx" #include "cmLoadCacheCommand.cxx" @@ -70,7 +68,6 @@ void GetPredefinedCommands(std::list<cmCommand*>& commands.push_back(new cmFLTKWrapUICommand); commands.push_back(new cmGetTestPropertyCommand); commands.push_back(new cmIncludeExternalMSProjectCommand); - commands.push_back(new cmInstallCommand); commands.push_back(new cmInstallProgramsCommand); commands.push_back(new cmLinkLibrariesCommand); commands.push_back(new cmLoadCacheCommand); diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 013728a..6a55f17 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -15,7 +15,7 @@ =========================================================================*/ #include "cmInstallProgramsCommand.h" - +#include "cmInstallFilesGenerator.h" // cmExecutableCommand bool cmInstallProgramsCommand ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) @@ -143,10 +143,14 @@ CMAKE_CXX_SOURCES="\ cmPropertyDefinitionMap \ cmMakeDepend \ cmMakefile \ + cmExportFileGenerator \ + cmExportInstallFileGenerator \ + cmInstallDirectoryGenerator \ cmGeneratedFileStream \ cmGlobalGenerator \ cmLocalGenerator \ cmInstallGenerator \ + cmInstallExportGenerator \ cmInstallFilesGenerator \ cmInstallScriptGenerator \ cmInstallTargetGenerator \ |