diff options
author | Craig Scott <craig.scott@qt.io> | 2021-08-23 18:26:06 +1000 |
---|---|---|
committer | Craig Scott <craig.scott@qt.io> | 2021-08-24 16:08:21 +1000 |
commit | a86fd709dd4d315cfe4fea77ea0bc730131fe840 (patch) | |
tree | d63e9a2240f00f298905b11cddcac49cb0ee25be /examples/quick/scenegraph/metaltextureimport/CMakeLists.txt | |
parent | 9e1d2a0eb15487f8f2acb4d91b281568897fb4e1 (diff) |
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 <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/metaltextureimport/CMakeLists.txt')
-rw-r--r-- | examples/quick/scenegraph/metaltextureimport/CMakeLists.txt | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/examples/quick/scenegraph/metaltextureimport/CMakeLists.txt b/examples/quick/scenegraph/metaltextureimport/CMakeLists.txt index 6bcad68e6e..eb3740f6ef 100644 --- a/examples/quick/scenegraph/metaltextureimport/CMakeLists.txt +++ b/examples/quick/scenegraph/metaltextureimport/CMakeLists.txt @@ -27,6 +27,9 @@ qt_add_executable(metaltextureimport set_target_properties(metaltextureimport PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE + + # Prevent name clash with build subdirectory on case-insensitive file systems + OUTPUT_NAME metaltextureimportapp ) target_link_libraries(metaltextureimport PUBLIC "-framework Metal" @@ -36,36 +39,26 @@ target_link_libraries(metaltextureimport PUBLIC Qt::Quick ) - -# Resources: -set(metaltextureimport_resource_files - "main.qml" - "squircle.frag" - "squircle.vert" -) - -qt6_add_resources(metaltextureimport "metaltextureimport" - PREFIX - "/scenegraph/metaltextureimport" - FILES - ${metaltextureimport_resource_files} -) - if(MACOS) target_link_libraries(metaltextureimport PUBLIC "-framework AppKit" ) endif() +qt_add_qml_module(metaltextureimport + URI MetalTextureImport + VERSION 1.0 + QML_FILES + main.qml + RESOURCES + squircle.frag + squircle.vert + RESOURCE_PREFIX /scenegraph/metaltextureimport + NO_RESOURCE_TARGET_PATH +) + install(TARGETS metaltextureimport RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -set_target_properties(metaltextureimport PROPERTIES - QT_QML_MODULE_VERSION 1.0 - QT_QML_MODULE_URI MetalTextureImport -) - -qt6_qml_type_registration(metaltextureimport) |