Supplementing qt6_add_qml_module in CMake
-
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.
-
Hi and welcome to devnet,
That's rather something I would expect in the qtdeclarative module.
-
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.
@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 :)
-
Currently I am able to build my shared objects. I was able to simply use
add_library()
, as well astarget_include_directories()
. However, sinceqt_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.