CMake: allow user specified boolean values to have any case

When running something like this:

    cmake -D FEATURE_xkbcommon=On qtbase

one would run into issues like:

    CMake Error at cmake/QtFeature.cmake:254 (message):
      Sanity check failed: FEATURE_xkbcommon has invalid value "On"!
    Call Stack (most recent call first):
      cmake/QtFeature.cmake:396 (qt_feature_check_and_save_user_provided_value)
      cmake/QtFeature.cmake:606 (qt_evaluate_feature)
      cmake/QtFeature.cmake:575 (qt_feature_module_end)
      src/CMakeLists.txt:12 (qt_feature_evaluate_features)

Change-Id: I33a921625b97aeb3c423cb7c1fb1bd3b05ce24a7
Pick-to: 6.4 6.3 6.2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Rolf Eike Beer 2022-09-02 09:12:48 +02:00
parent 3b91bab465
commit 60829b0b25

View File

@ -239,7 +239,7 @@ function(qt_feature_check_and_save_user_provided_value resultVar feature conditi
if (DEFINED "FEATURE_${feature}")
# Revisit new user provided value
set(user_value "${FEATURE_${feature}}")
set(result "${user_value}")
string(TOUPPER "${user_value}" result)
# If the build is marked as dirty and the user_value doesn't meet the new condition,
# reset it to the computed one.