diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2014-07-23 07:01:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-28 14:24:03 (GMT) |
commit | 44850a267d1c2ee64947ebb93de3998549b59d03 (patch) | |
tree | 7e52d6426e9e5ceb152b2b951521098d0b89a6a8 /CMakeCPack.cmake | |
parent | 3e3ab2adb4a70352a41b469788a2885b20a86fef (diff) | |
download | CMake-44850a267d1c2ee64947ebb93de3998549b59d03.zip CMake-44850a267d1c2ee64947ebb93de3998549b59d03.tar.gz CMake-44850a267d1c2ee64947ebb93de3998549b59d03.tar.bz2 |
CPack: Add an "IFW" generator for Qt Framework Installer
Add support for packaging with the Qt Framework Installer tools:
http://qt-project.org/doc/qtinstallerframework/index.html
Reviewed-by: Nils Gladitz <nilsgladitz@gmail.com>
Diffstat (limited to 'CMakeCPack.cmake')
-rw-r--r-- | CMakeCPack.cmake | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index fb55bfc..5b096ad 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -59,11 +59,43 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") if(${CPACK_SYSTEM_NAME} MATCHES Windows) if(CMAKE_CL_64) set(CPACK_SYSTEM_NAME win64-x64) + set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}") else() set(CPACK_SYSTEM_NAME win32-x86) endif() endif() + # default component for IFW + if(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) + set(_CPACK_IFW_COMPONENT_NAME ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) + else() + set(_CPACK_IFW_COMPONENT_NAME Unspecified) + endif() + string(TOUPPER ${_CPACK_IFW_COMPONENT_NAME} _CPACK_IFW_COMPONENT_UNAME) + + if(${CMAKE_SYSTEM_NAME} MATCHES Windows) + if(BUILD_QtDialog) + set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/bin/cmake-gui.exe\", \"@StartMenuDir@/CMake (cmake-gui).lnk\");\n") + endif() + if(SPHINX_HTML) + set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/html/index.html\", \"@StartMenuDir@/CMake Documentation.lnk\");\n") + endif() + configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in" + "${CMake_BINARY_DIR}/installscript.qs" @ONLY + ) + install(FILES "${CMake_SOURCE_DIR}/Source/QtIFW/cmake.org.html" + DESTINATION "." + ) + set(_CPACK_IFW_COMPONENT_SCRIPT "set(CPACK_IFW_COMPONENT_${_CPACK_IFW_COMPONENT_UNAME}_SCRIPT \"${CMake_BINARY_DIR}/installscript.qs\")") + endif() + + if(${CMAKE_SYSTEM_NAME} MATCHES Linux) + set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}") + set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}") + endif() + + set(_CPACK_IFW_PACKAGE_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) + if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # default to source package - system, on cygwin system is not |