Adding QML into library with Qt6 and CMake. How?
-
Hello!
Is there any way to add QML components and JS to add to library with CMake? Is there any examples?
The global idea to share some universal QML components that written with pure QML and JS.@bogong said in Adding QML into library with Qt6 and CMake. How?:
Is there any way to add QML components and JS to add to library with CMake? Is there any examples?
Yes: https://doc.qt.io/qt-6/qt6-modernize-qml-modules.html
Simply load any Qt Quick example in Qt Creator to see how to use
qt_add_qml_module()
. This function can be used with a target that's created withqt_add_library()
. -
@bogong said in Adding QML into library with Qt6 and CMake. How?:
Is there any way to add QML components and JS to add to library with CMake? Is there any examples?
Yes: https://doc.qt.io/qt-6/qt6-modernize-qml-modules.html
Simply load any Qt Quick example in Qt Creator to see how to use
qt_add_qml_module()
. This function can be used with a target that's created withqt_add_library()
. -