From a86fd709dd4d315cfe4fea77ea0bc730131fe840 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Mon, 23 Aug 2021 18:26:06 +1000 Subject: Update quick examples to new QML CMake API This is a pre-requisite to being able to make qt6_qml_type_registration() an internal rather than public command. Not all examples have been updated, only those that were using the qt6_qml_type_registration() command. Task-number: QTBUG-95093 Pick-to: 6.2 Change-Id: I3f1814a29af608461daa90477eca0aa2304eb9d1 Reviewed-by: Alexandru Croitor --- .../quick/scenegraph/custommaterial/CMakeLists.txt | 30 ++++++++-------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'examples/quick/scenegraph/custommaterial/CMakeLists.txt') diff --git a/examples/quick/scenegraph/custommaterial/CMakeLists.txt b/examples/quick/scenegraph/custommaterial/CMakeLists.txt index 06d9dd325f..d372b28bc9 100644 --- a/examples/quick/scenegraph/custommaterial/CMakeLists.txt +++ b/examples/quick/scenegraph/custommaterial/CMakeLists.txt @@ -35,19 +35,16 @@ target_link_libraries(custommaterial_declarative PUBLIC # special case Qt::Quick ) - -# Resources: -set(custommaterial_resource_files - "main.qml" - "shaders/mandelbrot.frag.qsb" - "shaders/mandelbrot.vert.qsb" -) - -qt6_add_resources(custommaterial_declarative "custommaterial" # special case - PREFIX - "/scenegraph/custommaterial" - FILES - ${custommaterial_resource_files} +qt_add_qml_module(custommaterial_declarative + URI ExampleCustomMaterial + VERSION 1.0 + QML_FILES + main.qml + RESOURCES + shaders/mandelbrot.frag.qsb + shaders/mandelbrot.vert.qsb + RESOURCE_PREFIX /scenegraph/custommaterial + NO_RESOURCE_TARGET_PATH ) install(TARGETS custommaterial_declarative # special case @@ -55,10 +52,3 @@ install(TARGETS custommaterial_declarative # special case BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -set_target_properties(custommaterial_declarative PROPERTIES # special case - QT_QML_MODULE_VERSION 1.0 - QT_QML_MODULE_URI ExampleCustomMaterial -) - -qt6_qml_type_registration(custommaterial_declarative) # special case -- cgit v1.2.3