summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-04-26 12:14:46 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-04-26 23:11:28 +0200
commit8fdaa081fdf1749fabf23dcb4b9b07e800b785a0 (patch)
tree12d9beaf64c92c0fd0c123ad98ce30f9c0f9883c
parentadf29329ead34e4fa805ef19370b2e5172bd61e0 (diff)
Add QT_ANDROID_VERSION_{NAME|CODE} target properties
Those are the CMake counterparts of the qmake variables ANDROID_VERSION_{NAME|CODE}. Pick-to: 6.1 Task-number: QTBUG-86033 Change-Id: I57534ff04db0c78871fe7ba81bedaf377422054b Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
-rw-r--r--src/corelib/Qt6AndroidMacros.cmake14
-rw-r--r--src/corelib/doc/src/cmake-macros.qdoc2
-rw-r--r--src/corelib/doc/src/cmake-properties.qdoc42
3 files changed, 56 insertions, 2 deletions
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake
index c520242d06..182d004575 100644
--- a/src/corelib/Qt6AndroidMacros.cmake
+++ b/src/corelib/Qt6AndroidMacros.cmake
@@ -147,9 +147,19 @@ function(qt6_android_generate_deployment_settings target)
" \"android-package-source-directory\": \"${android_package_source_dir_native}\",\n")
endif()
- #TODO: ANDROID_VERSION_NAME, doesn't seem to be used?
+ # version code
+ get_target_property(android_version_code ${target} QT_ANDROID_VERSION_CODE)
+ if (android_version_code)
+ string(APPEND file_contents
+ " \"android-version-code\": \"${android_version_code}\",\n")
+ endif()
- #TODO: ANDROID_VERSION_CODE, doesn't seem to be used?
+ # version name
+ get_target_property(android_version_name ${target} QT_ANDROID_VERSION_NAME)
+ if (android_version_name)
+ string(APPEND file_contents
+ " \"android-version-name\": \"${android_version_name}\",\n")
+ endif()
get_target_property(qml_import_path ${target} QT_QML_IMPORT_PATH)
if (qml_import_path)
diff --git a/src/corelib/doc/src/cmake-macros.qdoc b/src/corelib/doc/src/cmake-macros.qdoc
index d14fc5badb..53aebfba17 100644
--- a/src/corelib/doc/src/cmake-macros.qdoc
+++ b/src/corelib/doc/src/cmake-macros.qdoc
@@ -529,6 +529,8 @@ how to accomplish this.
\li \l{cmake-target-property-QT_ANDROID_EXTRA_LIBS}{QT_ANDROID_EXTRA_LIBS}
\li \l{cmake-target-property-QT_ANDROID_EXTRA_PLUGINS}{QT_ANDROID_EXTRA_PLUGINS}
\li \l{cmake-target-property-QT_ANDROID_PACKAGE_SOURCE_DIR}{QT_ANDROID_PACKAGE_SOURCE_DIR}
+\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}
\li \l{cmake-target-property-QT_QML_ROOT_PATH}{QT_QML_ROOT_PATH}
\li \l{cmake-target-property-qt_no_entrypoint}{qt_no_entrypoint}
diff --git a/src/corelib/doc/src/cmake-properties.qdoc b/src/corelib/doc/src/cmake-properties.qdoc
index 87809dcd08..5887875cab 100644
--- a/src/corelib/doc/src/cmake-properties.qdoc
+++ b/src/corelib/doc/src/cmake-properties.qdoc
@@ -144,6 +144,48 @@ then place this directly into the directory specified by this variable.
*/
/*!
+\page cmake-target-property-QT_ANDROID_VERSION_CODE.html
+\ingroup cmake-properties-qtcore
+\ingroup cmake-target-properties-qtcore
+
+\title QT_ANDROID_VERSION_CODE
+\target cmake-target-property-QT_ANDROID_VERSION_CODE
+
+\brief Internal Android app version.
+
+\preliminarycmakeproperty
+\cmakepropertyandroidonly
+
+Specifies the app's version number. This is usually a number that
+increments monotonically with each release of your project.
+
+For more information, see \l{Android: App Versioning}{Android App Versioning}.
+
+\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
+*/
+
+/*!
+\page cmake-target-property-QT_ANDROID_VERSION_NAME.html
+\ingroup cmake-properties-qtcore
+\ingroup cmake-target-properties-qtcore
+
+\title QT_ANDROID_VERSION_NAME
+\target cmake-target-property-QT_ANDROID_VERSION_NAME
+
+\brief Human-readable Android app version.
+
+\preliminarycmakeproperty
+\cmakepropertyandroidonly
+
+Specifies the app's version as a human readable string, usually three
+numbers, separated by dots.
+
+For more information, see \l{Android: App Versioning}{Android App Versioning}.
+
+\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
+*/
+
+/*!
\page cmake-target-property-QT_QML_ROOT_PATH.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore