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>
This commit is contained in:
Joerg Bornemann 2021-04-26 12:14:46 +02:00
parent adf29329ea
commit 8fdaa081fd
3 changed files with 56 additions and 2 deletions

View File

@ -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)

View File

@ -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}

View File

@ -143,6 +143,48 @@ 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_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