From a1445670f5860398b475ad8ed87ba0629275499e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 27 May 2024 14:59:02 +0200 Subject: [PATCH] CMake: Fix configs passed to qt_get_install_target_default_args Because the configs passed to the ALL_CMAKE_CONFIGS option were quoted cmake_parse_arguments(PARSE_ARGV) would escape the semicolon in the set value, effectively doing set(arg_ALL_CMAKE_CONFIGS "Release\;Debug") Then the list(GET arg_ALL_CMAKE_CONFIGS 0 first_config) call would essentially do set(first_config "Release;Debug") and the if(all_configs_count GREATER 1 AND NOT arg_CMAKE_CONFIG STREQUAL first_config) condition would never trigger because a single config string can never equal a double config string. Remove the quotes to ensure correct behavior. This won't really trigger any behavior change, because we exclude installation of Debug executables in -debug-and-release builds, but it will make --trace-expand logs less confusing. Amends f240d94f140ba1614828804efafd2fc5e6d00099 Pick-to: 6.7 Change-Id: I53179511c7698c90b33cb3ff2762cef680a99815 Reviewed-by: Alexey Edelev --- cmake/QtExecutableHelpers.cmake | 2 +- cmake/QtToolHelpers.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtExecutableHelpers.cmake b/cmake/QtExecutableHelpers.cmake index 7856e4111f1..08da17b7e00 100644 --- a/cmake/QtExecutableHelpers.cmake +++ b/cmake/QtExecutableHelpers.cmake @@ -177,7 +177,7 @@ function(qt_internal_add_executable name) qt_get_install_target_default_args( OUT_VAR install_targets_default_args CMAKE_CONFIG "${cmake_config}" - ALL_CMAKE_CONFIGS "${cmake_configs}" + ALL_CMAKE_CONFIGS ${cmake_configs} RUNTIME "${arg_INSTALL_DIRECTORY}" LIBRARY "${arg_INSTALL_DIRECTORY}" BUNDLE "${arg_INSTALL_DIRECTORY}") diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake index 54ddefa7608..0aef6a43a3d 100644 --- a/cmake/QtToolHelpers.cmake +++ b/cmake/QtToolHelpers.cmake @@ -204,7 +204,7 @@ function(qt_internal_add_tool target_name) OUT_VAR install_targets_default_args RUNTIME "${install_dir}" CMAKE_CONFIG "${cmake_config}" - ALL_CMAKE_CONFIGS "${cmake_configs}") + ALL_CMAKE_CONFIGS ${cmake_configs}) # Make installation optional for targets that are not built by default in this config if(QT_FEATURE_debug_and_release