From 7d48b64f41083dde3dcb7fcee8cef0f4db6417f8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 26 Apr 2021 12:45:33 +0200 Subject: [PATCH] Add QT_ANDROID_TARGET_SDK_VERSION target property This is the counterpart of the qmake variable ANDROID_TARGET_SDK_VERSION. Pick-to: 6.1 Task-number: QTBUG-86033 Change-Id: Idd64ee06eb94826430e6be5d9d878631db67c949 Reviewed-by: Alexandru Croitor Reviewed-by: Assam Boudjelthia --- src/corelib/Qt6AndroidMacros.cmake | 7 +++++++ src/corelib/doc/src/cmake-macros.qdoc | 1 + src/corelib/doc/src/cmake-properties.qdoc | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index ada8495a98..ab793d3499 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -168,6 +168,13 @@ function(qt6_android_generate_deployment_settings target) " \"android-min-sdk-version\": \"${android_min_sdk_version}\",\n") endif() + # target SDK version + get_target_property(android_target_sdk_version ${target} QT_ANDROID_TARGET_SDK_VERSION) + if(android_target_sdk_version) + string(APPEND file_contents + " \"android-target-sdk-version\": \"${android_target_sdk_version}\",\n") + endif() + get_target_property(qml_import_path ${target} QT_QML_IMPORT_PATH) if (qml_import_path) set(_import_paths "") diff --git a/src/corelib/doc/src/cmake-macros.qdoc b/src/corelib/doc/src/cmake-macros.qdoc index ffbf673a32..29c1785b67 100644 --- a/src/corelib/doc/src/cmake-macros.qdoc +++ b/src/corelib/doc/src/cmake-macros.qdoc @@ -530,6 +530,7 @@ how to accomplish this. \li \l{cmake-target-property-QT_ANDROID_EXTRA_PLUGINS}{QT_ANDROID_EXTRA_PLUGINS} \li \l{cmake-target-property-QT_ANDROID_MIN_SDK_VERSION}{QT_ANDROID_MIN_SDK_VERSION} \li \l{cmake-target-property-QT_ANDROID_PACKAGE_SOURCE_DIR}{QT_ANDROID_PACKAGE_SOURCE_DIR} +\li \l{cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION}{QT_ANDROID_TARGET_SDK_VERSION} \li \l{cmake-target-property-QT_ANDROID_VERSION_NAME}{QT_ANDROID_VERSION_NAME} \li \l{cmake-target-property-QT_ANDROID_VERSION_CODE}{QT_ANDROID_VERSION_CODE} \li \l{cmake-target-property-QT_QML_IMPORT_PATH}{QT_QML_IMPORT_PATH} diff --git a/src/corelib/doc/src/cmake-properties.qdoc b/src/corelib/doc/src/cmake-properties.qdoc index 8d2dce5b15..ced2798f62 100644 --- a/src/corelib/doc/src/cmake-properties.qdoc +++ b/src/corelib/doc/src/cmake-properties.qdoc @@ -161,6 +161,24 @@ then place this directly into the directory specified by this variable. \sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()} */ +/*! +\page cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION.html +\ingroup cmake-properties-qtcore +\ingroup cmake-target-properties-qtcore + +\title QT_ANDROID_TARGET_SDK_VERSION +\target cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION + +\brief Android target SDK version. + +\preliminarycmakeproperty +\cmakepropertyandroidonly + +Specifies the target Android API level for the target. + +\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()} +*/ + /*! \page cmake-target-property-QT_ANDROID_VERSION_CODE.html \ingroup cmake-properties-qtcore