CMake: Add filter options to qt_generate_deploy_app_script

Add the options PRE_INCLUDE_REGEXES, PRE_EXCLUDE_REGEXES,
POST_INCLUDE_REGEXES, POST_EXCLUDE_REGEXES, POST_INCLUDE_FILES, and
POST_EXCLUDE_FILES.  These are forwarded to
qt_deploy_runtime_dependencies.

Change-Id: I003814bec7f797a0035e52b17fd0231f9ad7ff0d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Joerg Bornemann 2022-10-13 08:52:00 +02:00
parent 1407e0fe50
commit 0a4d0ac013
2 changed files with 31 additions and 1 deletions

View File

@ -2732,7 +2732,18 @@ function(qt6_generate_deploy_app_script)
TARGET
FILENAME_VARIABLE
)
set(multi_value_options "")
set(qt_deploy_runtime_dependencies_options
# These options are forwarded as is to qt_deploy_runtime_dependencies.
PRE_INCLUDE_REGEXES
PRE_EXCLUDE_REGEXES
POST_INCLUDE_REGEXES
POST_EXCLUDE_REGEXES
POST_INCLUDE_FILES
POST_EXCLUDE_FILES
)
set(multi_value_options
${qt_deploy_runtime_dependencies_options}
)
cmake_parse_arguments(PARSE_ARGV 0 arg
"${no_value_options}" "${single_value_options}" "${multi_value_options}"
)
@ -2762,6 +2773,13 @@ function(qt6_generate_deploy_app_script)
string(APPEND common_deploy_args " NO_TRANSLATIONS\n")
endif()
# Forward the arguments that are exactly the same for qt_deploy_runtime_dependencies.
foreach(var IN LISTS qt_deploy_runtime_dependencies_options)
if(NOT "${arg_${var}}" STREQUAL "")
list(APPEND common_deploy_args ${var} ${arg_${var}})
endif()
endforeach()
if(APPLE AND NOT IOS AND QT6_IS_SHARED_LIBS_BUILD)
# TODO: Handle non-bundle applications if possible.
get_target_property(is_bundle ${arg_TARGET} MACOSX_BUNDLE)

View File

@ -24,6 +24,12 @@ qt_generate_deploy_app_script(
FILENAME_VARIABLE var_name
[NO_TRANSLATIONS]
[NO_UNSUPPORTED_PLATFORM_ERROR]
[PRE_INCLUDE_REGEXES regexes...]
[PRE_EXCLUDE_REGEXES regexes...]
[POST_INCLUDE_REGEXES regexes...]
[POST_EXCLUDE_REGEXES regexes...]
[POST_INCLUDE_FILES files...]
[POST_EXCLUDE_FILES files...]
)
\endcode
@ -72,6 +78,12 @@ instead.
For generating a custom deployment script, use
\l{qt6_generate_deploy_script}{qt_generate_deploy_script}.
The options \c{PRE_INCLUDE_REGEXES}, \c{PRE_EXCLUDE_REGEXES},
\c{POST_INCLUDE_REGEXES}, \c{POST_EXCLUDE_REGEXES}, \c{POST_INCLUDE_FILES}, and
\c{POST_EXCLUDE_FILES} can be specified to control the deployment of runtime
dependencies. These options do not apply to all platforms and are forwarded
unmodified to \l{qt_deploy_runtime_dependencies()}.
\sa {qt6_standard_project_setup}{qt_standard_project_setup()},
{qt6_generate_deploy_script}{qt_generate_deploy_script()},
{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}