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-25 10:44:41 +1000 |
commit | 5cdec4e0c7b0d292c4d099189dd27c19eb314f2d (patch) | |
tree | c80c25cb9b5c40fbb39fe4aea88636085987108f /examples/quick/scenegraph/customgeometry | |
parent | 58127aa35945dc76bd71b69b25d141025267f4c8 (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
Change-Id: I3f1814a29af608461daa90477eca0aa2304eb9d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a86fd709dd4d315cfe4fea77ea0bc730131fe840)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick/scenegraph/customgeometry')
-rw-r--r-- | examples/quick/scenegraph/customgeometry/.prev_CMakeLists.txt | 60 | ||||
-rw-r--r-- | examples/quick/scenegraph/customgeometry/CMakeLists.txt | 24 |
2 files changed, 6 insertions, 78 deletions
diff --git a/examples/quick/scenegraph/customgeometry/.prev_CMakeLists.txt b/examples/quick/scenegraph/customgeometry/.prev_CMakeLists.txt deleted file mode 100644 index 28613e67a3..0000000000 --- a/examples/quick/scenegraph/customgeometry/.prev_CMakeLists.txt +++ /dev/null @@ -1,60 +0,0 @@ -# Generated from customgeometry.pro. - -cmake_minimum_required(VERSION 3.14) -project(customgeometry LANGUAGES CXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/customgeometry") - -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) - -qt_add_executable(customgeometry - beziercurve.cpp beziercurve.h - main.cpp -) -set_target_properties(customgeometry PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_link_libraries(customgeometry PUBLIC - Qt::Core - Qt::Gui - Qt::Quick -) - - -# Resources: -set(customgeometry_resource_files - "main.qml" -) - -qt6_add_resources(customgeometry "customgeometry" - PREFIX - "/scenegraph/customgeometry" - FILES - ${customgeometry_resource_files} -) - -install(TARGETS customgeometry - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) - -set_target_properties(customgeometry PROPERTIES - QT_QML_MODULE_VERSION 1.0 - QT_QML_MODULE_URI CustomGeometry -) - -qt6_qml_type_registration(customgeometry) diff --git a/examples/quick/scenegraph/customgeometry/CMakeLists.txt b/examples/quick/scenegraph/customgeometry/CMakeLists.txt index c853f9a543..4e3d13d08a 100644 --- a/examples/quick/scenegraph/customgeometry/CMakeLists.txt +++ b/examples/quick/scenegraph/customgeometry/CMakeLists.txt @@ -33,17 +33,12 @@ target_link_libraries(customgeometry_declarative PUBLIC # special case Qt::Quick ) - -# Resources: -set(customgeometry_resource_files - "main.qml" -) - -qt6_add_resources(customgeometry_declarative "customgeometry" # special case - PREFIX - "/scenegraph/customgeometry" - FILES - ${customgeometry_resource_files} +qt_add_qml_module(customgeometry_declarative + URI CustomGeometry + VERSION 1.0 + QML_FILES main.qml + RESOURCE_PREFIX /scenegraph/customgeometry + NO_RESOURCE_TARGET_PATH ) install(TARGETS customgeometry_declarative # special case @@ -51,10 +46,3 @@ install(TARGETS customgeometry_declarative # special case BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -set_target_properties(customgeometry_declarative PROPERTIES # special case - QT_QML_MODULE_VERSION 1.0 - QT_QML_MODULE_URI CustomGeometry -) - -qt6_qml_type_registration(customgeometry_declarative) # special case |