Defines a build target that runs androiddeployqt to produce an APK.
命令的定义在
核心
组件对于
Qt6
包,可以像这样加载:
find_package(Qt6 REQUIRED COMPONENTS Core)
该命令在 Qt 6.0 引入。
警告: This command is deprecated since Qt 6.5. Use qt_add_executable 代替。
注意: This command should only be called if targeting the Android platform.
qt_android_add_apk_target(target)
若
无版本命令
被禁用,使用
qt6_android_add_apk_target()
代替。它支持如此命令的一组相同自变量。
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
变量到
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
,和
aab
build targets which can be used to generate just the
myapp
packages or all APKs and AABs in the project respectively.
另请参阅 qt_android_generate_deployment_settings() , qt_finalize_target() ,和 qt_finalize_project() .