summaryrefslogtreecommitdiffstats
path: root/src/android/templates/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/templates/CMakeLists.txt')
-rw-r--r--src/android/templates/CMakeLists.txt39
1 files changed, 27 insertions, 12 deletions
diff --git a/src/android/templates/CMakeLists.txt b/src/android/templates/CMakeLists.txt
index 8e007b7215..94f3243c22 100644
--- a/src/android/templates/CMakeLists.txt
+++ b/src/android/templates/CMakeLists.txt
@@ -1,19 +1,34 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# Android template files
-# special case skip regeneration
-# special case begin
set(template_files
- AndroidManifest.xml
- build.gradle)
+ "${CMAKE_CURRENT_SOURCE_DIR}/AndroidManifest.xml"
+ "${CMAKE_CURRENT_SOURCE_DIR}/build.gradle")
set(template_directories
- res)
+ "${CMAKE_CURRENT_SOURCE_DIR}/res")
+
+add_custom_target(Qt${QtBase_VERSION_MAJOR}AndroidTemplates
+ SOURCES
+ ${template_files}
+ "${CMAKE_CURRENT_SOURCE_DIR}/res/values/libs.xml"
+ "${CMAKE_CURRENT_SOURCE_DIR}/res/xml/qtprovider_paths.xml"
+)
+
+qt_path_join(destination ${QT_INSTALL_DIR} ${INSTALL_DATADIR} "src/android/templates")
+
+qt_copy_or_install(FILES ${template_files}
+ DESTINATION "${destination}")
-qt_install(FILES ${template_files}
- DESTINATION src/android/templates
- COMPONENT Devel)
+qt_copy_or_install(DIRECTORY ${template_directories}
+ DESTINATION "${destination}")
-qt_install(DIRECTORY ${template_directories}
- DESTINATION src/android/templates
- COMPONENT Devel)
-# special case end
+if(NOT QT_WILL_INSTALL)
+ qt_internal_copy_at_build_time(TARGET Qt${QtBase_VERSION_MAJOR}AndroidTemplates
+ FILES ${template_files}
+ DIRECTORIES ${template_directories}
+ DESTINATION ${destination}
+ )
+endif()