aboutsummaryrefslogtreecommitdiff
path: root/toolchain/Android.cmake
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2018-06-29 19:43:29 +0200
committerAleix Pol <aleixpol@kde.org>2018-07-04 17:04:12 +0200
commitd6cc583f32a4ca0f05ccad8e30cf84b74e9e9561 (patch)
treecd142890b4c7eb49e1fb2170109410cffd9106c1 /toolchain/Android.cmake
parent484d5f4ceea2b8d23c9a0d35f16077f7cabfbd27 (diff)
downloadextra-cmake-modules-d6cc583f32a4ca0f05ccad8e30cf84b74e9e9561.tar.gz
extra-cmake-modules-d6cc583f32a4ca0f05ccad8e30cf84b74e9e9561.tar.bz2
Android: Make it possible to override a target's APK directoryv5.48.0-rc1v5.48.0
Summary: Some projects such as marble do some operations with the APK directory before building. This allows us the project to copy the apk directory over to the build directory and do whatever it pleases. Test Plan: Built Marble Reviewers: #frameworks, vkrause Reviewed By: vkrause Subscribers: vkrause, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D13403
Diffstat (limited to 'toolchain/Android.cmake')
-rw-r--r--toolchain/Android.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake
index 30d82a66..ab0fbcc0 100644
--- a/toolchain/Android.cmake
+++ b/toolchain/Android.cmake
@@ -108,6 +108,10 @@
#
# make create-apk-myapp ARGS="--sign ~/my.keystore alias_name"
#
+# In case it's needed for your application to set the APK directory from cmake
+# scripting you can also set the directory as the ANDROID_APK_DIR property of
+# the create-apk-myapp target.
+#
# See Android documentation on how to create a keystore to use
# =============================================================================
@@ -198,8 +202,13 @@ if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET "create-apk")
list(GET ANDROID_APK_DIR ${idx} APK_DIR)
if(APK_DIR AND NOT EXISTS "${APK_DIR}/AndroidManifest.xml")
message(FATAL_ERROR "Cannot find ${APK_DIR}/AndroidManifest.xml according to ANDROID_APK_DIR. ${ANDROID_APK_DIR} ${exportedTarget}")
+ elseif(NOT APK_DIR)
+ get_filename_component(_qt5Core_install_prefix "${Qt5Core_DIR}/../../../" ABSOLUTE)
+ set(ANDROID_APK_DIR "${_qt5Core_install_prefix}/src/android/templates/")
endif()
- ecm_androiddeployqt("${exportedTarget}" "${ECM_ADDITIONAL_FIND_ROOT_PATH}" "${APK_DIR}")
+
+ ecm_androiddeployqt("${exportedTarget}" "${ECM_ADDITIONAL_FIND_ROOT_PATH}")
+ set_target_properties(create-apk-${exportedTarget} PROPERTIES ANDROID_APK_DIR "${APK_DIR}")
endforeach()
else()
message(STATUS "You can export a target by specifying -DQTANDROID_EXPORTED_TARGET=<targetname> and -DANDROID_APK_DIR=<paths>")