diff --git a/src/corelib/Qt6CoreDeploySupport.cmake b/src/corelib/Qt6CoreDeploySupport.cmake index 599152344c1..901056bed35 100644 --- a/src/corelib/Qt6CoreDeploySupport.cmake +++ b/src/corelib/Qt6CoreDeploySupport.cmake @@ -366,6 +366,10 @@ function(qt6_deploy_runtime_dependencies) ADDITIONAL_EXECUTABLES ADDITIONAL_LIBRARIES ADDITIONAL_MODULES + EXCLUDE_PLUGINS + EXCLUDE_PLUGIN_TYPES + INCLUDE_PLUGINS + INCLUDE_PLUGIN_TYPES ${file_GRD_options} DEPLOY_TOOL_OPTIONS ) @@ -463,6 +467,22 @@ function(qt6_deploy_runtime_dependencies) if(arg_NO_PLUGINS) list(APPEND tool_options --no-plugins) endif() + if(DEFINED arg_EXCLUDE_PLUGIN_TYPES) + string(REPLACE ";" "," plugin_list "${arg_EXCLUDE_PLUGIN_TYPES}") + list(APPEND tool_options --skip-plugin-types "${plugin_list}") + endif() + if(DEFINED arg_INCLUDE_PLUGIN_TYPES) + string(REPLACE ";" "," plugin_list "${arg_INCLUDE_PLUGIN_TYPES}") + list(APPEND tool_options --add-plugin-types "${plugin_list}") + endif() + if(DEFINED arg_INCLUDE_PLUGINS) + string(REPLACE ";" "," plugin_list "${arg_INCLUDE_PLUGINS}") + list(APPEND tool_options --include-plugins "${plugin_list}") + endif() + if(DEFINED arg_EXCLUDE_PLUGINS) + string(REPLACE ";" "," plugin_list "${arg_EXCLUDE_PLUGINS}") + list(APPEND tool_options --exclude-plugins "${plugin_list}") + endif() # Specify path to target Qt's qtpaths .exe or .bat file, so windeployqt deploys the correct # libraries when cross-compiling from x86_64 to arm64 windows. diff --git a/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc b/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc index 8582ef0d31a..8d5c5700142 100644 --- a/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc +++ b/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc @@ -39,6 +39,10 @@ qt_deploy_runtime_dependencies( [NO_OVERWRITE] [NO_APP_STORE_COMPLIANCE] [NO_PLUGINS] # since Qt 6.10 + [EXCLUDE_PLUGIN_TYPES type...] # since Qt 6.10 + [INCLUDE_PLUGIN_TYPES type...] # since Qt 6.10 + [EXCLUDE_PLUGINS name...] # since Qt 6.10 + [INCLUDE_PLUGINS name...] # since Qt 6.10 [NO_TRANSLATIONS] [NO_COMPILER_RUNTIME] [DEPLOY_TOOL_OPTIONS] @@ -191,6 +195,21 @@ Qt plugins are automatically deployed into \l QT_DEPLOY_PLUGINS_DIR. You can turn off plugin deployment with the \c NO_PLUGINS argument. +You can include all plugins of a specific type with the \c INCLUDE_PLUGIN_TYPES +argument. You can exclude all plugins of a specific type with the \c +EXCLUDE_PLUGIN_TYPES argument. Both arguments take plugin types, e.g. \c +imageformats. + +You can include or exclude specific plugins with the arguments \c +INCLUDE_PLUGINS and \c EXCLUDE_PLUGINS. Both arguments take plugin names, for +example \c qjpeg. + +\note Plugin names must not be confused with plugin targets. For example, the \c +Qt6::QJpegPlugin target's plugin name is \c qjpeg. + +\note The arguments \c EXCLUDE_PLUGINS, \c EXCLUDE_PLUGIN_TYPES, \c +INCLUDE_PLUGINS, and \c INCLUDE_PLUGIN_TYPES only work on Windows. + \section1 Example The following example shows how to deploy an application \c{MyApp}.