message("\n${BoldRed}Now configuring src/js_qml for ${TARGET}${ColourReset}\n")


########################################################
# Files
set(${TARGET}_js_qml_cpp_SRCS

    ellipse.cpp
)

set(${TARGET}_qml_SRCS

qml/Main.qml
qml/test.qml
qml/test_datapoint.qml
qml/test_mzintegrationparams.qml
)

qt6_add_resources(${TARGET}_js_qml_qrc_CPP ${TARGET}_js_qml.qrc)

qt_add_qml_module(
    ${TARGET}_qml
    URI
    ${TARGET}
    VERSION
    1.0
    # QML_FILES
    # ${${TARGET}_qml_SRCS}
    SOURCES
    ${${TARGET}_js_qml_cpp_SRCS}
    ${${TARGET}_js_qml_qrc_CPP}
    DEPENDENCIES
    QtQuick
    PappsoMS::PappsoMS
    OUTPUT_DIRECTORY
    "${CMAKE_BINARY_DIR}/qml/${TARGET}"
    NO_PLUGIN
)

target_link_libraries(
    ${TARGET}_qml
    PRIVATE Qt6::Core Qt6::Gui Qt6::Quick PappsoMS::PappsoMS
)

# Only now can we add the executable, because we have defined the sources of the
# object library above.

install(
    DIRECTORY ${CMAKE_BINARY_DIR}/qml/${TARGET}
    DESTINATION ${PROJECT_INSTALL_LIB_QML_DIR}
)
