aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/chattutorial/chapter5/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quickcontrols/chattutorial/chapter5/CMakeLists.txt')
-rw-r--r--examples/quickcontrols/chattutorial/chapter5/CMakeLists.txt39
1 files changed, 21 insertions, 18 deletions
diff --git a/examples/quickcontrols/chattutorial/chapter5/CMakeLists.txt b/examples/quickcontrols/chattutorial/chapter5/CMakeLists.txt
index dfffa0f6de..fa20c96d2d 100644
--- a/examples/quickcontrols/chattutorial/chapter5/CMakeLists.txt
+++ b/examples/quickcontrols/chattutorial/chapter5/CMakeLists.txt
@@ -1,17 +1,11 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(chapter5 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcontrols/chattutorial/chapter5")
-
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Sql)
qt_add_executable(chattutorial-chapter5 WIN32 MACOSX_BUNDLE
@@ -21,22 +15,22 @@ qt_add_executable(chattutorial-chapter5 WIN32 MACOSX_BUNDLE
)
target_link_libraries(chattutorial-chapter5 PRIVATE
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Quick
- Qt::Sql
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Qml
+ Qt6::Quick
+ Qt6::Sql
)
qt_policy(SET QTP0001 NEW)
qt_add_qml_module(chattutorial-chapter5
- URI chapter5
+ URI chattutorial
QML_FILES
"+Material/ChatToolBar.qml"
"ChatToolBar.qml"
"ContactPage.qml"
"ConversationPage.qml"
- "main.qml"
+ "Main.qml"
RESOURCES
"images/Albert_Einstein.png"
"images/Albert_Einstein@2x.png"
@@ -60,7 +54,16 @@ qt6_add_resources(chattutorial-chapter5 "conf"
)
install(TARGETS chattutorial-chapter5
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION .
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+qt_generate_deploy_qml_app_script(
+ TARGET chattutorial-chapter5
+ OUTPUT_SCRIPT deploy_script
+ MACOS_BUNDLE_POST_BUILD
+ NO_UNSUPPORTED_PLATFORM_ERROR
+ DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
)
+install(SCRIPT ${deploy_script})