aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/chattutorial/chapter3/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quickcontrols/chattutorial/chapter3/CMakeLists.txt')
-rw-r--r--examples/quickcontrols/chattutorial/chapter3/CMakeLists.txt62
1 files changed, 62 insertions, 0 deletions
diff --git a/examples/quickcontrols/chattutorial/chapter3/CMakeLists.txt b/examples/quickcontrols/chattutorial/chapter3/CMakeLists.txt
new file mode 100644
index 0000000000..92545ec1d0
--- /dev/null
+++ b/examples/quickcontrols/chattutorial/chapter3/CMakeLists.txt
@@ -0,0 +1,62 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(chapter3 LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcontrols2/chattutorial/chapter3")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
+
+qt_add_executable(chattutorial-chapter3 WIN32 MACOSX_BUNDLE
+ main.cpp
+)
+
+target_link_libraries(chattutorial-chapter3 PRIVATE
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+)
+
+# Resources:
+qt_add_qml_module(chattutorial-chapter3
+ URI chapter3
+ VERSION 1.0
+ QML_FILES
+ "ContactPage.qml"
+ "ConversationPage.qml"
+ "main.qml"
+ RESOURCES
+ "images/Albert_Einstein.png"
+ "images/Albert_Einstein@2x.png"
+ "images/Albert_Einstein@3x.png"
+ "images/Albert_Einstein@4x.png"
+ "images/Ernest_Hemingway.png"
+ "images/Ernest_Hemingway@2x.png"
+ "images/Ernest_Hemingway@3x.png"
+ "images/Ernest_Hemingway@4x.png"
+ "images/Hans_Gude.png"
+ "images/Hans_Gude@2x.png"
+ "images/Hans_Gude@3x.png"
+ "images/Hans_Gude@4x.png"
+)
+
+qt6_add_resources(chattutorial-chapter3 "conf"
+ PREFIX
+ "/"
+ FILES
+ "qtquickcontrols2.conf"
+)
+
+install(TARGETS chattutorial-chapter3
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)