diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CPackDMG.cmake | 2 | ||||
-rw-r--r-- | Modules/CPackDeb.cmake | 106 | ||||
-rw-r--r-- | Modules/CPackIFW.cmake | 53 | ||||
-rw-r--r-- | Modules/ExternalProject.cmake | 2 |
4 files changed, 119 insertions, 44 deletions
diff --git a/Modules/CPackDMG.cmake b/Modules/CPackDMG.cmake index e34f8cd..1959f22 100644 --- a/Modules/CPackDMG.cmake +++ b/Modules/CPackDMG.cmake @@ -19,7 +19,7 @@ # # The disk image format. Common values are UDRO (UDIF read-only), UDZO (UDIF # zlib-compressed) or UDBZ (UDIF bzip2-compressed). Refer to hdiutil(1) for -# more information on other available formats. +# more information on other available formats. Defaults to UDZO. # # .. variable:: CPACK_DMG_DS_STORE # diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index d93d924..ebeb387 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -42,6 +42,32 @@ # # See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source # +# .. variable:: CPACK_DEBIAN_FILE_NAME +# CPACK_DEBIAN_<COMPONENT>_FILE_NAME +# +# Package file name. +# +# * Mandatory : YES +# * Default : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].deb`` +# +# This may be set to ``DEB-DEFAULT`` to allow CPackDeb to generate package file +# name by itself in deb format:: +# +# <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb +# +# Alternatively provided package file name must end with ".deb" suffix. +# +# .. note:: +# +# Preferred setting of this variable is ``DEB-DEFAULT`` but for backward +# compatibility with CPackDeb in CMake prior to version 3.6 this feature +# is disabled by default. +# +# .. note:: +# +# By using non default filenames duplicate names may occur. Duplicate files +# get overwritten and it is up to the packager to set the variables in a +# manner that will prevent such errors. # # .. variable:: CPACK_DEBIAN_PACKAGE_VERSION # @@ -100,6 +126,13 @@ # # set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)") # +# .. variable:: CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS +# +# Sets inter component dependencies if listed with +# :variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables. +# +# * Mandatory : NO +# * Default : - # # .. variable:: CPACK_DEBIAN_PACKAGE_MAINTAINER # @@ -466,6 +499,17 @@ if(NOT UNIX) message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.") endif() +function(cpack_deb_variable_fallback OUTPUT_VAR_NAME) + set(FALLBACK_VAR_NAMES ${ARGN}) + + foreach(variable_name IN LISTS FALLBACK_VAR_NAMES) + if(${variable_name}) + set(${OUTPUT_VAR_NAME} "${${variable_name}}" PARENT_SCOPE) + break() + endif() + endforeach() +endfunction() + function(get_component_package_name var component) string(TOUPPER "${component}" component_upcase) if(CPACK_DEBIAN_${component_upcase}_PACKAGE_NAME) @@ -713,20 +757,23 @@ function(cpack_deb_prepare_package_vars) endif() endif() endforeach() - set(COMPONENT_DEPENDS "") - foreach (_PACK ${CPACK_COMPONENT_${_local_component_name}_DEPENDS}) - get_component_package_name(_PACK_NAME "${_PACK}") + + if(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS) + set(COMPONENT_DEPENDS "") + foreach (_PACK ${CPACK_COMPONENT_${_local_component_name}_DEPENDS}) + get_component_package_name(_PACK_NAME "${_PACK}") + if(COMPONENT_DEPENDS) + set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION}), ${COMPONENT_DEPENDS}") + else() + set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION})") + endif() + endforeach() if(COMPONENT_DEPENDS) - set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION}), ${COMPONENT_DEPENDS}") - else() - set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION})") - endif() - endforeach() - if(COMPONENT_DEPENDS) - if(CPACK_DEBIAN_PACKAGE_DEPENDS) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}") - else() - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}") + if(CPACK_DEBIAN_PACKAGE_DEPENDS) + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}") + else() + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}") + endif() endif() endif() endif() @@ -878,13 +925,32 @@ function(cpack_deb_prepare_package_vars) set(CPACK_DEBIAN_PACKAGE_RELEASE 1) endif() - # Patch package file name to be in corrent debian format: - # <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb - set(CPACK_OUTPUT_FILE_NAME - "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") - set(CPACK_TEMPORARY_PACKAGE_FILE_NAME "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_OUTPUT_FILE_NAME}") - get_filename_component(BINARY_DIR "${CPACK_OUTPUT_FILE_PATH}" DIRECTORY) - set(CPACK_OUTPUT_FILE_PATH "${BINARY_DIR}/${CPACK_OUTPUT_FILE_NAME}") + + cpack_deb_variable_fallback("CPACK_DEBIAN_FILE_NAME" + "CPACK_DEBIAN_${_local_component_name}_FILE_NAME" + "CPACK_DEBIAN_FILE_NAME") + if(CPACK_DEBIAN_FILE_NAME) + if(CPACK_DEBIAN_FILE_NAME STREQUAL "DEB-DEFAULT") + # Patch package file name to be in corrent debian format: + # <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb + set(CPACK_OUTPUT_FILE_NAME + "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") + else() + cmake_policy(PUSH) + cmake_policy(SET CMP0010 NEW) + if(NOT CPACK_DEBIAN_FILE_NAME MATCHES ".*\\.deb") + cmake_policy(POP) + message(FATAL_ERROR "'${CPACK_DEBIAN_FILE_NAME}' is not a valid DEB package file name as it must end with '.deb'!") + endif() + cmake_policy(POP) + + set(CPACK_OUTPUT_FILE_NAME "${CPACK_DEBIAN_FILE_NAME}") + endif() + + set(CPACK_TEMPORARY_PACKAGE_FILE_NAME "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_OUTPUT_FILE_NAME}") + get_filename_component(BINARY_DIR "${CPACK_OUTPUT_FILE_PATH}" DIRECTORY) + set(CPACK_OUTPUT_FILE_PATH "${BINARY_DIR}/${CPACK_OUTPUT_FILE_NAME}") + endif() # else() back compatibility - don't change the name # Print out some debug information if we were asked for that if(CPACK_DEBIAN_PACKAGE_DEBUG) diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 4cfc9d2..083fc28 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -4,8 +4,8 @@ # # .. _QtIFW: http://doc.qt.io/qtinstallerframework/index.html # -# This module looks for the location of the command line utilities supplied with -# the Qt Installer Framework (QtIFW_). +# This module looks for the location of the command line utilities supplied +# with the Qt Installer Framework (QtIFW_). # # The module also defines several commands to control the behavior of the # CPack ``IFW`` generator. @@ -31,7 +31,8 @@ # Variables # ^^^^^^^^^ # -# You can use the following variables to change behavior of CPack ``IFW`` generator. +# You can use the following variables to change behavior of CPack ``IFW`` +# generator. # # Debug # """""" @@ -65,7 +66,8 @@ # # .. variable:: CPACK_IFW_PACKAGE_WINDOW_ICON # -# Filename for a custom window icon in PNG format for the Installer application. +# Filename for a custom window icon in PNG format for the Installer +# application. # # .. variable:: CPACK_IFW_PACKAGE_LOGO # @@ -80,7 +82,8 @@ # .. variable:: CPACK_IFW_TARGET_DIRECTORY # # Default target directory for installation. -# By default used "@ApplicationsDir@/:variable:`CPACK_PACKAGE_INSTALL_DIRECTORY`" +# By default used +# "@ApplicationsDir@/:variable:`CPACK_PACKAGE_INSTALL_DIRECTORY`" # # You can use predefined variables. # @@ -186,7 +189,7 @@ # # :: # -# cpack_ifw_configure_component(<compname> [COMMON] +# cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL] # [NAME <name>] # [VERSION <version>] # [SCRIPT <script>] @@ -194,20 +197,23 @@ # [DEPENDS <com_id> ...] # [LICENSES <display_name> <file_path> ...]) # -# This command should be called after cpack_add_component command. +# This command should be called after :command:`cpack_add_component` command. # # ``COMMON`` if set, then the component will be packaged and installed as part # of a group to which it belongs. # +# ``ESSENTIAL`` if set, then the package manager stays disabled until that +# component is updated. +# +# ``NAME`` is used to create domain-like identification for this component. +# By default used origin component name. +# # ``VERSION`` is version of component. # By default used :variable:`CPACK_PACKAGE_VERSION`. # # ``SCRIPT`` is a relative or absolute path to operations script # for this component. # -# ``NAME`` is used to create domain-like identification for this component. -# By default used origin component name. -# # ``PRIORITY`` is priority of the component in the tree. # # ``DEPENDS`` list of dependency component identifiers in QtIFW_ style. @@ -223,21 +229,23 @@ # # :: # -# cpack_ifw_configure_component_group(<grpname> -# [VERSION <version>] +# cpack_ifw_configure_component_group(<groupname> # [NAME <name>] +# [VERSION <version>] # [SCRIPT <script>] # [PRIORITY <priority>] # [LICENSES <display_name> <file_path> ...]) # -# This command should be called after cpack_add_component_group command. +# This command should be called after :command:`cpack_add_component_group` +# command. +# +# ``NAME`` is used to create domain-like identification for this component +# group. +# By default used origin component group name. # # ``VERSION`` is version of component group. # By default used :variable:`CPACK_PACKAGE_VERSION`. # -# ``NAME`` is used to create domain-like identification for this component group. -# By default used origin component group name. -# # ``SCRIPT`` is a relative or absolute path to operations script # for this component group. # @@ -260,8 +268,8 @@ # [PASSWORD <password>] # [DISPLAY_NAME <display_name>]) # -# This macro will also add the <reponame> repository -# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL` +# This command will also add the <reponame> repository +# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`. # # ``DISABLED`` if set, then the repository will be disabled by default. # @@ -289,9 +297,8 @@ # [PASSWORD <password>] # [DISPLAY_NAME <display_name>]) # -# Specified will -# This macro will also add the repository action -# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL` +# This command will also add the <reponame> repository +# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`. # # ``URL`` is points to a list of available components. # @@ -541,8 +548,8 @@ macro(cpack_ifw_configure_component compname) string(TOUPPER ${compname} _CPACK_IFWCOMP_UNAME) - set(_IFW_OPT COMMON) - set(_IFW_ARGS VERSION SCRIPT NAME PRIORITY) + set(_IFW_OPT COMMON ESSENTIAL) + set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY) set(_IFW_MULTI_ARGS DEPENDS LICENSES) cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN}) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index ad6de18..2ff18fc 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2021,6 +2021,8 @@ function(_ep_add_update_command name) --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args}) set(always 1) elseif(git_repository) + unset(CMAKE_MODULE_PATH) # Use CMake builtin find module + find_package(Git QUIET) if(NOT GIT_EXECUTABLE) message(FATAL_ERROR "error: could not find git for fetch of ${name}") endif() |