aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/adding/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml/referenceexamples/adding/CMakeLists.txt')
-rw-r--r--examples/qml/referenceexamples/adding/CMakeLists.txt52
1 files changed, 37 insertions, 15 deletions
diff --git a/examples/qml/referenceexamples/adding/CMakeLists.txt b/examples/qml/referenceexamples/adding/CMakeLists.txt
index 5f2b272d3f..4febb6fb06 100644
--- a/examples/qml/referenceexamples/adding/CMakeLists.txt
+++ b/examples/qml/referenceexamples/adding/CMakeLists.txt
@@ -1,21 +1,43 @@
# Generated from adding.pro.
-#####################################################################
-## adding Binary:
-#####################################################################
-
-add_qt_executable(adding
- GUI
- OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/adding"
- INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/adding"
- SOURCES
- main.cpp
- person.cpp person.h
- PUBLIC_LIBRARIES
- Qt::Qml
+cmake_minimum_required(VERSION 3.14)
+project(adding LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Qml)
+
+add_qt_gui_executable(adding
+ main.cpp
+ person.cpp person.h
+)
+target_link_libraries(adding PUBLIC
+ Qt::Core
+ Qt::Qml
)
# Resources:
-add_qt_resource(adding "adding" FILES
- example.qml)
+set(adding_resource_files
+ "example.qml"
+)
+
+QT6_ADD_RESOURCES(adding "adding"
+ PREFIX
+ "/"
+ FILES
+ ${adding_resource_files}
+)
+
+install(TARGETS adding
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)