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

How should QML modules be installed with cmake (with Qt 6.4 or later)?



    • All
    • 4416a6bd4 (dev), f13ffc2a6 (6.5), 8d1bcf9eb (master)


      I have read https://doc.qt.io/qt-6/qt-add-qml-module.html, https://doc.qt.io/qt-6/qtqml-modules-cppplugins.html, https://www.qt.io/blog/introduction-to-the-qml-cmake-api and https://www.qt.io/blog/qml-modules-in-qt-6.2. But after reading that and googling for a while, I do not know what is the best practice to install QML modules with cmake into TARGETDIR. An example would be great, for example in https://doc.qt.io/qt-6/qtqml-modules-cppplugins.html?!

      In the last link, the documentation says in Installation:

      Eventually, you will have to take care of installation and deployment for your QML modules then. The CMake API for QML modules does not provide an abstraction for this, yet. We intend to provide one in Qt 6.3. Until then, you can manually use CMake's install function to install QML modules.

      So supposedly there is an abstraction now with Qt 6.3 (or later)? What is that abstraction, and how should it be used?

      Furthermore, the first link says:

      If the backing target is a static library and that static library will be installed, OUTPUT_TARGETS should be given to provide a variable in which to store a list of additional targets that will also need to be installed.

      But how should the OUTPUT_TARGETS be installed?

      Concrete questions:

      • Should the cmake install command be used to install the QML module? How?
      • How should OUTPUT_TARGETS be installed?
      • If the cmake install command can not be used, which other commands should be used?
      • More specifically, what is the recommended target directory for QML modules? The official Qt modules seem to go into TARGETDIR/qml/, should user-developed modules use the same? Does that happen automatically or is there something that needs to be done?


        Issue Links

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



              fabiankosmale Fabian Kosmale
              emmenlau Mario Emmenlauer
              2 Vote for this issue
              7 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes