Commit d07d24b8 authored by Konstantin Podsvirov's avatar Konstantin Podsvirov

QtIFW: Configurable root component

parent afe7d5f2
Pipeline #36627 passed with stage
......@@ -54,6 +54,47 @@ if(${CPACK_SYSTEM_NAME} MATCHES Windows)
endif()
endif()
# Advanced IFW configuration
set(_cpifwrc CPACK_IFW_COMPONENT_GROUP_CMAKE_)
set(_cpifwrcconf _CPACK_IFW_COMPONENT_GROUP_CMAKE)
set(${_cpifwrcconf} "# CMake IFW configuration\n")
macro(_cmifwarg DESCRIPTION TYPE NAME DEFAULT)
set(_var CMake_IFW_ROOT_COMPONENT_${NAME})
if(DEFINED ${_var})
set(${_var} ${${_var}} CACHE ${TYPE} ${DESCRIPTION})
mark_as_advanced(${_var})
elseif(NOT "${DEFAULT}" STREQUAL "")
set(${_var} ${DEFAULT})
endif()
if(DEFINED ${_var})
set(${_cpifwrcconf}
"${${_cpifwrcconf}} set(${_cpifwrc}${NAME}\n \"${${_var}}\")\n")
endif()
endmacro()
_cmifwarg("Package <Name> tag (domen-like)"
STRING NAME "")
_cmifwarg("Package <DisplayName> tag"
STRING DISPLAY_NAME "")
_cmifwarg("Package <Description> tag"
STRING DESCRIPTION "")
_cmifwarg("Package <ReleaseDate> tag (keep empty to auto generate)"
STRING RELEASE_DATE "")
_cmifwarg("Package <Default> tag (values: TRUE, FALSE, SCRIPT)"
STRING DEFAULT "")
_cmifwarg("Package <Version> tag"
STRING VERSION
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
_cmifwarg("Package <Script> tag"
FILEPATH SCRIPT "${CMake_BINARY_DIR}/installscript.qs")
_cmifwarg("Package <SortingPriority> tag"
STRING PRIORITY "100")
_cmifwarg("Package <ForsedInstallation> tag"
STRING FORCED_INSTALLATION "")
set(${_cpifwrc}LICENSES_DEFAULT
"${CPACK_PACKAGE_NAME} Copyright;${CPACK_RESOURCE_FILE_LICENSE}")
# Components
if(CMake_INSTALL_COMPONENTS)
set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack)
......@@ -103,20 +144,31 @@ if(CMake_INSTALL_COMPONENTS)
endif()
endif()
set(_CPACK_IFW_COMPONENTS_CONFIGURATION "
# Components
set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\")
set(CPACK_COMPONENTS_GROUPING IGNORE)
")
# Components
set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\")
set(CPACK_COMPONENTS_GROUPING IGNORE)
")
else()
if(BUILD_QtDialog AND USE_LGPL)
set(_CPACK_IFW_ADDITIONAL_LICENSES
"\"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\"")
set(${_cpifwrc}LICENSES_DEFAULT
"${${_cpifwrc}LICENSES_DEFAULT};LGPLv${USE_LGPL};${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt")
endif()
endif()
_cmifwarg("Package <Licenses> tag (pairs of <display_name> <file_path>)"
STRING LICENSES "${${_cpifwrc}LICENSES_DEFAULT}")
# Components scripts configuration
if(CMake_INSTALL_COMPONENTS)
configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/CMake.qs.in"
"${CMake_BINARY_DIR}/installscript.qs" @ONLY
)
else()
configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in"
"${CMake_BINARY_DIR}/installscript.qs" @ONLY
)
endif()
foreach(_script
CMake
CMake.Documentation.SphinxHTML
CMake.DeveloperReference.HTML)
configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/${_script}.qs.in"
......@@ -137,17 +189,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/developer-reference/html/index.html\", \"@StartMenuDir@/CMake Developer Reference.lnk\");\n")
endif()
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)
......@@ -155,8 +199,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES Linux)
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
......
......@@ -47,7 +47,7 @@ if(CPACK_GENERATOR MATCHES "IFW")
@_CPACK_IFW_COMPONENTS_CONFIGURATION@
# Unspecified
set(CPACK_IFW_COMPONENT_@_CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME@_VERSION
"@_CPACK_IFW_PACKAGE_VERSION@")
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
# Package configuration group
set(CPACK_IFW_PACKAGE_GROUP CMake)
......@@ -59,13 +59,7 @@ if(CPACK_GENERATOR MATCHES "IFW")
"@CPACK_PACKAGE_NAME@")
set(CPACK_COMPONENT_GROUP_CMAKE_DESCRIPTION
"@CPACK_PACKAGE_DESCRIPTION_SUMMARY@")
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_ADDITIONAL_LICENSES@)
set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT "@_CPACK_IFW_PACKAGE_SCRIPT@")
set(CPACK_IFW_COMPONENT_GROUP_CMAKE_PRIORITY 100)
@_CPACK_IFW_COMPONENT_GROUP_CMAKE@
# Tools
set(CPACK_COMPONENT_GROUP_TOOLS_DISPLAY_NAME "Command-Line Tools")
......@@ -73,7 +67,8 @@ if(CPACK_GENERATOR MATCHES "IFW")
"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_IFW_COMPONENT_GROUP_TOOLS_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMAKE_DISPLAY_NAME "cmake")
set(CPACK_COMPONENT_CMAKE_DESCRIPTION
......@@ -82,7 +77,8 @@ if(CPACK_GENERATOR MATCHES "IFW")
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_IFW_COMPONENT_CMAKE_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CTEST_DISPLAY_NAME "ctest")
set(CPACK_COMPONENT_CTEST_DESCRIPTION
......@@ -91,7 +87,8 @@ if(CPACK_GENERATOR MATCHES "IFW")
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_IFW_COMPONENT_CTEST_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CPACK_DISPLAY_NAME "cpack")
set(CPACK_COMPONENT_CPACK_DESCRIPTION
......@@ -100,7 +97,8 @@ if(CPACK_GENERATOR MATCHES "IFW")
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@")
set(CPACK_IFW_COMPONENT_CPACK_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMCLDEPS_DISPLAY_NAME "cmcldeps")
set(CPACK_COMPONENT_CMCLDEPS_DESCRIPTION
......@@ -108,7 +106,8 @@ if(CPACK_GENERATOR MATCHES "IFW")
set(CPACK_COMPONENT_CMCLDEPS_GROUP Tools)
set(CPACK_IFW_COMPONENT_CMCLDEPS_NAME "CMClDeps")
set(CPACK_IFW_COMPONENT_CMCLDEPS_PRIORITY 86)
set(CPACK_IFW_COMPONENT_CMCLDEPS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
set(CPACK_IFW_COMPONENT_CMCLDEPS_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMAKEXBUILD_DISPLAY_NAME "cmakexbuild")
set(CPACK_COMPONENT_CMAKEXBUILD_DESCRIPTION
......@@ -117,7 +116,8 @@ if(CPACK_GENERATOR MATCHES "IFW")
set(CPACK_COMPONENT_CMAKEXBUILD_GROUP Tools)
set(CPACK_IFW_COMPONENT_CMAKEXBUILD_NAME "CMakeXBuild")
set(CPACK_IFW_COMPONENT_CMAKEXBUILD_PRIORITY 85)
set(CPACK_IFW_COMPONENT_CMAKEXBUILD_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
set(CPACK_IFW_COMPONENT_CMAKEXBUILD_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
# Dialogs
set(CPACK_COMPONENT_GROUP_DIALOGS_DISPLAY_NAME "Interactive Dialogs")
......@@ -125,20 +125,23 @@ if(CPACK_GENERATOR MATCHES "IFW")
"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@")
set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_VERSION
"@CMake_IFW_ROOT_COMPONENT_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_IFW_COMPONENT_CMAKE-GUI_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
@_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES@
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@")
set(CPACK_IFW_COMPONENT_CCMAKE_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
# Documentation
set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DISPLAY_NAME "Documentation")
......@@ -147,33 +150,36 @@ if(CPACK_GENERATOR MATCHES "IFW")
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@")
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
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@")
set(CPACK_IFW_COMPONENT_SPHINX-MAN_VERSION
"@CMake_IFW_ROOT_COMPONENT_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_IFW_COMPONENT_SPHINX-HTML_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
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@")
"@CMake_IFW_ROOT_COMPONENT_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@")
set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
# Developer Reference
set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_DISPLAY_NAME "Developer Reference")
......@@ -182,7 +188,7 @@ if(CPACK_GENERATOR MATCHES "IFW")
set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_PARENT_GROUP CMake)
set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_PRIORITY 50)
set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_VERSION
"@_CPACK_IFW_PACKAGE_VERSION@")
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_DISPLAY_NAME "HTML")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_GROUP DeveloperReference)
......@@ -190,13 +196,15 @@ if(CPACK_GENERATOR MATCHES "IFW")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_NAME "HTML")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_SCRIPT
"@CMake_BINARY_DIR@/CMake.DeveloperReference.HTML.qs")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISPLAY_NAME "Qt Compressed Help")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_GROUP DeveloperReference)
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISABLED TRUE)
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_NAME "QtHelp")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment