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 <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2021-11-23 13:28:09 +01:00
parent 2bfa4b9960
commit bcac7d9433

View File

@ -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 "$<$<NOT:$<CONFIG:${first_config_type}>>:-$<CONFIG>>")
endif()
set(deploy_file
"${target_binary_dir}/android-${target_output_name}-deployment-settings-$<CONFIG>.json")
"${target_binary_dir}/android-${target_output_name}-deployment-settings${config_suffix}.json")
set(file_contents "{\n")
# content begin