diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2016-05-17 14:00:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-18 13:49:14 (GMT) |
commit | 41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee (patch) | |
tree | 07b7d562e9896dc36de8a79dffb5a80290b560ab /Modules/CPackIFW.cmake | |
parent | 6ca6b0dd7b1f4bb7429cbe039101558c58f3ea27 (diff) | |
download | CMake-41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee.zip CMake-41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee.tar.gz CMake-41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee.tar.bz2 |
CPackIFW: Add support for Promoting Updates
Add support for this feature added by QtIFW 2.0.3:
http://doc.qt.io/qtinstallerframework/ifw-updates.html
Add a `cpack_ifw_update_repository` command as porcelain.
Diffstat (limited to 'Modules/CPackIFW.cmake')
-rw-r--r-- | Modules/CPackIFW.cmake | 83 |
1 files changed, 82 insertions, 1 deletions
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index c089347..4cfc9d2 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -134,6 +134,7 @@ # # The default value of this variable is computed by CPack and contains # all repositories added with command :command:`cpack_ifw_add_repository` +# or updated with command :command:`cpack_ifw_update_repository`. # # .. variable:: CPACK_IFW_DOWNLOAD_ALL # @@ -249,7 +250,7 @@ # # .. command:: cpack_ifw_add_repository # -# Add QtIFW_ specific remote repository. +# Add QtIFW_ specific remote repository to binary installer. # # :: # @@ -272,6 +273,38 @@ # # ``DISPLAY_NAME`` is string to display instead of the URL. # +# +# -------------------------------------------------------------------------- +# +# .. command:: cpack_ifw_update_repository +# +# Update QtIFW_ specific repository from remote repository. +# +# :: +# +# cpack_ifw_update_repository(<reponame> +# [[ADD|REMOVE] URL <url>]| +# [REPLACE OLD_URL <old_url> NEW_URL <new_url>]] +# [USERNAME <username>] +# [PASSWORD <password>] +# [DISPLAY_NAME <display_name>]) +# +# Specified will +# This macro will also add the repository action +# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL` +# +# ``URL`` is points to a list of available components. +# +# ``OLD_URL`` is points to a list that will replaced. +# +# ``NEW_URL`` is points to a list that will replace to. +# +# ``USERNAME`` is used as user on a protected repository. +# +# ``PASSWORD`` is password to use on a protected repository. +# +# ``DISPLAY_NAME`` is string to display instead of the URL. +# # Example usage # ^^^^^^^^^^^^^ # @@ -331,6 +364,9 @@ # Predefined Variables # http://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables # +# Promoting Updates +# http://doc.qt.io/qtinstallerframework/ifw-updates.html +# # Download Qt Installer Framework for you platform from Qt site: # http://download.qt.io/official_releases/qt-installer-framework # @@ -610,6 +646,51 @@ macro(cpack_ifw_add_repository reponame) endmacro() +# Macro for updating repository +macro(cpack_ifw_update_repository reponame) + + string(TOUPPER ${reponame} _CPACK_IFWREPO_UNAME) + + set(_IFW_OPT ADD REMOVE REPLACE DISABLED) + set(_IFW_ARGS URL OLD_URL NEW_URL USERNAME PASSWORD DISPLAY_NAME) + set(_IFW_MULTI_ARGS) + cmake_parse_arguments(CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN}) + + set(_CPACK_IFWREPO_STR "\n# Configuration for IFW repository \"${reponame}\" update\n") + + foreach(_IFW_ARG_NAME ${_IFW_OPT}) + cpack_append_option_set_command( + CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME} + _CPACK_IFWREPO_STR) + endforeach() + + foreach(_IFW_ARG_NAME ${_IFW_ARGS}) + cpack_append_string_variable_set_command( + CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME} + _CPACK_IFWREPO_STR) + endforeach() + + foreach(_IFW_ARG_NAME ${_IFW_MULTI_ARGS}) + cpack_append_variable_set_command( + CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME} + _CPACK_IFWREPO_STR) + endforeach() + + if(CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_ADD + OR CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_REMOVE + OR CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_REPLACE) + list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame}) + set(_CPACK_IFWREPO_STR "${_CPACK_IFWREPO_STR}list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})\n") + else() + set(_CPACK_IFWREPO_STR) + endif() + + if(CPack_CMake_INCLUDED AND _CPACK_IFWREPO_STR) + file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWREPO_STR}") + endif() + +endmacro() + # Resolve package control script _cpack_ifw_resolve_script(CPACK_IFW_PACKAGE_CONTROL_SCRIPT) |