Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Supplementing qt6_add_qml_module in CMake
Forum Updated to NodeBB v4.3 + New Features

Supplementing qt6_add_qml_module in CMake

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 3 Posters 717 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    danzigex616
    wrote on last edited by
    #1

    I am trying to replicate the functionality of the qt6_add_qml_module via CMake as I have to try and downgrade from qt6 to qt5 without too much modification to the original source.

    Would anyone know of the exact functionality or link to where the command is defined? I tried checking through the qt-base git repo to see if I can find the exact functionality, but did not have any luck.

    semlanikS 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      That's rather something I would expect in the qtdeclarative module.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D danzigex616

        I am trying to replicate the functionality of the qt6_add_qml_module via CMake as I have to try and downgrade from qt6 to qt5 without too much modification to the original source.

        Would anyone know of the exact functionality or link to where the command is defined? I tried checking through the qt-base git repo to see if I can find the exact functionality, but did not have any luck.

        semlanikS Offline
        semlanikS Offline
        semlanik
        wrote on last edited by
        #3

        @danzigex616 said in Supplementing qt6_add_qml_module in CMake:

        tried checking through

        Hi @danzigex616 it's quite difficult to back port the API to Qt5, especially because it depends on C++ code in the Qml tools and the library it self. Anyway, the starting point is here https://github.com/qt/qtdeclarative/blob/dev/src/qml/Qt6QmlMacros.cmake, good luck :)

        1 Reply Last reply
        1
        • D Offline
          D Offline
          danzigex616
          wrote on last edited by
          #4

          Thanks to @SGaist and @semlanik for pointing me in the right direction. Hopefully I will be able to modify things to work. 😅

          1 Reply Last reply
          0
          • D Offline
            D Offline
            danzigex616
            wrote on last edited by
            #5

            Currently I am able to build my shared objects. I was able to simply use
            add_library(), as well as target_include_directories(). However, since qt_add_qml_modules() does a lot more under the hood I still have more work to do.

            I was able to auto-generate qmldir files (using the write capability of CMake).

            I am currently trying to invoke qt5's qmltyperegistrar with parameters to correctly generate my .qmltypes files, however I seem to be missing the *_metatypes.json, my *_*Plugin.cpp file, and my *_qmltyperegistrations.cpp is very bare.

            I am unsure if there is an additional stage before the type registration, there are references to lint as well as auto_MOC.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved