diff options
Diffstat (limited to 'examples/dbus/pingpong/CMakeLists.txt')
-rw-r--r-- | examples/dbus/pingpong/CMakeLists.txt | 61 |
1 files changed, 43 insertions, 18 deletions
diff --git a/examples/dbus/pingpong/CMakeLists.txt b/examples/dbus/pingpong/CMakeLists.txt index 6a2a84e974..d159ad9ba4 100644 --- a/examples/dbus/pingpong/CMakeLists.txt +++ b/examples/dbus/pingpong/CMakeLists.txt @@ -1,28 +1,53 @@ -# Generated from pong.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -cmake_minimum_required(VERSION 3.14) -project(pong LANGUAGES CXX) +cmake_minimum_required(VERSION 3.16) +project(pingpong LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) +if (ANDROID) + message(FATAL_ERROR "This project cannot be built on Android.") +endif() -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) +find_package(Qt6 REQUIRED COMPONENTS Core DBus) -set(INSTALL_EXAMPLEDIR "examples") +qt_standard_project_setup() -find_package(Qt6 COMPONENTS DBus) +qt_add_executable(ping + ping.cpp + ping-common.h +) -add_qt_gui_executable(pong +target_link_libraries(ping PRIVATE + Qt6::Core + Qt6::DBus +) + +qt_add_executable(pong ping-common.h - pong.cpp pong.h + pong.cpp +) + +target_link_libraries(pong PRIVATE + Qt6::Core + Qt6::DBus ) -target_link_libraries(pong PUBLIC - # Remove: gui - Qt::DBus + +install(TARGETS ping pong + BUNDLE DESTINATION . + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) -install(TARGETS pong - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" + +qt_generate_deploy_app_script( + TARGET ping + OUTPUT_SCRIPT deploy_script + NO_UNSUPPORTED_PLATFORM_ERROR +) +install(SCRIPT ${deploy_script}) + +qt_generate_deploy_app_script( + TARGET pong + OUTPUT_SCRIPT deploy_script + NO_UNSUPPORTED_PLATFORM_ERROR ) +install(SCRIPT ${deploy_script}) |