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

qt_add_qml_module: resource base dir

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 6.2.1
    • Fix Version/s: None
    • Component/s: Build System: CMake
    • Labels:
      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

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes