ENH: support for cpack and install of cmake-gui as mac app bundle

This commit is contained in:
Bill Hoffman 2008-02-16 13:05:03 -05:00
parent 337c1f0b72
commit 22927ede1e
8 changed files with 42 additions and 7 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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);

View File

@ -15,7 +15,7 @@
=========================================================================*/
#include "cmInstallProgramsCommand.h"
#include "cmInstallFilesGenerator.h"
// cmExecutableCommand
bool cmInstallProgramsCommand
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)

View File

@ -143,10 +143,14 @@ CMAKE_CXX_SOURCES="\
cmPropertyDefinitionMap \
cmMakeDepend \
cmMakefile \
cmExportFileGenerator \
cmExportInstallFileGenerator \
cmInstallDirectoryGenerator \
cmGeneratedFileStream \
cmGlobalGenerator \
cmLocalGenerator \
cmInstallGenerator \
cmInstallExportGenerator \
cmInstallFilesGenerator \
cmInstallScriptGenerator \
cmInstallTargetGenerator \