summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-19 14:41:21 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-05-19 14:41:21 (GMT)
commit5a9efbfc4bb78a12677247a5ced53141a3c34ba4 (patch)
tree0d208045794a555121c279139d06e4bec3eca4e4 /Modules
parent6bf6482fa632969cdb399d6e9794cef015af8d4c (diff)
parent41199f8c1ea02bacb516ae8bd57d9c9e1d3fd4ee (diff)
downloadCMake-5a9efbfc4bb78a12677247a5ced53141a3c34ba4.zip
CMake-5a9efbfc4bb78a12677247a5ced53141a3c34ba4.tar.gz
CMake-5a9efbfc4bb78a12677247a5ced53141a3c34ba4.tar.bz2
Merge topic 'cpack-ifw-updates'
41199f8c CPackIFW: Add support for Promoting Updates 6ca6b0dd CPackIFW: Add more known QtIFW releases
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackIFW.cmake85
1 files changed, 84 insertions, 1 deletions
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 6649933..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
#
@@ -377,6 +413,8 @@ set(_CPACK_IFW_SUFFIXES
"QtIFW2.3.0/bin"
"QtIFW2.2.0/bin"
"QtIFW2.1.0/bin"
+ "QtIFW2.0.3/bin"
+ "QtIFW2.0.1/bin"
"QtIFW2.0.0/bin"
# First branch
"QtIFW-1.6.0/bin"
@@ -608,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)