summaryrefslogtreecommitdiffstats
path: root/examples/corelib/platform/androidnotifier/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/corelib/platform/androidnotifier/CMakeLists.txt')
-rw-r--r--examples/corelib/platform/androidnotifier/CMakeLists.txt27
1 files changed, 17 insertions, 10 deletions
diff --git a/examples/corelib/platform/androidnotifier/CMakeLists.txt b/examples/corelib/platform/androidnotifier/CMakeLists.txt
index 0caa208a95..b356b15a43 100644
--- a/examples/corelib/platform/androidnotifier/CMakeLists.txt
+++ b/examples/corelib/platform/androidnotifier/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(androidnotifier LANGUAGES CXX)
@@ -5,24 +8,21 @@ if(NOT ANDROID)
message(FATAL_ERROR "Example only works on Android")
endif()
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
find_package(Qt6 REQUIRED COMPONENTS Widgets)
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/corelib/platform/androidnotifier")
+qt_standard_project_setup()
qt_add_executable(androidnotifier
MANUAL_FINALIZATION
main.cpp
notificationclient.cpp
notificationclient.h
+ android/src/org/qtproject/example/androidnotifier/NotificationClient.java
+ android/AndroidManifest.xml
)
target_link_libraries(androidnotifier PRIVATE
+ Qt6::CorePrivate
Qt6::Widgets
)
@@ -44,7 +44,14 @@ qt_add_resources(androidnotifier "main"
)
install(TARGETS androidnotifier
- 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 androidnotifier
+ OUTPUT_SCRIPT deploy_script
+ NO_UNSUPPORTED_PLATFORM_ERROR
)
+install(SCRIPT ${deploy_script})