From 9e1d2a0eb15487f8f2acb4d91b281568897fb4e1 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Mon, 23 Aug 2021 16:29:18 +1000 Subject: Update qml examples for improved target path handling Some examples were still using the old "add as ordinary resources" approach for QML modules, others needed adjustment to the subdirectory structure to better reflect the URI structure of the QML modules involved. Task-number: QTBUG-95144 Pick-to: 6.2 Change-Id: Ie3399410cf6df491eb1e7b4a589ca26c577d82a0 Reviewed-by: Fabian Kosmale Reviewed-by: Alexandru Croitor --- .../referenceexamples/valuesource/CMakeLists.txt | 23 +++++----------------- 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'examples/qml/referenceexamples/valuesource') diff --git a/examples/qml/referenceexamples/valuesource/CMakeLists.txt b/examples/qml/referenceexamples/valuesource/CMakeLists.txt index f3653ac4e2..3e997bb8f8 100644 --- a/examples/qml/referenceexamples/valuesource/CMakeLists.txt +++ b/examples/qml/referenceexamples/valuesource/CMakeLists.txt @@ -35,17 +35,11 @@ target_link_libraries(valuesource PUBLIC Qt::Qml ) - -# Resources: -set(valuesource_resource_files - "example.qml" -) - -qt6_add_resources(valuesource "valuesource" - PREFIX - "/" - FILES - ${valuesource_resource_files} +qt_add_qml_module(valuesource + URI People + VERSION 1.0 + QML_FILES example.qml + NO_RESOURCE_TARGET_PATH ) install(TARGETS valuesource @@ -53,10 +47,3 @@ install(TARGETS valuesource BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -set_target_properties(valuesource PROPERTIES - QT_QML_MODULE_VERSION 1.0 - QT_QML_MODULE_URI People -) - -qt6_qml_type_registration(valuesource) -- cgit v1.2.3