I want to create a CMake project that contains only a QML (dll/dylib or static) library (resources included). My idea is to create a core QML library with all my stuff (custom components, style, theme, core icons, etc) and import it when needed in all my projects (like a .lib or a dll/dylib). At the same time, I would not want to change the components resources path in the top level project. I'm using Qt DesignStudio and Qt Creator for Qt 6.2.x.
Right now, I have created a folder into the import folder, adding this in the CMakeLists.txt
add_subdirectory(MyFrontEndCoreLib)
Then, I have added a UICoreComponents and an Image folders into MyFrontEndCoreLib folder. The CMakeLists.txt file into the UICoreComponents is the following:
qt_add_library(MyFrontEndCoreLib_UICoreComponents STATIC)
qt6_add_qml_module(MyFrontEndCoreLib_UICoreComponents
URI "MyFrontEndCoreLib.UICoreComponents"
VERSION 1.0
QML_FILES
IconLabel.qml
BorderedRectangle.qml
MyButton.qml
)
But I have no clue how to include this code/files into a library.
Thank you in advance