CMake: Actually evaluate AUTODETECT expressions in features

Very simple AUTODETECT expressions worked fine, but expressions with
parentheses, for example, were not correctly evaluated.

Change-Id: Ibec4fa55474e149a701f861838fdea41d31beca0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-08-21 15:10:46 +02:00
parent 7e7c9ba455
commit 97551b90b9

View File

@ -253,9 +253,10 @@ function(qt_evaluate_feature feature)
qt_evaluate_config_expression(disable_result ${arg_DISABLE})
qt_evaluate_config_expression(enable_result ${arg_ENABLE})
qt_evaluate_config_expression(auto_detect ${arg_AUTODETECT})
if(${disable_result})
set(result OFF)
elseif((${enable_result}) OR (${arg_AUTODETECT}))
elseif((${enable_result}) OR (${auto_detect}))
set(result ${condition})
else()
# feature not auto-detected and not explicitly enabled