From 938bbc4352cf34532dc1f52998ec7d23532df765 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Sun, 7 Dec 2014 21:25:28 +0300 Subject: CMake: Install COMPONENTs Added components: - cmake - ctest - cpack - cmake-gui - ccmake - data - sphinx-html - sphinx-singlehtml - sphinx-qthelp Other now Unspecified. --- CMakeCPack.cmake | 48 ++++++++++--- CMakeCPackOptions.cmake.in | 84 ++++++++++++++++++++++- CMakeLists.txt | 1 + Source/CMakeLists.txt | 11 ++- Source/CursesDialog/CMakeLists.txt | 2 +- Source/QtDialog/CMakeLists.txt | 4 +- Source/QtIFW/CMake.Dialogs.QtGUI.qs | 21 ++++++ Source/QtIFW/CMake.Documentation.SphinxHTML.qs.in | 21 ++++++ Source/QtIFW/CMake.qs.in | 22 ++++++ Source/QtIFW/installscript.qs.in | 24 ------- Utilities/Sphinx/CMakeLists.txt | 4 +- 11 files changed, 200 insertions(+), 42 deletions(-) create mode 100644 Source/QtIFW/CMake.Dialogs.QtGUI.qs create mode 100644 Source/QtIFW/CMake.Documentation.SphinxHTML.qs.in create mode 100644 Source/QtIFW/CMake.qs.in delete mode 100644 Source/QtIFW/installscript.qs.in diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index 22ca8cf..b299e7f 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -65,22 +65,48 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") endif() 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_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() + + # Components scripts configuration + foreach(_script + CMake + CMake.Documentation.SphinxHTML) + configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/${_script}.qs.in" + "${CMake_BINARY_DIR}/${_script}.qs" @ONLY) + endforeach() + 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 "." + DESTINATION "${CMAKE_DOC_DIR}" ) - set(_CPACK_IFW_PACKAGE_SCRIPT "set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT \"${CMake_BINARY_DIR}/installscript.qs\")") endif() if(${CMAKE_SYSTEM_NAME} MATCHES Linux) diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 6003565..07c7017 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -44,17 +44,97 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME "cmake-maintenance") # Package configuration group set(CPACK_IFW_PACKAGE_GROUP CMake) + # Components + set(CPACK_COMPONENTS_ALL "@_CPACK_IFW_COMPONENTS_ALL@") + set(CPACK_COMPONENTS_GROUPING IGNORE) + # Unspecified + set(CPACK_IFW_COMPONENT_@_CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME@_VERSION + "@_CPACK_IFW_PACKAGE_VERSION@") # Group configuration set(CPACK_COMPONENT_GROUP_CMAKE_DISPLAY_NAME "@CPACK_PACKAGE_NAME@") set(CPACK_COMPONENT_GROUP_CMAKE_DESCRIPTION "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@") - # IFW group configuration set(CPACK_IFW_COMPONENT_GROUP_CMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") set(CPACK_IFW_COMPONENT_GROUP_CMAKE_LICENSES "@CPACK_PACKAGE_NAME@ Copyright" "@CPACK_RESOURCE_FILE_LICENSE@") - @_CPACK_IFW_PACKAGE_SCRIPT@ + set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT "@CMake_BINARY_DIR@/CMake.qs") + set(CPACK_IFW_COMPONENT_GROUP_CMAKE_PRIORITY 100) + + # Tools + set(CPACK_COMPONENT_GROUP_TOOLS_DISPLAY_NAME "Command-Line Tools") + set(CPACK_COMPONENT_GROUP_TOOLS_PARENT_GROUP CMake) + set(CPACK_IFW_COMPONENT_GROUP_TOOLS_PRIORITY 90) + set(CPACK_IFW_COMPONENT_GROUP_TOOLS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + set(CPACK_COMPONENT_CMAKE_DISPLAY_NAME "cmake") + set(CPACK_COMPONENT_CMAKE_GROUP Tools) + set(CPACK_IFW_COMPONENT_CMAKE_NAME "CMake") + set(CPACK_IFW_COMPONENT_CMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + set(CPACK_COMPONENT_CTEST_DISPLAY_NAME "ctest") + set(CPACK_COMPONENT_CTEST_GROUP Tools) + set(CPACK_IFW_COMPONENT_CTEST_NAME "CTest") + set(CPACK_IFW_COMPONENT_CTEST_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + set(CPACK_COMPONENT_CPACK_DISPLAY_NAME "cpack") + set(CPACK_COMPONENT_CPACK_GROUP Tools) + set(CPACK_IFW_COMPONENT_CPACK_NAME "CPack") + set(CPACK_IFW_COMPONENT_CPACK_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + # Dialogs + set(CPACK_COMPONENT_GROUP_DIALOGS_DISPLAY_NAME "Interactive Dialogs") + set(CPACK_COMPONENT_GROUP_DIALOGS_PARENT_GROUP CMake) + set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_PRIORITY 80) + set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + set(CPACK_COMPONENT_CMAKE-GUI_DISPLAY_NAME "cmake-gui") + set(CPACK_COMPONENT_CMAKE-GUI_GROUP Dialogs) + set(CPACK_IFW_COMPONENT_CMAKE-GUI_NAME "QtGUI") + set(CPACK_IFW_COMPONENT_CMAKE-GUI_SCRIPT + "@CMake_SOURCE_DIR@/Source/QtIFW/CMake.Dialogs.QtGUI.qs") + set(CPACK_IFW_COMPONENT_CMAKE-GUI_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + set(CPACK_COMPONENT_CCMAKE_DISPLAY_NAME "ccmake") + set(CPACK_COMPONENT_CCMAKE_GROUP Dialogs) + set(CPACK_IFW_COMPONENT_CCMAKE_NAME "CursesGUI") + set(CPACK_IFW_COMPONENT_CCMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + # Data + set(CPACK_COMPONENT_DATA_DISPLAY_NAME "Data") + set(CPACK_COMPONENT_DATA_DESCRIPTION + "CMake data files (help, modules and templates)") + set(CPACK_COMPONENT_DATA_GROUP CMake) + set(CPACK_IFW_COMPONENT_DATA_PRIORITY 70) + set(CPACK_IFW_COMPONENT_DATA_NAME "Data") + set(CPACK_IFW_COMPONENT_DATA_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + # Documentation + set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DISPLAY_NAME "Documentation") + set(CPACK_COMPONENT_GROUP_DOCUMENTATION_PARENT_GROUP CMake) + set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_PRIORITY 60) + set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_VERSION + "@_CPACK_IFW_PACKAGE_VERSION@") + + set(CPACK_COMPONENT_SPHINX-HTML_DISPLAY_NAME "HTML") + set(CPACK_COMPONENT_SPHINX-HTML_GROUP Documentation) + set(CPACK_IFW_COMPONENT_SPHINX-HTML_NAME "SphinxHTML") + set(CPACK_IFW_COMPONENT_SPHINX-HTML_SCRIPT + "@CMake_BINARY_DIR@/CMake.Documentation.SphinxHTML.qs") + set(CPACK_IFW_COMPONENT_SPHINX-HTML_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISPLAY_NAME "Single HTML") + set(CPACK_COMPONENT_SPHINX-SINGLEHTML_GROUP Documentation) + set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_NAME "SphinxSingleHTML") + set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_VERSION + "@_CPACK_IFW_PACKAGE_VERSION@") + + set(CPACK_COMPONENT_SPHINX-QTHELP_DISPLAY_NAME "Qt Compressed Help") + set(CPACK_COMPONENT_SPHINX-QTHELP_GROUP Documentation) + set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_NAME "SphinxQtHelp") + set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + endif() if(CPACK_GENERATOR MATCHES "CygwinSource") diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b91ab8..2c40a1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -652,6 +652,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT data PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 6d012fd..83d3090 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -734,9 +734,16 @@ endif() include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) -install(TARGETS cmake ctest cpack DESTINATION bin) +# Install tools + +set(_tools cmake ctest cpack) + if(APPLE) - install(TARGETS cmakexbuild DESTINATION bin) + list(APPEND _tools cmakexbuild) endif() +foreach(_tool ${_tools}) + install(TARGETS ${_tool} DESTINATION bin COMPONENT ${_tool}) +endforeach() + install(FILES cmCPluginAPI.h DESTINATION ${CMAKE_DATA_DIR}/include) diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 7d4e88c..14eb46c 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -47,4 +47,4 @@ else() target_link_libraries(ccmake cmForm) endif() -install(TARGETS ccmake DESTINATION bin) +install(TARGETS ccmake DESTINATION bin COMPONENT ccmake) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 168f57d..f3590c4 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -165,7 +165,9 @@ endif() set(CMAKE_INSTALL_DESTINATION_ARGS BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") -install(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS}) +install(TARGETS cmake-gui + RUNTIME DESTINATION bin COMPONENT cmake-gui + ${CMAKE_INSTALL_DESTINATION_ARGS}) if(UNIX AND NOT APPLE) foreach (size IN ITEMS 32 128) diff --git a/Source/QtIFW/CMake.Dialogs.QtGUI.qs b/Source/QtIFW/CMake.Dialogs.QtGUI.qs new file mode 100644 index 0000000..219a0a9 --- /dev/null +++ b/Source/QtIFW/CMake.Dialogs.QtGUI.qs @@ -0,0 +1,21 @@ +// Component: CMake.Dialogs.QtGUI + +function Component() +{ + // Default constructor +} + +Component.prototype.createOperations = function() +{ + // Create shortcut + if (installer.value("os") === "win") { + + component.addOperation("CreateShortcut", + installer.value("TargetDir") + "/bin/cmake-gui.exe", + installer.value("StartMenuDir") + "/CMake (cmake-gui).lnk"); + + } + + // Call default implementation + component.createOperations(); +} diff --git a/Source/QtIFW/CMake.Documentation.SphinxHTML.qs.in b/Source/QtIFW/CMake.Documentation.SphinxHTML.qs.in new file mode 100644 index 0000000..5c929e8 --- /dev/null +++ b/Source/QtIFW/CMake.Documentation.SphinxHTML.qs.in @@ -0,0 +1,21 @@ +// Component: CMake.Documentation.SphinxHTML + +function Component() +{ + // Default constructor +} + +Component.prototype.createOperations = function() +{ + // Create shortcut + if (installer.value("os") === "win") { + + component.addOperation("CreateShortcut", + installer.value("TargetDir") + "/@CMAKE_DOC_DIR@/html/index.html", + installer.value("StartMenuDir") + "/CMake Documentation.lnk"); + + } + + // Call default implementation + component.createOperations(); +} diff --git a/Source/QtIFW/CMake.qs.in b/Source/QtIFW/CMake.qs.in new file mode 100644 index 0000000..828cc7c --- /dev/null +++ b/Source/QtIFW/CMake.qs.in @@ -0,0 +1,22 @@ +function Component() +{ + // Default constructor +} + +Component.prototype.createOperations = function() +{ + // Create shortcut + if (installer.value("os") === "win") { + + component.addOperation("CreateShortcut", + installer.value("TargetDir") + "/@CMAKE_DOC_DIR@/cmake.org.html", + installer.value("StartMenuDir") + "/CMake Web Site.lnk"); + + component.addOperation("CreateShortcut", + installer.value("TargetDir") + "/cmake-maintenance.exe", + installer.value("StartMenuDir") + "/CMake Maintenance Tool.lnk"); + } + + // Call default implementation + component.createOperations(); +} diff --git a/Source/QtIFW/installscript.qs.in b/Source/QtIFW/installscript.qs.in deleted file mode 100644 index 570dba1..0000000 --- a/Source/QtIFW/installscript.qs.in +++ /dev/null @@ -1,24 +0,0 @@ -function Component() -{ - // default constructor -} - -Component.prototype.createOperations = function() -{ - // call default implementation to actually install applications! - component.createOperations(); - - // Create shortcut - if (installer.value("os") === "win") { - -@_CPACK_IFW_SHORTCUT_OPTIONAL@ - - component.addOperation("CreateShortcut", - installer.value("TargetDir") + "/cmake.org.html", - installer.value("StartMenuDir") + "/CMake Web Site.lnk"); - - component.addOperation("CreateShortcut", - installer.value("TargetDir") + "/cmake-maintenance.exe", - installer.value("StartMenuDir") + "/CMake Maintenance Tool.lnk"); - } -} diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index a755ca1..f2a3727 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -162,6 +162,7 @@ endif() if(SPHINX_HTML) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${CMAKE_DOC_DIR} + COMPONENT sphinx-html PATTERN .buildinfo EXCLUDE ) endif() @@ -169,12 +170,13 @@ endif() if(SPHINX_SINGLEHTML) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/singlehtml DESTINATION ${CMAKE_DOC_DIR} + COMPONENT sphinx-singlehtml PATTERN .buildinfo EXCLUDE ) endif() if(SPHINX_QTHELP) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake-${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}${CMake_VERSION_PATCH}.qch - DESTINATION ${CMAKE_DOC_DIR} + DESTINATION ${CMAKE_DOC_DIR} COMPONENT sphinx-qthelp ) endif() -- cgit v0.12 From 2531b9095491966c7dbcf717a8b6d3dc72c0fb9f Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Mon, 8 Dec 2014 00:30:15 +0300 Subject: CMake: Install COMPONENTs (QtDialog) Added "COMPONENT cmake-gui" for all install commands in lists file --- Source/QtDialog/CMakeLists.txt | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index f3590c4..abd4400 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -47,7 +47,8 @@ if (Qt5Widgets_FOUND) get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) set(_qt_plugin_dest "PlugIns/${_qt_plugin_type}") install(FILES "${_qt_plugin_path}" - DESTINATION "${_qt_plugin_dest}") + DESTINATION "${_qt_plugin_dest}" + COMPONENT cmake-gui) set(${_qt_plugins_var} "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") else() @@ -58,7 +59,8 @@ if (Qt5Widgets_FOUND) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" "[Paths]\nPlugins = PlugIns\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources") + DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" + COMPONENT cmake-gui) endif() if(WIN32 AND TARGET Qt5::Core) @@ -130,7 +132,8 @@ endif() if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL) install(FILES ${CMake_SOURCE_DIR}/Licenses/LGPLv2.1.txt - DESTINATION ${CMAKE_DATA_DIR}/Licenses) + DESTINATION ${CMAKE_DATA_DIR}/Licenses + COMPONENT cmake-gui) set_property(SOURCE CMakeSetupDialog.cxx PROPERTY COMPILE_DEFINITIONS CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL) endif() @@ -163,7 +166,7 @@ if(APPLE) ) endif() set(CMAKE_INSTALL_DESTINATION_ARGS - BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") + BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT cmake-gui) install(TARGETS cmake-gui RUNTIME DESTINATION bin COMPONENT cmake-gui @@ -174,18 +177,25 @@ if(UNIX AND NOT APPLE) install( FILES "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetup${size}.png" DESTINATION "share/icons/hicolor/${size}x${size}/apps" + COMPONENT cmake-gui RENAME "CMakeSetup.png") endforeach () # install a desktop file so CMake appears in the application start menu # with an icon - install(FILES CMake.desktop DESTINATION share/applications ) - install(FILES cmakecache.xml DESTINATION share/mime/packages ) + install(FILES CMake.desktop + DESTINATION share/applications + COMPONENT cmake-gui) + install(FILES cmakecache.xml + DESTINATION share/mime/packages + COMPONENT cmake-gui) endif() if(APPLE) - install(CODE "execute_process(COMMAND ln -s \"../MacOS/CMake\" cmake-gui - WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") + install(CODE " + execute_process(COMMAND ln -s \"../MacOS/CMake\" cmake-gui + WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin) + " COMPONENT cmake-gui) endif() if(APPLE OR WIN32) @@ -199,7 +209,7 @@ if(APPLE OR WIN32) include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\") set(BU_CHMOD_BUNDLE_ITEMS ON) fixup_bundle(\"${fixup_exe}\" \"${QT_PLUGINS}\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\") - ") + " COMPONENT cmake-gui) endif() set(CMAKE_PACKAGE_QTGUI TRUE) -- cgit v0.12 From 7383e4d722809e2460bd4e87ea7fdbef5f64c303 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Wed, 10 Dec 2014 01:13:42 +0300 Subject: CMake: Install COMPONENTs (sphinx-man) Added component sphinx-man --- CMakeCPack.cmake | 3 +++ CMakeCPackOptions.cmake.in | 5 +++++ Utilities/Sphinx/CMakeLists.txt | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index b299e7f..0eda2bd 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -83,6 +83,9 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") 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() diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 07c7017..51ee4db 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -117,6 +117,11 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_COMPONENT_SPHINX-MAN_DISPLAY_NAME "man") + set(CPACK_COMPONENT_SPHINX-MAN_GROUP Documentation) + set(CPACK_IFW_COMPONENT_SPHINX-MAN_NAME "SphinxMan") + set(CPACK_IFW_COMPONENT_SPHINX-MAN_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_COMPONENT_SPHINX-HTML_DISPLAY_NAME "HTML") set(CPACK_COMPONENT_SPHINX-HTML_GROUP Documentation) set(CPACK_IFW_COMPONENT_SPHINX-HTML_NAME "SphinxHTML") diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index f2a3727..a76ee26 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -154,7 +154,8 @@ if(SPHINX_MAN) set(name "${CMAKE_MATCH_1}") set(sec "${CMAKE_MATCH_2}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/${name}.${sec} - DESTINATION ${CMAKE_MAN_DIR}/man${sec}) + DESTINATION ${CMAKE_MAN_DIR}/man${sec} + COMPONENT sphinx-man) endif() endforeach() endif() -- cgit v0.12 From c823f04e0cbc4753cc5b6d5c9f45b9f015a12568 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Fri, 3 Jul 2015 12:58:22 +0300 Subject: CMake: New option CMake_INSTALL_COMPONENTS By default is OFF. Now it's used with CPack IFW himself installer. --- CMakeCPack.cmake | 76 ++++++++++++++++++++++++-------------- CMakeCPackOptions.cmake.in | 46 +++++++++++++++-------- CMakeLists.txt | 12 +++++- Source/CMakeLists.txt | 3 +- Source/CursesDialog/CMakeLists.txt | 3 +- Source/QtDialog/CMakeLists.txt | 21 ++++++----- Source/QtIFW/installscript.qs.in | 24 ++++++++++++ Utilities/Sphinx/CMakeLists.txt | 12 ++++-- 8 files changed, 137 insertions(+), 60 deletions(-) create mode 100644 Source/QtIFW/installscript.qs.in 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) diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 51ee4db..c0e76e2 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -32,6 +32,7 @@ endif() include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL) if(CPACK_GENERATOR MATCHES "IFW") + # Installer configuration set(CPACK_IFW_PACKAGE_TITLE "CMake Build Tool") set(CPACK_IFW_PRODUCT_URL "http://www.cmake.org") @@ -40,17 +41,20 @@ if(CPACK_GENERATOR MATCHES "IFW") "@CMake_SOURCE_DIR@/Source/QtDialog/CMakeSetup128.png") set(CPACK_IFW_PACKAGE_CONTROL_SCRIPT "@CMake_SOURCE_DIR@/Source/QtIFW/controlscript.qs") + # Uninstaller configuration set(CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME "cmake-maintenance") - # Package configuration group - set(CPACK_IFW_PACKAGE_GROUP CMake) - # Components - set(CPACK_COMPONENTS_ALL "@_CPACK_IFW_COMPONENTS_ALL@") - set(CPACK_COMPONENTS_GROUPING IGNORE) + @_CPACK_IFW_COMPONENTS_CONFIGURATION@ # Unspecified set(CPACK_IFW_COMPONENT_@_CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME@_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + + # Package configuration group + set(CPACK_IFW_PACKAGE_GROUP CMake) + # Group configuration + + # CMake set(CPACK_COMPONENT_GROUP_CMAKE_DISPLAY_NAME "@CPACK_PACKAGE_NAME@") set(CPACK_COMPONENT_GROUP_CMAKE_DESCRIPTION @@ -59,32 +63,48 @@ if(CPACK_GENERATOR MATCHES "IFW") "@_CPACK_IFW_PACKAGE_VERSION@") set(CPACK_IFW_COMPONENT_GROUP_CMAKE_LICENSES "@CPACK_PACKAGE_NAME@ Copyright" "@CPACK_RESOURCE_FILE_LICENSE@") - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT "@CMake_BINARY_DIR@/CMake.qs") + set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT "@_CPACK_IFW_PACKAGE_SCRIPT@") set(CPACK_IFW_COMPONENT_GROUP_CMAKE_PRIORITY 100) # Tools set(CPACK_COMPONENT_GROUP_TOOLS_DISPLAY_NAME "Command-Line Tools") + set(CPACK_COMPONENT_GROUP_TOOLS_DESCRIPTION + "Command-Line Tools: cmake, ctest and cpack") set(CPACK_COMPONENT_GROUP_TOOLS_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_TOOLS_PRIORITY 90) set(CPACK_IFW_COMPONENT_GROUP_TOOLS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") set(CPACK_COMPONENT_CMAKE_DISPLAY_NAME "cmake") + set(CPACK_COMPONENT_CMAKE_DESCRIPTION + "The \"cmake\" executable is the CMake command-line interface") + set(CPACK_COMPONENT_CMAKE_REQUIRED TRUE) set(CPACK_COMPONENT_CMAKE_GROUP Tools) set(CPACK_IFW_COMPONENT_CMAKE_NAME "CMake") + set(CPACK_IFW_COMPONENT_CMAKE_PRIORITY 89) set(CPACK_IFW_COMPONENT_CMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") set(CPACK_COMPONENT_CTEST_DISPLAY_NAME "ctest") + set(CPACK_COMPONENT_CTEST_DESCRIPTION + "The \"ctest\" executable is the CMake test driver program") + set(CPACK_COMPONENT_CTEST_REQUIRED TRUE) set(CPACK_COMPONENT_CTEST_GROUP Tools) set(CPACK_IFW_COMPONENT_CTEST_NAME "CTest") + set(CPACK_IFW_COMPONENT_CTEST_PRIORITY 88) set(CPACK_IFW_COMPONENT_CTEST_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") set(CPACK_COMPONENT_CPACK_DISPLAY_NAME "cpack") + set(CPACK_COMPONENT_CPACK_DESCRIPTION + "The \"cpack\" executable is the CMake packaging program") + set(CPACK_COMPONENT_CPACK_REQUIRED TRUE) set(CPACK_COMPONENT_CPACK_GROUP Tools) set(CPACK_IFW_COMPONENT_CPACK_NAME "CPack") + set(CPACK_IFW_COMPONENT_CPACK_PRIORITY 87) set(CPACK_IFW_COMPONENT_CPACK_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") # Dialogs set(CPACK_COMPONENT_GROUP_DIALOGS_DISPLAY_NAME "Interactive Dialogs") + set(CPACK_COMPONENT_GROUP_DIALOGS_DESCRIPTION + "Interactive Dialogs with Console and GUI interfaces") set(CPACK_COMPONENT_GROUP_DIALOGS_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_PRIORITY 80) set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") @@ -101,17 +121,10 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_IFW_COMPONENT_CCMAKE_NAME "CursesGUI") set(CPACK_IFW_COMPONENT_CCMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") - # Data - set(CPACK_COMPONENT_DATA_DISPLAY_NAME "Data") - set(CPACK_COMPONENT_DATA_DESCRIPTION - "CMake data files (help, modules and templates)") - set(CPACK_COMPONENT_DATA_GROUP CMake) - set(CPACK_IFW_COMPONENT_DATA_PRIORITY 70) - set(CPACK_IFW_COMPONENT_DATA_NAME "Data") - set(CPACK_IFW_COMPONENT_DATA_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") - # Documentation set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DISPLAY_NAME "Documentation") + set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION + "CMake Documentation in different formats (html, man, qch)") set(CPACK_COMPONENT_GROUP_DOCUMENTATION_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_PRIORITY 60) set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_VERSION @@ -119,6 +132,7 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_SPHINX-MAN_DISPLAY_NAME "man") set(CPACK_COMPONENT_SPHINX-MAN_GROUP Documentation) + set(CPACK_COMPONENT_SPHINX-MAN_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-MAN_NAME "SphinxMan") set(CPACK_IFW_COMPONENT_SPHINX-MAN_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") @@ -131,12 +145,14 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISPLAY_NAME "Single HTML") set(CPACK_COMPONENT_SPHINX-SINGLEHTML_GROUP Documentation) + set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_NAME "SphinxSingleHTML") set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") set(CPACK_COMPONENT_SPHINX-QTHELP_DISPLAY_NAME "Qt Compressed Help") set(CPACK_COMPONENT_SPHINX-QTHELP_GROUP Documentation) + set(CPACK_COMPONENT_SPHINX-QTHELP_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_NAME "SphinxQtHelp") set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c40a1a..5e94028 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,17 @@ if(CMAKE_ENCODING_UTF8) set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) endif() +# option to use COMPONENT with install command +option(CMake_INSTALL_COMPONENTS "Using components when installing" OFF) +mark_as_advanced(CMake_INSTALL_COMPONENTS) +macro(CMake_OPTIONAL_COMPONENT NAME) + if(CMake_INSTALL_COMPONENTS) + set(COMPONENT COMPONENT ${NAME}) + else() + set(COMPONENT) + endif() +endmacro() + #----------------------------------------------------------------------- # a macro to deal with system libraries, implemented as a macro # simply to improve readability of the main script @@ -652,7 +663,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT data PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 83d3090..aa3f675 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -743,7 +743,8 @@ if(APPLE) endif() foreach(_tool ${_tools}) - install(TARGETS ${_tool} DESTINATION bin COMPONENT ${_tool}) + CMake_OPTIONAL_COMPONENT(${_tool}) + install(TARGETS ${_tool} DESTINATION bin ${COMPONENT}) endforeach() install(FILES cmCPluginAPI.h DESTINATION ${CMAKE_DATA_DIR}/include) diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 14eb46c..93ff425 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -47,4 +47,5 @@ else() target_link_libraries(ccmake cmForm) endif() -install(TARGETS ccmake DESTINATION bin COMPONENT ccmake) +CMake_OPTIONAL_COMPONENT(ccmake) +install(TARGETS ccmake DESTINATION bin ${COMPONENT}) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index abd4400..038c411 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -14,6 +14,7 @@ project(QtDialog) if(POLICY CMP0020) cmake_policy(SET CMP0020 NEW) # Drop when CMake >= 2.8.11 required endif() +CMake_OPTIONAL_COMPONENT(cmake-gui) find_package(Qt5Widgets QUIET) if (Qt5Widgets_FOUND) include_directories(${Qt5Widgets_INCLUDE_DIRS}) @@ -48,7 +49,7 @@ if (Qt5Widgets_FOUND) set(_qt_plugin_dest "PlugIns/${_qt_plugin_type}") install(FILES "${_qt_plugin_path}" DESTINATION "${_qt_plugin_dest}" - COMPONENT cmake-gui) + ${COMPONENT}) set(${_qt_plugins_var} "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") else() @@ -60,7 +61,7 @@ if (Qt5Widgets_FOUND) "[Paths]\nPlugins = PlugIns\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" - COMPONENT cmake-gui) + ${COMPONENT}) endif() if(WIN32 AND TARGET Qt5::Core) @@ -133,7 +134,7 @@ endif() if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL) install(FILES ${CMake_SOURCE_DIR}/Licenses/LGPLv2.1.txt DESTINATION ${CMAKE_DATA_DIR}/Licenses - COMPONENT cmake-gui) + ${COMPONENT}) set_property(SOURCE CMakeSetupDialog.cxx PROPERTY COMPILE_DEFINITIONS CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL) endif() @@ -166,10 +167,10 @@ if(APPLE) ) endif() set(CMAKE_INSTALL_DESTINATION_ARGS - BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT cmake-gui) + BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" ${COMPONENT}) install(TARGETS cmake-gui - RUNTIME DESTINATION bin COMPONENT cmake-gui + RUNTIME DESTINATION bin ${COMPONENT} ${CMAKE_INSTALL_DESTINATION_ARGS}) if(UNIX AND NOT APPLE) @@ -177,7 +178,7 @@ if(UNIX AND NOT APPLE) install( FILES "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetup${size}.png" DESTINATION "share/icons/hicolor/${size}x${size}/apps" - COMPONENT cmake-gui + ${COMPONENT} RENAME "CMakeSetup.png") endforeach () @@ -185,17 +186,17 @@ if(UNIX AND NOT APPLE) # with an icon install(FILES CMake.desktop DESTINATION share/applications - COMPONENT cmake-gui) + ${COMPONENT}) install(FILES cmakecache.xml DESTINATION share/mime/packages - COMPONENT cmake-gui) + ${COMPONENT}) endif() if(APPLE) install(CODE " execute_process(COMMAND ln -s \"../MacOS/CMake\" cmake-gui WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin) - " COMPONENT cmake-gui) + " ${COMPONENT}) endif() if(APPLE OR WIN32) @@ -209,7 +210,7 @@ if(APPLE OR WIN32) include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\") set(BU_CHMOD_BUNDLE_ITEMS ON) fixup_bundle(\"${fixup_exe}\" \"${QT_PLUGINS}\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\") - " COMPONENT cmake-gui) + " ${COMPONENT}) endif() set(CMAKE_PACKAGE_QTGUI TRUE) diff --git a/Source/QtIFW/installscript.qs.in b/Source/QtIFW/installscript.qs.in new file mode 100644 index 0000000..570dba1 --- /dev/null +++ b/Source/QtIFW/installscript.qs.in @@ -0,0 +1,24 @@ +function Component() +{ + // default constructor +} + +Component.prototype.createOperations = function() +{ + // call default implementation to actually install applications! + component.createOperations(); + + // Create shortcut + if (installer.value("os") === "win") { + +@_CPACK_IFW_SHORTCUT_OPTIONAL@ + + component.addOperation("CreateShortcut", + installer.value("TargetDir") + "/cmake.org.html", + installer.value("StartMenuDir") + "/CMake Web Site.lnk"); + + component.addOperation("CreateShortcut", + installer.value("TargetDir") + "/cmake-maintenance.exe", + installer.value("StartMenuDir") + "/CMake Maintenance Tool.lnk"); + } +} diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index a76ee26..77a1255 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -153,31 +153,35 @@ if(SPHINX_MAN) if("x${m}" MATCHES "^x(.+)\\.([1-9])\\.rst$") set(name "${CMAKE_MATCH_1}") set(sec "${CMAKE_MATCH_2}") + CMake_OPTIONAL_COMPONENT(sphinx-man) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/${name}.${sec} DESTINATION ${CMAKE_MAN_DIR}/man${sec} - COMPONENT sphinx-man) + ${COMPONENT}) endif() endforeach() endif() if(SPHINX_HTML) + CMake_OPTIONAL_COMPONENT(sphinx-html) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${CMAKE_DOC_DIR} - COMPONENT sphinx-html + ${COMPONENT} PATTERN .buildinfo EXCLUDE ) endif() if(SPHINX_SINGLEHTML) + CMake_OPTIONAL_COMPONENT(sphinx-singlehtml) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/singlehtml DESTINATION ${CMAKE_DOC_DIR} - COMPONENT sphinx-singlehtml + ${COMPONENT} PATTERN .buildinfo EXCLUDE ) endif() if(SPHINX_QTHELP) + CMake_OPTIONAL_COMPONENT(sphinx-qthelp) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake-${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}${CMake_VERSION_PATCH}.qch - DESTINATION ${CMAKE_DOC_DIR} COMPONENT sphinx-qthelp + DESTINATION ${CMAKE_DOC_DIR} ${COMPONENT} ) endif() -- cgit v0.12 From c14f20f7dd827bd1b9164b3641db697776de85bf Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Fri, 3 Jul 2015 14:05:40 +0300 Subject: CMake: Fix Web Site shortcut in IFW installer for Windows --- Source/QtIFW/installscript.qs.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/QtIFW/installscript.qs.in b/Source/QtIFW/installscript.qs.in index 570dba1..3411e34 100644 --- a/Source/QtIFW/installscript.qs.in +++ b/Source/QtIFW/installscript.qs.in @@ -5,20 +5,20 @@ function Component() Component.prototype.createOperations = function() { - // call default implementation to actually install applications! - component.createOperations(); - // Create shortcut if (installer.value("os") === "win") { @_CPACK_IFW_SHORTCUT_OPTIONAL@ component.addOperation("CreateShortcut", - installer.value("TargetDir") + "/cmake.org.html", + installer.value("TargetDir") + "/@CMAKE_DOC_DIR@/cmake.org.html", installer.value("StartMenuDir") + "/CMake Web Site.lnk"); component.addOperation("CreateShortcut", installer.value("TargetDir") + "/cmake-maintenance.exe", installer.value("StartMenuDir") + "/CMake Maintenance Tool.lnk"); } + + // Call default implementation + component.createOperations(); } -- cgit v0.12 From ecca26855a786bb126341e7fba59557325e54f7b Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Fri, 3 Jul 2015 14:50:27 +0300 Subject: CMake: optional show LGPLv2.1 license when install cmake-gui component In IFW installer if cmake-gui component selected and CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL enabled license will be showed. --- CMakeCPack.cmake | 7 +++++++ CMakeCPackOptions.cmake.in | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index d7c6024..54816ec 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -82,6 +82,8 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") endif() if(BUILD_QtDialog) list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-gui) + set(_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES "set(CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES + \"LGPLv2.1\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv2.1.txt\")") endif() if(SPHINX_MAN) list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-man) @@ -100,6 +102,11 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\") set(CPACK_COMPONENTS_GROUPING IGNORE) ") + else() + if(BUILD_QtDialog AND CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL) + set(_CPACK_IFW_ADDITIONAL_LICENSES + "\"LGPLv2.1\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv2.1.txt\"") + endif() endif() # Components scripts configuration diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index c0e76e2..7beda8c 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -62,7 +62,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_IFW_COMPONENT_GROUP_CMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") set(CPACK_IFW_COMPONENT_GROUP_CMAKE_LICENSES - "@CPACK_PACKAGE_NAME@ Copyright" "@CPACK_RESOURCE_FILE_LICENSE@") + "@CPACK_PACKAGE_NAME@ Copyright" "@CPACK_RESOURCE_FILE_LICENSE@" + @_CPACK_IFW_ADDITIONAL_LICENSES@) set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT "@_CPACK_IFW_PACKAGE_SCRIPT@") set(CPACK_IFW_COMPONENT_GROUP_CMAKE_PRIORITY 100) @@ -115,6 +116,7 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_IFW_COMPONENT_CMAKE-GUI_SCRIPT "@CMake_SOURCE_DIR@/Source/QtIFW/CMake.Dialogs.QtGUI.qs") set(CPACK_IFW_COMPONENT_CMAKE-GUI_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + @_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES@ set(CPACK_COMPONENT_CCMAKE_DISPLAY_NAME "ccmake") set(CPACK_COMPONENT_CCMAKE_GROUP Dialogs) -- cgit v0.12 From d7725a178bd498f7b50634490b6846ab9bb245f2 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Tue, 7 Jul 2015 09:28:25 +0300 Subject: CMake: Add cmakexbuild component as REQUIRED to Tools group for IFW installer --- CMakeCPack.cmake | 3 +++ CMakeCPackOptions.cmake.in | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index 54816ec..ce10ad0 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -68,6 +68,9 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") # Components if(CMake_INSTALL_COMPONENTS) set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack) + if(APPLE) + list(APPEND _CPACK_IFW_COMPONENTS_ALL cmakexbuild) + endif() if(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 7beda8c..a1e425a 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -102,6 +102,15 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_IFW_COMPONENT_CPACK_PRIORITY 87) set(CPACK_IFW_COMPONENT_CPACK_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_COMPONENT_CMAKEXBUILD_DISPLAY_NAME "cmakexbuild") + set(CPACK_COMPONENT_CMAKEXBUILD_DESCRIPTION + "The \"cmakexbuild\" executable is a wrapper program for \"xcodebuild\"") + set(CPACK_COMPONENT_CMAKEXBUILD_REQUIRED TRUE) + set(CPACK_COMPONENT_CMAKEXBUILD_GROUP Tools) + set(CPACK_IFW_COMPONENT_CMAKEXBUILD_NAME "CMakeXBuild") + set(CPACK_IFW_COMPONENT_CMAKEXBUILD_PRIORITY 86) + set(CPACK_IFW_COMPONENT_CMAKEXBUILD_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + # Dialogs set(CPACK_COMPONENT_GROUP_DIALOGS_DISPLAY_NAME "Interactive Dialogs") set(CPACK_COMPONENT_GROUP_DIALOGS_DESCRIPTION -- cgit v0.12 From 9ce7a663d6d50c6f2d7a3fbc76ed10c5af6a91a5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 7 Jul 2015 09:38:48 -0400 Subject: Utilities/Sphinx: Add CMake_OPTIONAL_COMPONENT macro When building this directory independently define the macro since we will not get the definition from the top level of the source tree. --- Utilities/Sphinx/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 77a1255..1baca35 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -19,6 +19,9 @@ if(NOT CMake_SOURCE_DIR) include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake) unset(CMAKE_DATA_DIR) unset(CMAKE_DATA_DIR CACHE) + macro(CMake_OPTIONAL_COMPONENT) + set(COMPONENT "") + endmacro() endif() project(CMakeHelp NONE) -- cgit v0.12