-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.2
-
None
I recently tried to get the install script generated by qt_generate_deploy_qml_app_script to skip deployment of the ffmpeg multimedia plugin. At first I tried to useĀ
DEPLOY_TOOL_OPTIONS --exclude-plugins ffmpegmedia
but when that didn't work I wasn't sure whether I passed the correct plugin name to --exclude-plugins. So I started seaching the Qt documentation for more information on how to exclude certain plugins, which is how I stumbled across qt_import_plugins.
I then added
qt_import_plugins(app EXCLUDE Qt6::QFFmpegMediaPlugin )
before the qt_generate_deploy_qml_app_script call in my CMakeLists.txt file.
To my surprise this had no effect on the command-line arguments passed to windeployqt (which helpfully were printed as part of the the generated install script).
Reading the documentation of qt_import_plugins again it seems like it is only used for static Qt builds or when building Android APKs. However, I don't see why qt_generate_deploy_qml_app_script couldn't make use of that information, too.
It is much more convenient and less error prone to use the CMake plugin targets instead of passing command-line flags through DEPLOY_TOOL_OPTIONS, as the latter can easily be misspelled, and in the case of --exclude-plugins this doesn't even cause an error, whereas a misspelled target name will be caught at configuration time.