diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-03-13 13:55:56 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-03-14 13:56:30 +0000 |
commit | 6ca047aba9d41d4b2f00ecef33a6a7ca43d90ac8 (patch) | |
tree | 0a58d5065f981b9bbfe405151acc77bf3ff39583 | |
parent | 42ae8218b1e18b002df5a26a2f4e961af61aaa5d (diff) |
Use qt_evaluate_config_expression for feature enable conditions
Certain features like opengles2 can be enabled or disabled based
on the conditions that are specified in the ENABLE and DISABLE
parameters.
Because some of those conditions use STREQUAL with
a single quoted argument, we have to use
qt_evaluate_config_expression to circumvent the CMake bug
regarding single quotes, which is described in the function
implementation.
Only then will enabling / disabling work correctly.
Change-Id: I3b68ef611c985f0d8416fd089055fd862da1e542
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r-- | cmake/QtFeature.cmake | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 13d0203612..87fe4a55dd 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -224,9 +224,11 @@ function(qt_evaluate_feature feature) qt_evaluate_config_expression(condition ${arg_CONDITION}) endif() - if(${arg_DISABLE}) + qt_evaluate_config_expression(disable_result ${arg_DISABLE}) + qt_evaluate_config_expression(enable_result ${arg_ENABLE}) + if(${disable_result}) set(result OFF) - elseif((${arg_ENABLE}) OR (${arg_AUTODETECT})) + elseif((${enable_result}) OR (${arg_AUTODETECT})) set(result ${condition}) else() # feature not auto-detected and not explicitly enabled |