CMake: Fix [qt-]configure[-module].bat arguments with backslashes

We must escape backslashes in CMake code that's to be evaluated and in
the arguments we read from config.opt.

Change-Id: I65d033c77f71888974983aa3d834acb2fe89f3fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-10-29 11:50:52 +01:00
parent 2a29426e39
commit cb7f4030bc

View File

@ -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}")