cmake: Handle arbitrary configure arguments that contain lists

Passing e.g. -- -DQT_BUILD_SUBMODULES="qtbase;qtdeclarative" to
configure would fail because the module list was not preserved
as a single argument.

Change-Id: If685d0d541201597a2c2a5dc3d55b5d1ae51da22
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tor Arne Vestbø 2021-03-16 16:59:34 +01:00
parent 47abdbea81
commit df8e1c8e58

View File

@ -82,8 +82,10 @@ while(NOT "${configure_args}" STREQUAL "")
elseif(arg MATCHES "^-host.*dir")
message(FATAL_ERROR "${arg} is not supported anymore.")
elseif(arg STREQUAL "--")
# Everything after this argument will be passed to CMake verbatim.
push(${configure_args})
# Everything after this argument will be passed to CMake verbatim,
# but we need to escape semi-colons so that lists are preserved.
string(REPLACE ";" "\\;" configure_args "${configure_args}")
list(APPEND cmake_args "${configure_args}")
break()
else()
set_property(GLOBAL APPEND PROPERTY UNHANDLED_ARGS "${arg}")