summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2024-03-14 15:59:31 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2024-03-27 06:56:09 +0100
commit6e12a298f459eb66bf2fc28f5ff36202436c2e0b (patch)
tree1c44ce5a02c0eb7fb7c6a6943f53152d9f0a21cc /cmake
parent52c7357fced9f10fafba68344781ceab48fc1b16 (diff)
configure: Fix -system-zlib and -system-sqlite options
These options are declared with TYPE enum and a MAPPING that's supposed to control the feature 'system-zlib' or 'system-sqlite'. Since only inputs of type boolean control features now, we need to somehow declare that this non-boolean input controls a feature. We do this by adding the keyword CONTROLS_FEATURE to qt_commandline_option. For example, qt_commandline_option(zlib CONTROLS_FEATURE TYPE enum NAME system-zlib MAPPING system yes qt no ) declares - commandline option "zlib" sets the input "system-zlib", because of the "NAME system-zlib" argument - accepted input values are "system" and "qt", because we have "TYPE enum" and the odd values of MAPPING - those values are translated to yes/no, because of the even values of MAPPING - CONTROLS_FEATURE forces the translated input's type to boolean, and with that it will set the corresponding feature 'system-zlib' Luckily, only qtbase has command line options with MAPPING declared. Change-Id: I82d06cec43ece3b002c8f5dd414c68dc730909af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtProcessConfigureArgs.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index 2080d3222a..97bf49efbe 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -275,7 +275,7 @@ macro(qt_commandline_custom handler)
endmacro()
function(qt_commandline_option name)
- set(options)
+ set(options CONTROLS_FEATURE)
set(oneValueArgs TYPE NAME VALUE)
set(multiValueArgs VALUES MAPPING)
cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -287,7 +287,11 @@ function(qt_commandline_option name)
set(input_name ${arg_NAME})
set(commandline_option_${name}_variable "${arg_NAME}" PARENT_SCOPE)
endif()
- set_property(GLOBAL PROPERTY INPUTTYPE_${input_name} "${arg_TYPE}")
+ set(mapping_type "${arg_TYPE}")
+ if(arg_CONTROLS_FEATURE)
+ set(mapping_type "boolean")
+ endif()
+ set_property(GLOBAL PROPERTY INPUTTYPE_${input_name} "${mapping_type}")
if(NOT "${arg_VALUE}" STREQUAL "")
set(commandline_option_${name}_value "${arg_VALUE}" PARENT_SCOPE)
endif()