From abe4e3d2fbd7c59665c81f2a96d277d361512cc5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 8 Apr 2021 13:32:26 +0200 Subject: [PATCH] CMake: Fix condition evaluation in plugin's DEFAULT_IF option Expand the condition without an extra negation. This fixes incorrect condition evaluation for conditions not enclosed in parenthesis. Change-Id: I4923059b6b199676058091c23d51c9368daaebd0 Reviewed-by: Craig Scott Reviewed-by: Alexandru Croitor (cherry picked from commit c1ac201f5c9905751eb35531f26311c8d291f9cc) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtPluginHelpers.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake index 2e1ede73cbc..0a985760c7d 100644 --- a/cmake/QtPluginHelpers.cmake +++ b/cmake/QtPluginHelpers.cmake @@ -151,12 +151,12 @@ function(qt_internal_add_plugin target) set(_default_plugin 1) endif() - if (DEFINED arg_DEFAULT_IF) - if (NOT ${arg_DEFAULT_IF}) - set(_default_plugin 0) - else() - set(_default_plugin 1) - endif() + if(DEFINED arg_DEFAULT_IF) + if(${arg_DEFAULT_IF}) + set(_default_plugin 1) + else() + set(_default_plugin 0) + endif() endif() # Save the Qt module in the plug-in's properties and vice versa