QT_ANDROID_COMPILE_SDK_VERSION
Android 目标 SDK 版本。
该属性在 Qt 6.9 中引入。
注意:此 属性仅在针对 Android 平台时使用。
指定应用程序编译所依据的 Android SDK 版本。该值将作为 `compileSdkVersion` 传递给 `build.gradle `。该值可通过`androiddeployqt` 的`--android-platform ` 参数提供,该参数优先于此 CMake 属性。
set_target_properties(${target} PROPERTIES
QT_ANDROID_COMPILE_SDK_VERSION 37.0
)以下格式同样有效:
set_target_properties(${target} PROPERTIES
QT_ANDROID_COMPILE_SDK_VERSION "android-37.0"
)从 API 级别 37 开始,每个 Android SDK 平台都带有次要 API 级别,因此请完整写出其名称。例如,应使用37.0 而不是37 ,因为后者无法匹配任何已安装的平台。
另请参阅 qt_android_generate_deployment_settings()和QT_ANDROID_TARGET_SDK_VERSION。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.