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>
This commit is contained in:
parent
b77cf10a4f
commit
91384c9918
@ -406,14 +406,16 @@ function(qt_extra_definition name value)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_internal_generate_feature_line line feature)
|
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)
|
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)
|
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)
|
set(line "#define QT_FEATURE_${feature} 0\n\n" PARENT_SCOPE)
|
||||||
else()
|
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()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user