From 6ca047aba9d41d4b2f00ecef33a6a7ca43d90ac8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 13 Mar 2019 13:55:56 +0100 Subject: 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 --- cmake/QtFeature.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmake') 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 -- cgit v1.2.3