summaryrefslogtreecommitdiff
path: root/cmake/QtPlatformAndroid.cmake
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-10-18 14:28:08 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-10-18 13:20:46 +0000
commit373be4200b162ae9b2244d7019770911bc73317a (patch)
treebdefc6a7e22402d7e08d3b3d2150870a129fc565 /cmake/QtPlatformAndroid.cmake
parent7e7f41e40c39361059ce4693c5e3a5e1ccd6f7e5 (diff)
downloadqtbase-373be4200b162ae9b2244d7019770911bc73317a.tar.gz
Add conversion code for Java code
Add support to pro2cmake to convert java code for android. Add support to override API_LEVEL for the Android sdk jar file. If the sdk is not found, we'll default to the one located by QT_ANDROID_JAR. Change-Id: If0b746dc7f9148ac43e6592a4a4dd23d46bbd4cd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtPlatformAndroid.cmake')
-rw-r--r--cmake/QtPlatformAndroid.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/QtPlatformAndroid.cmake b/cmake/QtPlatformAndroid.cmake
index cb335da831..3532217722 100644
--- a/cmake/QtPlatformAndroid.cmake
+++ b/cmake/QtPlatformAndroid.cmake
@@ -27,6 +27,18 @@ if (NOT IS_DIRECTORY "${ANDROID_SDK_ROOT}")
message(FATAL_ERROR "Could not find ANDROID_SDK_ROOT or path is not a directory: ${ANDROID_SDK_ROOT}")
endif()
+# Get the Android SDK jar for an API version other than the one specified with
+# QT_ANDROID_API_VERSION.
+function(qt_get_android_sdk_jar_for_api api out_jar_location)
+ set(jar_location "${ANDROID_SDK_ROOT}/platforms/${api}/android.jar")
+ if (NOT EXISTS "${jar_location}")
+ message(WARNING "Could not locate Android SDK jar for api '${api}', defaulting to ${QT_ANDROID_API_VERSION}")
+ set(${out_jar_location} ${QT_ANDROID_JAR} PARENT_SCOPE)
+ else()
+ set(${out_jar_location} ${jar_location} PARENT_SCOPE)
+ endif()
+endfunction()
+
# Minimum recommend android SDK api version
set(QT_ANDROID_API_VERSION "android-21")