Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140157

qt_generate_deploy_qml_app_script ignores plugin settings set by qt_import_plugins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.9.2
    • None
    • Windows

      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.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtbuildsystem Qt Build System Team
            berglerma Manuel Bergler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes