summaryrefslogtreecommitdiffstats
path: root/examples/dbus/chat/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dbus/chat/CMakeLists.txt')
-rw-r--r--examples/dbus/chat/CMakeLists.txt54
1 files changed, 26 insertions, 28 deletions
diff --git a/examples/dbus/chat/CMakeLists.txt b/examples/dbus/chat/CMakeLists.txt
index 72bc4a7ff1..472d893dee 100644
--- a/examples/dbus/chat/CMakeLists.txt
+++ b/examples/dbus/chat/CMakeLists.txt
@@ -1,57 +1,55 @@
-# Generated from chat.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(chat LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
+find_package(Qt6 REQUIRED COMPONENTS Core DBus Gui Widgets)
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
+qt_standard_project_setup()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/dbus/chat")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS DBus)
-find_package(Qt6 COMPONENTS Widgets)
-
-# special case begin
set(chat_SRCS)
-qt6_add_dbus_interface(chat_SRCS
+qt_add_dbus_interface(chat_SRCS
org.example.chat.xml
chat_interface
)
-qt6_add_dbus_adaptor(chat_SRCS
+
+qt_add_dbus_adaptor(chat_SRCS
org.example.chat.xml
qobject.h
QObject
chat_adaptor
)
-# special case end
+
qt_add_executable(chat
chat.cpp chat.h
chatmainwindow.ui
- chatsetnickname.ui
- ${chat_SRCS} # special case
+ ${chat_SRCS}
)
+
set_target_properties(chat PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(chat PUBLIC
- Qt::Core
- Qt::DBus
- Qt::Gui
- Qt::Widgets
+
+target_link_libraries(chat PRIVATE
+ Qt6::Core
+ Qt6::DBus
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS chat
- 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_app_script(
+ TARGET chat
+ OUTPUT_SCRIPT deploy_script
+ NO_UNSUPPORTED_PLATFORM_ERROR
)
+install(SCRIPT ${deploy_script})