Merge topic 'cmake-distribution-config'

06b0dbe OS X: Drop version number from CMake.app bundle name (#11693)
84af42b Configure NSIS-packaged CMake version and install destination
7655029 Configure NSIS-packaged CMake documentation link in Start Menu
This commit is contained in:
Brad King 2013-11-13 11:36:46 -05:00 committed by CMake Topic Stage
commit d592fc48cd
5 changed files with 13 additions and 25 deletions

View File

@ -29,13 +29,10 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_PACKAGE_VENDOR "Kitware") set(CPACK_PACKAGE_VENDOR "Kitware")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
# Make this explicit here, rather than accepting the CPack default value,
# so we can refer to it:
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
# Installers for 32- vs. 64-bit CMake: # Installers for 32- vs. 64-bit CMake:
# - Root install directory (displayed to end user at installer-run time) # - Root install directory (displayed to end user at installer-run time)
@ -43,13 +40,12 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# - Registry key used to store info about the installation # - Registry key used to store info about the installation
if(CMAKE_CL_64) if(CMAKE_CL_64)
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
else() else()
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
endif() endif()
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_NSIS_PACKAGE_NAME}")
if(NOT DEFINED CPACK_SYSTEM_NAME) if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just # make sure package is not Cygwin-unknown, for Cygwin just

View File

@ -13,14 +13,7 @@ if(CPACK_GENERATOR MATCHES "NSIS")
set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp") set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp")
# tell cpack to create links to the doc files # tell cpack to create links to the doc files
set(CPACK_NSIS_MENU_LINKS set(CPACK_NSIS_MENU_LINKS
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help" "@CMAKE_DOC_DIR@/html/index.html" "CMake Documentation"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html"
"CMake Properties and Variables Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/ctest.html" "CTest Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-modules.html" "CMake Modules Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-commands.html" "CMake Commands Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help"
"http://www.cmake.org" "CMake Web Site" "http://www.cmake.org" "CMake Web Site"
) )
# Use the icon from cmake-gui for add-remove programs # Use the icon from cmake-gui for add-remove programs

View File

@ -484,7 +484,6 @@ if(BUILD_QtDialog)
if(APPLE) if(APPLE)
set(CMAKE_BUNDLE_VERSION set(CMAKE_BUNDLE_VERSION
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
set(CMAKE_BUNDLE_NAME "CMake ${CMAKE_BUNDLE_VERSION}")
set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
# make sure CMAKE_INSTALL_PREFIX ends in / # make sure CMAKE_INSTALL_PREFIX ends in /
string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
@ -494,7 +493,7 @@ if(BUILD_QtDialog)
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif() endif()
set(CMAKE_INSTALL_PREFIX set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents") "${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
endif() endif()
set(QT_NEED_RPATH FALSE) set(QT_NEED_RPATH FALSE)

View File

@ -115,7 +115,7 @@ if(APPLE)
LIMIT_COUNT 1 REGEX "^Copyright 2000-20[0-9][0-9] Kitware") LIMIT_COUNT 1 REGEX "^Copyright 2000-20[0-9][0-9] Kitware")
set_target_properties(cmake-gui PROPERTIES 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_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_BUNDLE_VERSION}" MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_BUNDLE_VERSION}"
# TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}" # TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}"
@ -125,7 +125,7 @@ if(APPLE)
# Create a symlink in the build tree to provide a "cmake-gui" next # Create a symlink in the build tree to provide a "cmake-gui" next
# to the "cmake" executable that refers to the application bundle. # to the "cmake" executable that refers to the application bundle.
add_custom_command(TARGET cmake-gui POST_BUILD 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
$<TARGET_FILE_DIR:cmake>/cmake-gui $<TARGET_FILE_DIR:cmake>/cmake-gui
) )
endif() endif()
@ -151,7 +151,7 @@ if(APPLE)
"${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in" configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
"${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") "${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)") WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
endif() endif()
@ -160,7 +160,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 # 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}") set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}")
if(APPLE) 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() endif()
install(CODE " install(CODE "
include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\") include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\")

View File

@ -1,3 +1,3 @@
#!/bin/bash #!/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 exit 0