Defines a build target that runs androiddeployqt to produce an APK.
The command is defined in the Core
component of the Qt6
package, which can be loaded like so:
find_package(Qt6 REQUIRED COMPONENTS Core)
This command was introduced in Qt 6.0.
Note: This command is in technology preview and may change in future releases.
Note: This command should only be called if targeting the Android platform.
qt_android_add_apk_target(target)
If versionless commands are disabled, use qt6_android_add_apk_target()
instead. It supports the same set of arguments as this
command.
The <target>_make_apk
and <target>_make_aab
custom targets created by this command take an Android deployment settings file and generate APK and AAB respectively by running
androiddeployqt
. The location of the settings file is taken from the target
's QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
property. This file is typically created by qt_android_generate_deployment_settings(). The respective Android package will be generated in an android-build
subdirectory below the CMake build directory of the target
.
The <target>_make_apk
and <target>_make_aab
targets will be automatically added as dependencies of the apk
and aab
build targets respectively, which will be
created automatically. Creating of the apk
and aab
targets can be disabled by setting the QT_NO_GLOBAL_APK_TARGET
and QT_NO_GLOBAL_AAB_TARGET
variables to
TRUE
.
qt_android_generate_deployment_settings(myapp) qt_android_add_apk_target(myapp)
The above commands define the myapp_make_apk
, myapp_make_aab
, apk
, and aab
build targets which can be used to generate just the myapp
packages or all APKs and
AABs in the project respectively.
See also qt_android_generate_deployment_settings(), qt_finalize_target(), and qt_finalize_project().
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: