1 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
4 #[=======================================================================[.rst:
10 This module looks for the location of the command-line utilities supplied with the
11 `Qt Installer Framework <https://doc.qt.io/qtinstallerframework/index.html>`_
14 The module also defines several commands to control the behavior of the
15 :cpack_gen:`CPack IFW Generator`.
20 The module defines the following commands:
22 .. command:: cpack_ifw_configure_component
24 Sets the arguments specific to the CPack IFW generator.
28 cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL] [VIRTUAL]
29 [FORCED_INSTALLATION] [REQUIRES_ADMIN_RIGHTS]
31 [DISPLAY_NAME <display_name>] # Note: Internationalization supported
32 [DESCRIPTION <description>] # Note: Internationalization supported
33 [UPDATE_TEXT <update_text>]
35 [RELEASE_DATE <release_date>]
37 [PRIORITY|SORTING_PRIORITY <sorting_priority>] # Note: PRIORITY is deprecated
38 [DEPENDS|DEPENDENCIES <com_id> ...]
39 [AUTO_DEPEND_ON <comp_id> ...]
40 [LICENSES <display_name> <file_path> ...]
42 [USER_INTERFACES <file_path> <file_path> ...]
43 [TRANSLATIONS <file_path> <file_path> ...]
44 [REPLACES <comp_id> ...]
47 This command should be called after :command:`cpack_add_component` command.
50 if set, then the component will be packaged and installed as part
51 of a group to which it belongs.
56 if set, then the package manager stays disabled until that
62 if set, then the component will be hidden from the installer.
63 It is a equivalent of the ``HIDDEN`` option from the
64 :command:`cpack_add_component` command.
66 ``FORCED_INSTALLATION``
69 if set, then the component must always be installed.
70 It is a equivalent of the ``REQUIRED`` option from the
71 :command:`cpack_add_component` command.
73 ``REQUIRES_ADMIN_RIGHTS``
76 set it if the component needs to be installed with elevated permissions.
79 is used to create domain-like identification for this component.
80 By default used origin component name.
85 set to rewrite original name configured by
86 :command:`cpack_add_component` command.
91 set to rewrite original description configured by
92 :command:`cpack_add_component` command.
97 will be added to the component description if this is an update to
101 is version of component.
102 By default used :variable:`CPACK_PACKAGE_VERSION`.
105 .. versionadded:: 3.8
107 keep empty to auto generate.
110 is a relative or absolute path to operations script
114 .. versionadded:: 3.8
116 is priority of the component in the tree.
120 Old name for ``SORTING_PRIORITY``.
122 ``DEPENDS``, ``DEPENDENCIES``
123 .. versionadded:: 3.8
125 list of dependency component or component group identifiers in
128 .. versionadded:: 3.21
130 Component or group names listed as dependencies may contain hyphens.
131 This requires QtIFW 3.1 or later.
134 .. versionadded:: 3.8
136 list of identifiers of component or component group in QtIFW style
137 that this component has an automatic dependency on.
140 pair of <display_name> and <file_path> of license text for this
141 component. You can specify more then one license.
144 .. versionadded:: 3.8
146 Possible values are: TRUE, FALSE, and SCRIPT.
147 Set to FALSE to disable the component in the installer or to SCRIPT
148 to resolved during runtime (don't forget add the file of the script
149 as a value of the ``SCRIPT`` option).
152 .. versionadded:: 3.7
154 is a list of <file_path> ('.ui' files) representing pages to load.
157 .. versionadded:: 3.8
159 is a list of <file_path> ('.qm' files) representing translations to load.
162 .. versionadded:: 3.10
164 list of identifiers of component or component group to replace.
167 .. versionadded:: 3.10
169 Possible values are: TRUE, FALSE.
170 Set to FALSE if you want to hide the checkbox for an item.
171 This is useful when only a few subcomponents should be selected
175 .. command:: cpack_ifw_configure_component_group
177 Sets the arguments specific to the CPack IFW generator.
181 cpack_ifw_configure_component_group(<groupname> [VIRTUAL]
182 [FORCED_INSTALLATION] [REQUIRES_ADMIN_RIGHTS]
184 [DISPLAY_NAME <display_name>] # Note: Internationalization supported
185 [DESCRIPTION <description>] # Note: Internationalization supported
186 [UPDATE_TEXT <update_text>]
188 [RELEASE_DATE <release_date>]
190 [PRIORITY|SORTING_PRIORITY <sorting_priority>] # Note: PRIORITY is deprecated
191 [DEPENDS|DEPENDENCIES <com_id> ...]
192 [AUTO_DEPEND_ON <comp_id> ...]
193 [LICENSES <display_name> <file_path> ...]
195 [USER_INTERFACES <file_path> <file_path> ...]
196 [TRANSLATIONS <file_path> <file_path> ...]
197 [REPLACES <comp_id> ...]
200 This command should be called after :command:`cpack_add_component_group`
204 .. versionadded:: 3.8
206 if set, then the group will be hidden from the installer.
207 Note that setting this on a root component does not work.
209 ``FORCED_INSTALLATION``
210 .. versionadded:: 3.8
212 if set, then the group must always be installed.
214 ``REQUIRES_ADMIN_RIGHTS``
215 .. versionadded:: 3.8
217 set it if the component group needs to be installed with elevated
221 is used to create domain-like identification for this component group.
222 By default used origin component group name.
225 .. versionadded:: 3.8
227 set to rewrite original name configured by
228 :command:`cpack_add_component_group` command.
231 .. versionadded:: 3.8
233 set to rewrite original description configured by
234 :command:`cpack_add_component_group` command.
237 .. versionadded:: 3.8
239 will be added to the component group description if this is an update to
243 is version of component group.
244 By default used :variable:`CPACK_PACKAGE_VERSION`.
247 .. versionadded:: 3.8
249 keep empty to auto generate.
252 is a relative or absolute path to operations script
253 for this component group.
256 is priority of the component group in the tree.
260 Old name for ``SORTING_PRIORITY``.
262 ``DEPENDS``, ``DEPENDENCIES``
263 .. versionadded:: 3.8
265 list of dependency component or component group identifiers in
268 .. versionadded:: 3.21
270 Component or group names listed as dependencies may contain hyphens.
271 This requires QtIFW 3.1 or later.
274 .. versionadded:: 3.8
276 list of identifiers of component or component group in QtIFW style
277 that this component group has an automatic dependency on.
280 pair of <display_name> and <file_path> of license text for this
281 component group. You can specify more then one license.
284 .. versionadded:: 3.8
286 Possible values are: TRUE, FALSE, and SCRIPT.
287 Set to TRUE to preselect the group in the installer
288 (this takes effect only on groups that have no visible child components)
289 or to SCRIPT to resolved during runtime (don't forget add the file of
290 the script as a value of the ``SCRIPT`` option).
293 .. versionadded:: 3.7
295 is a list of <file_path> ('.ui' files) representing pages to load.
298 .. versionadded:: 3.8
300 is a list of <file_path> ('.qm' files) representing translations to load.
303 .. versionadded:: 3.10
305 list of identifiers of component or component group to replace.
308 .. versionadded:: 3.10
310 Possible values are: TRUE, FALSE.
311 Set to FALSE if you want to hide the checkbox for an item.
312 This is useful when only a few subcomponents should be selected
316 .. command:: cpack_ifw_add_repository
318 Add QtIFW specific remote repository to binary installer.
322 cpack_ifw_add_repository(<reponame> [DISABLED]
324 [USERNAME <username>]
325 [PASSWORD <password>]
326 [DISPLAY_NAME <display_name>])
328 This command will also add the <reponame> repository
329 to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`.
332 if set, then the repository will be disabled by default.
335 is points to a list of available components.
338 is used as user on a protected repository.
341 is password to use on a protected repository.
344 is string to display instead of the URL.
347 .. command:: cpack_ifw_update_repository
349 .. versionadded:: 3.6
351 Update QtIFW specific repository from remote repository.
355 cpack_ifw_update_repository(<reponame>
356 [[ADD|REMOVE] URL <url>]|
357 [REPLACE OLD_URL <old_url> NEW_URL <new_url>]]
358 [USERNAME <username>]
359 [PASSWORD <password>]
360 [DISPLAY_NAME <display_name>])
362 This command will also add the <reponame> repository
363 to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`.
366 is points to a list of available components.
369 is points to a list that will replaced.
372 is points to a list that will replace to.
375 is used as user on a protected repository.
378 is password to use on a protected repository.
381 is string to display instead of the URL.
384 .. command:: cpack_ifw_add_package_resources
386 .. versionadded:: 3.7
388 Add additional resources in the installer binary.
392 cpack_ifw_add_package_resources(<file_path> <file_path> ...)
394 This command will also add the specified files
395 to a variable :variable:`CPACK_IFW_PACKAGE_RESOURCES`.
397 #]=======================================================================]
400 # All of the internal implementation CMake modules for other CPack generators
401 # have been moved into the Internal/CPack directory. This one has not, because
402 # it contains user-facing macros which would be lost if it were moved. At some
403 # point, this module should be split into user-facing macros (which would live
404 # in this module) and internal implementation details (which would live in
405 # Internal/CPack/CPackIFW.cmake).
407 #=============================================================================
408 # Search Qt Installer Framework tools
409 #=============================================================================
413 foreach(_CPACK_IFW_PATH_VAR "CPACK_IFW_ROOT" "QTIFWDIR" "QTDIR")
414 if(DEFINED ${_CPACK_IFW_PATH_VAR}
415 AND NOT "${${_CPACK_IFW_PATH_VAR}}" STREQUAL "")
416 list(APPEND _CPACK_IFW_PATHS "${${_CPACK_IFW_PATH_VAR}}")
418 if(NOT "$ENV{${_CPACK_IFW_PATH_VAR}}" STREQUAL "")
419 list(APPEND _CPACK_IFW_PATHS "$ENV{${_CPACK_IFW_PATH_VAR}}")
423 list(APPEND _CPACK_IFW_PATHS
427 list(APPEND _CPACK_IFW_PATHS
431 list(REMOVE_DUPLICATES _CPACK_IFW_PATHS)
433 set(_CPACK_IFW_PREFIXES
435 "Tools/QtInstallerFramework/"
441 set(_CPACK_IFW_VERSIONS
494 set(_CPACK_IFW_SUFFIXES "bin")
495 foreach(_CPACK_IFW_PREFIX ${_CPACK_IFW_PREFIXES})
496 foreach(_CPACK_IFW_VERSION ${_CPACK_IFW_VERSIONS})
498 _CPACK_IFW_SUFFIXES "${_CPACK_IFW_PREFIX}${_CPACK_IFW_VERSION}/bin")
502 # Look for 'binarycreator'
504 find_program(CPACK_IFW_BINARYCREATOR_EXECUTABLE
506 PATHS ${_CPACK_IFW_PATHS}
507 PATH_SUFFIXES ${_CPACK_IFW_SUFFIXES}
508 DOC "QtIFW binarycreator command line client")
510 mark_as_advanced(CPACK_IFW_BINARYCREATOR_EXECUTABLE)
514 find_program(CPACK_IFW_REPOGEN_EXECUTABLE
516 PATHS ${_CPACK_IFW_PATHS}
517 PATH_SUFFIXES ${_CPACK_IFW_SUFFIXES}
518 DOC "QtIFW repogen command line client"
520 mark_as_advanced(CPACK_IFW_REPOGEN_EXECUTABLE)
522 # Look for 'installerbase'
524 find_program(CPACK_IFW_INSTALLERBASE_EXECUTABLE
526 PATHS ${_CPACK_IFW_PATHS}
527 PATH_SUFFIXES ${_CPACK_IFW_SUFFIXES}
528 DOC "QtIFW installer executable base"
530 mark_as_advanced(CPACK_IFW_INSTALLERBASE_EXECUTABLE)
532 # Look for 'devtool' (appeared in the second branch)
534 find_program(CPACK_IFW_DEVTOOL_EXECUTABLE
536 PATHS ${_CPACK_IFW_PATHS}
537 PATH_SUFFIXES ${_CPACK_IFW_SUFFIXES}
538 DOC "QtIFW devtool command line client"
540 mark_as_advanced(CPACK_IFW_DEVTOOL_EXECUTABLE)
542 # Look for 'archivegen'
544 find_program(CPACK_IFW_ARCHIVEGEN_EXECUTABLE
546 PATHS ${_CPACK_IFW_PATHS}
547 PATH_SUFFIXES ${_CPACK_IFW_SUFFIXES}
548 DOC "QtIFW archivegen command line client"
550 mark_as_advanced(CPACK_IFW_ARCHIVEGEN_EXECUTABLE)
553 ## Next code is included only once
556 if(NOT CPackIFW_CMake_INCLUDED)
557 set(CPackIFW_CMake_INCLUDED 1)
559 #=============================================================================
561 #=============================================================================
563 set(CPACK_IFW_FRAMEWORK_VERSION_FORCED ""
564 CACHE STRING "The forced version of used QtIFW tools")
565 mark_as_advanced(CPACK_IFW_FRAMEWORK_VERSION_FORCED)
566 set(CPACK_IFW_FRAMEWORK_VERSION_TIMEOUT 1
567 CACHE STRING "The timeout to return QtIFW framework version string from \"installerbase\" executable")
568 mark_as_advanced(CPACK_IFW_FRAMEWORK_VERSION_TIMEOUT)
569 if(CPACK_IFW_INSTALLERBASE_EXECUTABLE AND NOT CPACK_IFW_FRAMEWORK_VERSION_FORCED)
570 set(CPACK_IFW_FRAMEWORK_VERSION)
571 # Invoke version from "installerbase" executable
572 foreach(_ifw_version_argument --version --framework-version)
573 if(NOT CPACK_IFW_FRAMEWORK_VERSION)
574 execute_process(COMMAND
575 "${CPACK_IFW_INSTALLERBASE_EXECUTABLE}" ${_ifw_version_argument}
576 TIMEOUT ${CPACK_IFW_FRAMEWORK_VERSION_TIMEOUT}
577 RESULT_VARIABLE CPACK_IFW_FRAMEWORK_VERSION_RESULT
578 OUTPUT_VARIABLE CPACK_IFW_FRAMEWORK_VERSION_OUTPUT
579 OUTPUT_STRIP_TRAILING_WHITESPACE
581 if(NOT CPACK_IFW_FRAMEWORK_VERSION_RESULT AND CPACK_IFW_FRAMEWORK_VERSION_OUTPUT)
582 string(REGEX MATCH "[0-9]+(\\.[0-9]+)*"
583 CPACK_IFW_FRAMEWORK_VERSION "${CPACK_IFW_FRAMEWORK_VERSION_OUTPUT}")
584 if(CPACK_IFW_FRAMEWORK_VERSION)
585 if("${_ifw_version_argument}" STREQUAL "--framework-version")
586 set(CPACK_IFW_FRAMEWORK_VERSION_SOURCE "INSTALLERBASE_FRAMEWORK_VERSION")
587 elseif("${_ifw_version_argument}" STREQUAL "--version")
588 set(CPACK_IFW_FRAMEWORK_VERSION_SOURCE "INSTALLERBASE_FRAMEWORK_VERSION")
594 # Finally try to get version from executable path
595 if(NOT CPACK_IFW_FRAMEWORK_VERSION)
596 string(REGEX MATCH "[0-9]+(\\.[0-9]+)*"
597 CPACK_IFW_FRAMEWORK_VERSION "${CPACK_IFW_INSTALLERBASE_EXECUTABLE}")
598 if(CPACK_IFW_FRAMEWORK_VERSION)
599 set(CPACK_IFW_FRAMEWORK_VERSION_SOURCE "INSTALLERBASE_PATH")
602 elseif(CPACK_IFW_FRAMEWORK_VERSION_FORCED)
603 set(CPACK_IFW_FRAMEWORK_VERSION ${CPACK_IFW_FRAMEWORK_VERSION_FORCED})
604 set(CPACK_IFW_FRAMEWORK_VERSION_SOURCE "FORCED")
606 if(CPACK_IFW_VERBOSE)
607 if(CPACK_IFW_FRAMEWORK_VERSION AND CPACK_IFW_FRAMEWORK_VERSION_FORCED)
608 message(STATUS "Found QtIFW ${CPACK_IFW_FRAMEWORK_VERSION} (forced) version")
609 elseif(CPACK_IFW_FRAMEWORK_VERSION)
610 message(STATUS "Found QtIFW ${CPACK_IFW_FRAMEWORK_VERSION} version")
613 if(CPACK_IFW_INSTALLERBASE_EXECUTABLE AND NOT CPACK_IFW_FRAMEWORK_VERSION)
614 message(WARNING "Could not detect QtIFW tools version. Set used version to variable \"CPACK_IFW_FRAMEWORK_VERSION_FORCED\" manually.")
617 #=============================================================================
619 #=============================================================================
621 # Macro definition based on CPackComponent
623 if(NOT CPackComponent_CMake_INCLUDED)
624 include(CPackComponent)
627 # Resolve full filename for script file
628 macro(_cpack_ifw_resolve_script _variable)
629 set(_ifw_script_macro ${_variable})
630 set(_ifw_script_file ${${_ifw_script_macro}})
631 if(DEFINED ${_ifw_script_macro})
632 get_filename_component(${_ifw_script_macro} ${_ifw_script_file} ABSOLUTE)
633 set(_ifw_script_file ${${_ifw_script_macro}})
634 if(NOT EXISTS ${_ifw_script_file})
635 message(WARNING "CPack IFW: script file \"${_ifw_script_file}\" does not exist")
636 set(${_ifw_script_macro})
641 # Resolve full path to license file
642 macro(_cpack_ifw_resolve_lisenses _variable)
644 set(_ifw_license_file FALSE)
645 set(_ifw_licenses_fix)
646 foreach(_ifw_licenses_arg ${${_variable}})
647 if(_ifw_license_file)
648 get_filename_component(_ifw_licenses_arg "${_ifw_licenses_arg}" ABSOLUTE)
649 set(_ifw_license_file FALSE)
651 set(_ifw_license_file TRUE)
653 list(APPEND _ifw_licenses_fix "${_ifw_licenses_arg}")
654 endforeach(_ifw_licenses_arg)
655 set(${_variable} "${_ifw_licenses_fix}")
659 # Resolve full path to a list of provided files
660 macro(_cpack_ifw_resolve_file_list _variable)
663 foreach(_ifw_file_arg ${${_variable}})
664 get_filename_component(_ifw_file_arg "${_ifw_file_arg}" ABSOLUTE)
665 if(EXISTS ${_ifw_file_arg})
666 list(APPEND _ifw_list_fix "${_ifw_file_arg}")
668 message(WARNING "CPack IFW: page file \"${_ifw_file_arg}\" does not exist. Skipping")
670 endforeach(_ifw_file_arg)
671 set(${_variable} "${_ifw_list_fix}")
675 # Macro for configure component
676 macro(cpack_ifw_configure_component compname)
678 string(TOUPPER ${compname} _CPACK_IFWCOMP_UNAME)
680 set(_IFW_OPT COMMON ESSENTIAL VIRTUAL FORCED_INSTALLATION REQUIRES_ADMIN_RIGHTS)
681 set(_IFW_ARGS NAME VERSION RELEASE_DATE SCRIPT PRIORITY SORTING_PRIORITY UPDATE_TEXT DEFAULT CHECKABLE)
682 set(_IFW_MULTI_ARGS DISPLAY_NAME DESCRIPTION DEPENDS DEPENDENCIES AUTO_DEPEND_ON LICENSES USER_INTERFACES TRANSLATIONS REPLACES)
683 cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})
685 _cpack_ifw_resolve_script(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_SCRIPT)
686 _cpack_ifw_resolve_lisenses(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_LICENSES)
687 _cpack_ifw_resolve_file_list(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_USER_INTERFACES)
688 _cpack_ifw_resolve_file_list(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_TRANSLATIONS)
690 set(_CPACK_IFWCOMP_STR "\n# Configuration for IFW component \"${compname}\"\n")
692 foreach(_IFW_ARG_NAME ${_IFW_OPT})
693 cpack_append_option_set_command(
694 CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_${_IFW_ARG_NAME}
698 foreach(_IFW_ARG_NAME ${_IFW_ARGS})
699 cpack_append_string_variable_set_command(
700 CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_${_IFW_ARG_NAME}
704 foreach(_IFW_ARG_NAME ${_IFW_MULTI_ARGS})
705 cpack_append_list_variable_set_command(
706 CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_${_IFW_ARG_NAME}
710 if(CPack_CMake_INCLUDED)
711 file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWCOMP_STR}")
716 # Macro for configure group
717 macro(cpack_ifw_configure_component_group grpname)
719 string(TOUPPER ${grpname} _CPACK_IFWGRP_UNAME)
721 set(_IFW_OPT VIRTUAL FORCED_INSTALLATION REQUIRES_ADMIN_RIGHTS)
722 set(_IFW_ARGS NAME VERSION RELEASE_DATE SCRIPT PRIORITY SORTING_PRIORITY UPDATE_TEXT DEFAULT CHECKABLE)
723 set(_IFW_MULTI_ARGS DISPLAY_NAME DESCRIPTION DEPENDS DEPENDENCIES AUTO_DEPEND_ON LICENSES USER_INTERFACES TRANSLATIONS REPLACES)
724 cmake_parse_arguments(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})
726 _cpack_ifw_resolve_script(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_SCRIPT)
727 _cpack_ifw_resolve_lisenses(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_LICENSES)
728 _cpack_ifw_resolve_file_list(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_USER_INTERFACES)
729 _cpack_ifw_resolve_file_list(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_TRANSLATIONS)
731 set(_CPACK_IFWGRP_STR "\n# Configuration for IFW component group \"${grpname}\"\n")
733 foreach(_IFW_ARG_NAME ${_IFW_OPT})
734 cpack_append_option_set_command(
735 CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_${_IFW_ARG_NAME}
739 foreach(_IFW_ARG_NAME ${_IFW_ARGS})
740 cpack_append_string_variable_set_command(
741 CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_${_IFW_ARG_NAME}
745 foreach(_IFW_ARG_NAME ${_IFW_MULTI_ARGS})
746 cpack_append_list_variable_set_command(
747 CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_${_IFW_ARG_NAME}
751 if(CPack_CMake_INCLUDED)
752 file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWGRP_STR}")
756 # Macro for adding repository
757 macro(cpack_ifw_add_repository reponame)
759 string(TOUPPER ${reponame} _CPACK_IFWREPO_UNAME)
761 set(_IFW_OPT DISABLED)
762 set(_IFW_ARGS URL USERNAME PASSWORD DISPLAY_NAME)
764 cmake_parse_arguments(CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})
766 set(_CPACK_IFWREPO_STR "\n# Configuration for IFW repository \"${reponame}\"\n")
768 foreach(_IFW_ARG_NAME ${_IFW_OPT})
769 cpack_append_option_set_command(
770 CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
774 foreach(_IFW_ARG_NAME ${_IFW_ARGS})
775 cpack_append_string_variable_set_command(
776 CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
780 foreach(_IFW_ARG_NAME ${_IFW_MULTI_ARGS})
781 cpack_append_variable_set_command(
782 CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
786 list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})
787 string(APPEND _CPACK_IFWREPO_STR "list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})\n")
789 if(CPack_CMake_INCLUDED)
790 file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWREPO_STR}")
795 # Macro for updating repository
796 macro(cpack_ifw_update_repository reponame)
798 string(TOUPPER ${reponame} _CPACK_IFWREPO_UNAME)
800 set(_IFW_OPT ADD REMOVE REPLACE DISABLED)
801 set(_IFW_ARGS URL OLD_URL NEW_URL USERNAME PASSWORD DISPLAY_NAME)
803 cmake_parse_arguments(CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})
805 set(_CPACK_IFWREPO_STR "\n# Configuration for IFW repository \"${reponame}\" update\n")
807 foreach(_IFW_ARG_NAME ${_IFW_OPT})
808 cpack_append_option_set_command(
809 CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
813 foreach(_IFW_ARG_NAME ${_IFW_ARGS})
814 cpack_append_string_variable_set_command(
815 CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
819 foreach(_IFW_ARG_NAME ${_IFW_MULTI_ARGS})
820 cpack_append_variable_set_command(
821 CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_${_IFW_ARG_NAME}
825 if(CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_ADD
826 OR CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_REMOVE
827 OR CPACK_IFW_REPOSITORY_${_CPACK_IFWREPO_UNAME}_REPLACE)
828 list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})
829 string(APPEND _CPACK_IFWREPO_STR "list(APPEND CPACK_IFW_REPOSITORIES_ALL ${reponame})\n")
831 set(_CPACK_IFWREPO_STR)
834 if(CPack_CMake_INCLUDED AND _CPACK_IFWREPO_STR)
835 file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWREPO_STR}")
840 # Macro for adding resources
841 macro(cpack_ifw_add_package_resources)
842 set(_CPACK_IFW_PACKAGE_RESOURCES ${ARGV})
843 _cpack_ifw_resolve_file_list(_CPACK_IFW_PACKAGE_RESOURCES)
844 list(APPEND CPACK_IFW_PACKAGE_RESOURCES ${_CPACK_IFW_PACKAGE_RESOURCES})
845 set(_CPACK_IFWQRC_STR "list(APPEND CPACK_IFW_PACKAGE_RESOURCES \"${_CPACK_IFW_PACKAGE_RESOURCES}\")\n")
846 if(CPack_CMake_INCLUDED)
847 file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${_CPACK_IFWQRC_STR}")
851 # Resolve package control script
852 _cpack_ifw_resolve_script(CPACK_IFW_PACKAGE_CONTROL_SCRIPT)
854 endif() # NOT CPackIFW_CMake_INCLUDED