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

qt_add_qml_module: resource base dir

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2.1
    • Build System: CMake
    • None

    Description

      i'm trying to use `qt_add_qml_module` in my current project.
      my directory layout looks like this:

      CMakeLists.txt
      inc/foo.h
      src/foo.cpp
      resources/qt/Main.qml
      resources/qt/component1/Comp1.qml
      resources/qt/component1/Asset1.png
      resources/qt/component2/Comp2.qml
      resources/qt/component2/Asset2.png
      resources/qt/component3/Comp3.qml
      resources/qt/component3/Asset3.png
      

      i'm using `qt_add_qml_module` like this:

          qt_add_qml_module(
              FooCore
              URI FooCore
              VERSION 1.0
              PLUGIN_TARGET FooPlugin
              OUTPUT_DIRECTORY FooCore
      
              QML_FILES
                  resources/qt/Main.qml
                  resources/qt/component1/Comp1.qml
                  resources/qt/component2/Comp2.qml
                  resources/qt/component3/Comp3.qml
      
              RESOURCES
                  resources/qt/component1/Asset1.png
                  resources/qt/component2/Asset2.png
                  resources/qt/component3/Asset3.png
              )
      

      this leads to a generated qrc file with a resource prefix "/FooCore/", which is great. but all resources and qml files use an "alias" with the full specified path. (e.g. "resources/qt/component1/Comp1.qml"). i wonder if it makes sense to add a keyword argument to specify a "base dir". something like `RESOURCE_BASE_DIR resources/qt` would lead to qrc "alias"es like "Main.qml", "component1/Comp1.qml" etc ... or maybe there is another way to allow better control over the qrc path of specific resources ...

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            timblechmann tim blechmann
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes