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.txt30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/android/templates/CMakeLists.txt b/src/android/templates/CMakeLists.txt
index d0f1f4bf71..94f3243c22 100644
--- a/src/android/templates/CMakeLists.txt
+++ b/src/android/templates/CMakeLists.txt
@@ -1,18 +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_path_join(destination ${QT_INSTALL_DIR} "src/android/templates")
qt_copy_or_install(FILES ${template_files}
DESTINATION "${destination}")
qt_copy_or_install(DIRECTORY ${template_directories}
DESTINATION "${destination}")
-# 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()