diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2015-07-03 09:58:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-07 13:16:40 (GMT) |
commit | c823f04e0cbc4753cc5b6d5c9f45b9f015a12568 (patch) | |
tree | 4edbd2e75f2c40e2884930e203dffa170864dcb6 /CMakeCPack.cmake | |
parent | 7383e4d722809e2460bd4e87ea7fdbef5f64c303 (diff) | |
download | CMake-c823f04e0cbc4753cc5b6d5c9f45b9f015a12568.zip CMake-c823f04e0cbc4753cc5b6d5c9f45b9f015a12568.tar.gz CMake-c823f04e0cbc4753cc5b6d5c9f45b9f015a12568.tar.bz2 |
CMake: New option CMake_INSTALL_COMPONENTS
By default is OFF.
Now it's used with CPack IFW himself installer.
Diffstat (limited to 'CMakeCPack.cmake')
-rw-r--r-- | CMakeCPack.cmake | 76 |
1 files changed, 48 insertions, 28 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index 0eda2bd..d7c6024 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -66,34 +66,40 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") endif() # Components - set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack) - list(APPEND _CPACK_IFW_COMPONENTS_ALL data) - if(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) - set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME - ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) - else() - set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME Unspecified) - endif() - list(APPEND _CPACK_IFW_COMPONENTS_ALL ${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME}) - string(TOUPPER "${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME}" - _CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME) - if(BUILD_CursesDialog) - list(APPEND _CPACK_IFW_COMPONENTS_ALL ccmake) - endif() - if(BUILD_QtDialog) - list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-gui) - endif() - if(SPHINX_MAN) - list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-man) - endif() - if(SPHINX_HTML) - list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-html) - endif() - if(SPHINX_SINGLEHTML) - list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-singlehtml) - endif() - if(SPHINX_QTHELP) - list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-qthelp) + if(CMake_INSTALL_COMPONENTS) + set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack) + if(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) + set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME + ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) + else() + set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME Unspecified) + endif() + list(APPEND _CPACK_IFW_COMPONENTS_ALL ${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME}) + string(TOUPPER "${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME}" + _CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME) + if(BUILD_CursesDialog) + list(APPEND _CPACK_IFW_COMPONENTS_ALL ccmake) + endif() + if(BUILD_QtDialog) + list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-gui) + endif() + if(SPHINX_MAN) + list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-man) + endif() + if(SPHINX_HTML) + list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-html) + endif() + if(SPHINX_SINGLEHTML) + list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-singlehtml) + endif() + if(SPHINX_QTHELP) + list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-qthelp) + endif() + set(_CPACK_IFW_COMPONENTS_CONFIGURATION " + # Components + set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\") + set(CPACK_COMPONENTS_GROUPING IGNORE) +") endif() # Components scripts configuration @@ -107,9 +113,23 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") if(${CMAKE_SYSTEM_NAME} MATCHES Windows) set(_CPACK_IFW_PACKAGE_ICON "set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")") + 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 "${CMAKE_DOC_DIR}" ) + if(CMake_INSTALL_COMPONENTS) + set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/CMake.qs") + else() + set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/installscript.qs") + endif() endif() if(${CMAKE_SYSTEM_NAME} MATCHES Linux) |