diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index da1cfe7ece5..a8843e46755 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -54,8 +54,17 @@ function(qt6_android_generate_deployment_settings target) if (NOT target_output_name) set(target_output_name ${target}) endif() + + # QtCreator requires the file name of deployment settings has no config related suffixes + # to run androiddeployqt correctly. If we use multi-config generator for the first config + # in a list avoid adding any configuration-specific suffixes. + get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG) + if(is_multi_config) + list(GET CMAKE_CONFIGURATION_TYPES 0 first_config_type) + set(config_suffix "$<$>:-$>") + endif() set(deploy_file - "${target_binary_dir}/android-${target_output_name}-deployment-settings-$.json") + "${target_binary_dir}/android-${target_output_name}-deployment-settings${config_suffix}.json") set(file_contents "{\n") # content begin