summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2024-01-15 16:22:51 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2024-02-13 20:11:21 +0100
commitbe009c6857dc75c0bdf789c4ac9323f0cf1fd9e6 (patch)
tree8fde94d6ef2bb7793501266419096fbc4588a55b /cmake
parent037439ad4bcaeb106d46261ff7664572e3bb82b7 (diff)
configure: translate inputs matching feature names to FEATURE_foo
Inputs (in the sense of configure commandline options) are now translated to -DFEATURE_foo=ON/OFF if the input name matches a feature name. This is going to replace more complicated logic in our feature evaluation. Task-number: QTBUG-120529 Change-Id: I3ef45cd0e0a1462c53543cd2152eaf7f94318d9d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtProcessConfigureArgs.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index 74d60fe815..d26f9c06b4 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -994,9 +994,18 @@ if(cmake_file_api OR (developer_build AND NOT DEFINED cmake_file_api))
endforeach()
endif()
+# Translate unhandled input variables to either -DINPUT_foo=value or -DFEATURE_foo=ON/OFF. If the
+# input's name matches a feature name and the input's value is boolean then we assume it's
+# controlling a feature.
+set(valid_boolean_input_values yes no)
foreach(input ${config_inputs})
qt_feature_normalize_name("${input}" cmake_input)
- push("-DINPUT_${cmake_input}=${INPUT_${input}}")
+ if(input IN_LIST commandline_known_features
+ AND "${INPUT_${input}}" IN_LIST valid_boolean_input_values)
+ translate_boolean_input("${input}" "FEATURE_${cmake_input}")
+ else()
+ push("-DINPUT_${cmake_input}=${INPUT_${input}}")
+ endif()
endforeach()
if(no_prefix_option AND DEFINED INPUT_prefix)