Defines a build target that runs androiddeployqt to produce an APK.
命令的定义在
Core
组件对于
Qt6
package. Load the package with:
find_package(Qt6 COMPONENTS Core REQUIRED)
注意: This command is in technology preview and may change in future releases.
注意: This command should only be called if targeting the Android platform.
qt_android_add_apk_target(target)
若
无版本命令
被禁用,使用
qt6_android_add_apk_target()
代替。它支持如此命令的一组相同自变量。
<target>_make_apk
custom target created by this command takes an Android deployment settings file and generates an APK 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()
。
.apk
file will be generated in an
android-build
subdirectory below the CMake build directory of the
target
.
<target>_make_apk
target will be automatically added as a dependency of the
apk
build target, which will be created if it doesn't already exist. This can be disabled by setting the
QT_NO_GLOBAL_APK_TARGET
variable to true.
qt_android_generate_deployment_settings(myapp) qt_android_add_apk_target(myapp)
The above commands define the build targets
myapp_make_apk
and
apk
, which can be used to generate just the
myapp
APK or all APKs in the project respectively.
另请参阅 qt_android_generate_deployment_settings () 和 qt_finalize_target ().