diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index ce64c0e978..9614061212 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -44,6 +44,7 @@ endif() file(STRINGS "${OPTFILE}" configure_args) list(FILTER configure_args EXCLUDE REGEX "^[ \t]*$") list(TRANSFORM configure_args STRIP) +list(TRANSFORM configure_args REPLACE "\\\\" "\\\\\\\\") unset(generator) set(auto_detect_generator TRUE) unset(device_options) @@ -390,6 +391,7 @@ function(qt_call_function func) string(APPEND call_code "\"${ARGV${i}}\" ") endforeach() string(APPEND call_code ")") + string(REPLACE "\\" "\\\\" call_code "${call_code}") if(${CMAKE_VERSION} VERSION_LESS "3.18.0") set(incfile qt_tmp_func_call.cmake) file(WRITE "${incfile}" "${call_code}")