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

Document SDK deployment of targets which depend on auto-generated resource targets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.1
    • None
    • All

    Description

      We use qt_query_qml_module to detect the targets that need to be installed with a QML module. However I just found that qt_query_qml_module does not list any resources? Or am I doing something wrong?

      Here is a (slightly shortened) example:

      qt_add_qml_module(${PROJECT_NAME}
          URI ${PROJECT_NAME}
          VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
          DEPENDENCIES
              QtQuick/auto
          IMPORTS
              QtQuick.Controls.Basic/auto
          OUTPUT_TARGETS BDAQTQUICKMATERIAL_EXTRA_INSTALL_TARGETS
          SOURCES
              myqquickmaterialstyle.cpp myqquickmaterialstyle_p.h
          QML_FILES
              ${qml_files}
      )
      
      qt_add_resources(${PROJECT_NAME} "${PROJECT_NAME}"
          FILES
              "images/my-arrow-indicator.png"
      )
      
      qt_add_shaders(${PROJECT_NAME} "myqtquickcontrols2materialstyleplugin_shaders"
          BATCHABLE
          PRECOMPILE
          OPTIMIZED
          FILES
              "shaders/RectangularGlow.frag"
      )
      
      qt_query_qml_module(${PROJECT_NAME}
          URI module_uri
          VERSION module_version
          PLUGIN_TARGET module_plugin_target
          TARGET_PATH module_target_path
          QMLDIR module_qmldir
          TYPEINFO module_typeinfo
          QML_FILES module_qml_files
          QML_FILES_DEPLOY_PATHS qml_files_deploy_paths
          RESOURCES module_resources
          RESOURCES_DEPLOY_PATHS resources_deploy_paths)
      
      set(module_dir "qml/${module_target_path}")
      list(LENGTH module_qml_files num_module_qml_files)
      list(LENGTH module_resources num_module_resources)
      
      message("The QML module URI is: ${module_uri}")
      message("The QML module directory is: ${module_dir}")
      message("The QML module version is: ${module_version}")
      message("The QML module plugin target is: '${module_plugin_target}'")
      message("The QML module extra install targets are: '${BDAQTMODELS_EXTRA_INSTALL_TARGETS}'")
      message("The QML module resources target is: '${module_resources}'")
      message("The QML module resources deploy paths are: '${resources_deploy_paths}'")
      message("There are ${num_module_qml_files} QML files and ${num_module_resources} resource files")
      

      This prints an empty '${module_resources}' and '${resources_deploy_paths}'. But subsequently I get errors like the following from cmake:

      [build] CMake Error: install(EXPORT "MyQuickMaterialTargets" ...) includes target "MyQuickMaterial" which requires target "MyQuickMaterial_resources_3" that is not in any export set.
      

      How do I correctly compile the list of required resources in cmake?

      Related issues are:

      • QTBUG-111946: How should QML modules be installed with cmake (with Qt 6.4 or later)?
      • QTBUG-100102: Provide CMake API for deploying a single QML module

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              emmenlau Mario Emmenlauer
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes