From 63e90281b2752f13cb8045c56b71ea10228a190b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 6 Jul 2020 09:21:41 +0200 Subject: [PATCH] CMake: Support mkspec-related configure arguments Task-number: QTBUG-85373 Change-Id: I44ae15b4c05f23442ac6b9d69d31f22f01d0a48c Reviewed-by: Alexandru Croitor --- cmake/QtProcessConfigureArgs.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 9a205a55598..4f24d635e55 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -32,6 +32,7 @@ list(TRANSFORM configure_args STRIP) unset(generator) set(auto_detect_generator TRUE) unset(build_configs) +unset(device_options) while(configure_args) list(POP_FRONT configure_args arg) if(arg STREQUAL "-cmake") @@ -121,6 +122,15 @@ while(configure_args) elseif(arg MATCHES "^-(no-)?framework") calculate_state() push("-DFEATURE_framework=${state}") + elseif(arg MATCHES "^-x?platform$") + list(POP_FRONT configure_args mkspec) + push("-DQT_QMAKE_TARGET_MKSPEC=${mkspec}") + elseif(arg STREQUAL "-device") + list(POP_FRONT configure_args mkspec) + push("-DQT_QMAKE_TARGET_MKSPEC=devices/${mkspec}") + elseif(arg STREQUAL "-device-option") + list(POP_FRONT configure_args opt) + list(APPEND device_options "${opt}") elseif(arg STREQUAL "--") # Everything after this argument will be passed to CMake verbatim. push(${configure_args}) @@ -145,6 +155,12 @@ elseif(nr_of_build_configs GREATER 1) list(APPEND cmake_args "-DCMAKE_CONFIGURATION_TYPES=${escaped_build_configs}") endif() +if(device_options) + unset(escaped_device_options) + list(JOIN device_options "\\;" escaped_device_options) + list(APPEND cmake_args "-DQT_QMAKE_DEVICE_OPTIONS=${escaped_device_options}") +endif() + if(NOT generator AND auto_detect_generator) find_program(ninja ninja) if(ninja)