From 8194f790533fbd2c499feb1187774caab7eceb47 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 12 Apr 2021 11:34:24 +0200 Subject: [PATCH] Use bracket-based escaping for all list arguments in a configure string The 'list(TRANSFORM cmake_args REPLACE "\\[\\[;\\]\\]" "\\\\;")' call breaks the list arguments added when evaluating the 'INPUT_' values. Therefore, it's necessary to apply bracket-based escaping to all list arguments instead of the standard escaping. Amends 856fadf85ca2a3b70878d01d32e4d4cef807b8a9 Fixes: QTBUG-92459 Change-Id: Ifd4e0ca5f549a1c7fab9ceb587ed355250c4e677 Reviewed-by: Alexandru Croitor --- cmake/QtProcessConfigureArgs.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 330de3e6b33..8d4cef232bf 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -596,7 +596,7 @@ endmacro() macro(translate_list_input name cmake_var) if(DEFINED INPUT_${name}) - list(JOIN INPUT_${name} "\\;" value) + list(JOIN INPUT_${name} "[[;]]" value) list(APPEND cmake_args "-D${cmake_var}=${value}") drop_input(${name}) endif() @@ -763,7 +763,7 @@ if(nr_of_build_configs EQUAL 1) push("-DCMAKE_BUILD_TYPE=${build_configs}") elseif(nr_of_build_configs GREATER 1) set(multi_config ON) - string(REPLACE ";" "\\;" escaped_build_configs "${build_configs}") + string(REPLACE ";" "[[;]]" escaped_build_configs "${build_configs}") # We must not use the push macro here to avoid variable expansion. # That would destroy our escaping. list(APPEND cmake_args "-DCMAKE_CONFIGURATION_TYPES=${escaped_build_configs}")