From bcac7d94334d178dcf55930f4cef972a3eb749bd Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Tue, 23 Nov 2021 13:28:09 +0100 Subject: [PATCH] Use config-specific suffix of android deployment settings for multi-config only QtCreator doesn't expect any config-specific suffixes in the android deployment settings file, when running androiddeployqt. This avoids adding the config-specific suffix in the single-config builds and for the first config in the multi-config builds. Amends a41d9bcac90af5d8f528d6198ea91f25e5189082 Change-Id: I606509c9bfd2e75cac144aca37b4568639aae74f Reviewed-by: Alexandru Croitor --- src/corelib/Qt6AndroidMacros.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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