From 06b0dbe0614c08a8ec80ce69e7679b0faa7e69dc Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 12 Nov 2013 14:24:51 -0500 Subject: OS X: Drop version number from CMake.app bundle name (#11693) Always name the application bundle "CMake.app". Users can rename it after installation if they wish. This is the typical approach used by OS X applications, including Xcode. It allows CMake to be upgraded without manually re-running CMake in every build tree to update the path to CMake. It also makes the executable location in the CMake build tree more predicatable. --- CMakeLists.txt | 3 +-- Source/QtDialog/CMakeLists.txt | 8 ++++---- Source/QtDialog/postflight.sh.in | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25cd576..d6237b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -484,7 +484,6 @@ if(BUILD_QtDialog) if(APPLE) set(CMAKE_BUNDLE_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") - set(CMAKE_BUNDLE_NAME "CMake ${CMAKE_BUNDLE_VERSION}") set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") # make sure CMAKE_INSTALL_PREFIX ends in / string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) @@ -494,7 +493,7 @@ if(BUILD_QtDialog) set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") endif() set(CMAKE_INSTALL_PREFIX - "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents") + "${CMAKE_INSTALL_PREFIX}CMake.app/Contents") endif() set(QT_NEED_RPATH FALSE) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 88a9fc9..b17e212 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -112,7 +112,7 @@ endif() if(APPLE) set_target_properties(cmake-gui PROPERTIES - OUTPUT_NAME ${CMAKE_BUNDLE_NAME} + OUTPUT_NAME CMake MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in" MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_BUNDLE_VERSION}" # TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}" @@ -122,7 +122,7 @@ if(APPLE) # 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} + COMMAND ln -sf CMake.app/Contents/MacOS/CMake $/cmake-gui ) endif() @@ -148,7 +148,7 @@ if(APPLE) "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in" "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") - install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui + install(CODE "execute_process(COMMAND ln -s \"../MacOS/CMake\" cmake-gui WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") endif() @@ -157,7 +157,7 @@ if(APPLE OR WIN32) # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}") if(APPLE) - set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}") + set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/CMake") endif() install(CODE " include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\") diff --git a/Source/QtDialog/postflight.sh.in b/Source/QtDialog/postflight.sh.in index 33be352..0b96889 100755 --- a/Source/QtDialog/postflight.sh.in +++ b/Source/QtDialog/postflight.sh.in @@ -1,3 +1,3 @@ #!/bin/bash -"$2@CMAKE_INSTALL_SUBDIR@/@CMAKE_BUNDLE_NAME@.app/Contents/MacOS/@CMAKE_BUNDLE_NAME@" --mac-install +"$2@CMAKE_INSTALL_SUBDIR@/CMake.app/Contents/MacOS/CMake" --mac-install exit 0 -- cgit v0.12