QT_ANDROID_COMPILE_SDK_VERSION

Android target SDK version.

该特性在 Qt 6.9 引入。

注意: This property is used only if targeting the Android platform.

Specifies the version of the Android SDK against which your application is compiled. This is propagated to build.gradle as compileSdkVersion . This value can be provided via androiddeployqt 's --android-platform parameter which takes precedence over this CMake property.

set_target_properties(${target} PROPERTIES
    QT_ANDROID_COMPILE_SDK_VERSION 36
)
					

The following format also works:

set_target_properties(${target} PROPERTIES
 QT_ANDROID_COMPILE_SDK_VERSION "android-36"
)
					

另请参阅 qt_android_generate_deployment_settings() and QT_ANDROID_TARGET_SDK_VERSION .