summaryrefslogtreecommitdiffstats
path: root/cmake/QtFeature.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-10-27 12:56:24 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-10-29 18:25:22 +0100
commit91384c99182e3e306f9cad97a3e9e6de283e5466 (patch)
tree62558d12b426b2907ded966276561ad3f860c1dc /cmake/QtFeature.cmake
parentb77cf10a4fbe328fd8b7e0bd0294813dc6394773 (diff)
CMake: Allow lower-case values in feature values
CMake considers ON/OFF as booly string values regardless of the case. Make the value comparison in QtFeature.cmake case-independent. It's now possible to build Qt with '-DFEATURE_gui=off'. Fixes: QTBUG-87948 Change-Id: I3d948e8219ad9728414803c8c4cd756034073b46 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Diffstat (limited to 'cmake/QtFeature.cmake')
-rw-r--r--cmake/QtFeature.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake
index 8d22235d4d..aa59a14ff9 100644
--- a/cmake/QtFeature.cmake
+++ b/cmake/QtFeature.cmake
@@ -406,14 +406,16 @@ function(qt_extra_definition name value)
endfunction()
function(qt_internal_generate_feature_line line feature)
- if (QT_FEATURE_${feature} STREQUAL "ON")
+ string(TOUPPER "${QT_FEATURE_${feature}}" value)
+ if (value STREQUAL "ON")
set(line "#define QT_FEATURE_${feature} 1\n\n" PARENT_SCOPE)
- elseif(QT_FEATURE_${feature} STREQUAL "OFF")
+ elseif(value STREQUAL "OFF")
set(line "#define QT_FEATURE_${feature} -1\n\n" PARENT_SCOPE)
- elseif(QT_FEATURE_${feature} STREQUAL "UNSET")
+ elseif(value STREQUAL "UNSET")
set(line "#define QT_FEATURE_${feature} 0\n\n" PARENT_SCOPE)
else()
- message(FATAL_ERROR "${feature} has unexpected value \"${QT_FEATURE_${feature}}\"!")
+ message(FATAL_ERROR "${feature} has unexpected value \"${QT_FEATURE_${feature}}\"! "
+ "Valid values are ON, OFF and UNSET.")
endif()
endfunction()