Document qt_import_plugins behavior for dynamic plugins

This describes how qt_import_plugins works for dynamic plugins.

Pick-to: 6.6 6.5
Task-number: QTBUG-118829
Change-Id: I7b30060c11c0d8c4a1fbae6782a047737ba7d454
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2e328ca5a8242b0c3edec8e59d1cfa02d4596202)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2024-01-15 08:14:29 +01:00 committed by Qt Cherry-pick Bot
parent 7adfb315e5
commit 7700d8cb61

View File

@ -8,7 +8,7 @@
\title qt_import_plugins \title qt_import_plugins
\keyword qt6_import_plugins \keyword qt6_import_plugins
\summary {Specifies a custom set of plugins to import for a static Qt build.} \summary {Specifies a custom set of plugins to import or exclude.}
\include cmake-find-package-core.qdocinc \include cmake-find-package-core.qdocinc
@ -48,17 +48,35 @@ can be used more than once.
Qt provides plugin types such as \c imageformats, \c platforms, Qt provides plugin types such as \c imageformats, \c platforms,
and \c sqldrivers. and \c sqldrivers.
\section2 Dynamic plugins
If plugins are dynamic libraries, the function controls the plugin deployment.
Using this function, you may exclude specific plugin types from
being packaged into an Android APK, for example:
\badcode
qt_add_executable(MyApp ...)
...
qt_import_plugins(MyApp EXCLUDE_BY_TYPE imageformats)
\endcode
In the snippet above, all plugins that have the \c imageformats type will
be excluded when deploying \c MyApp. The resulting Android APK will not
contain any of the \c imageformats plugins.
If the command isn't used, the target automatically deploys all plugins that
belong to the Qt modules that the target is linked against.
\section2 Static plugins
If the command isn't used the target automatically links against If the command isn't used the target automatically links against
a sane set of default plugins, for each Qt module that the target is linked a sane set of default static plugins, for each Qt module that the target is
against. For more information, see linked against. For more information, see
\l{CMake target_link_libraries Documentation}{target_link_libraries}. \l{CMake target_link_libraries Documentation}{target_link_libraries}.
Each plugin comes with a C++ stub file that automatically Each plugin comes with a C++ stub file that automatically
initializes the plugin. Consequently, any target that links against a plugin initializes the static plugin. Consequently, any target that links against
has this C++ file added to its \c SOURCES. a plugin has this C++ file added to its \c SOURCES.
\note This command imports plugins from static Qt builds only.
On shared builds, it does nothing.
\section1 Examples \section1 Examples