From 96abceb64e5dc0570ca7c3419f401cfafe946ba0 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2024 18:21:00 +0200 Subject: [PATCH] CMake: Fix forwarding the '0' argument which is by default falsey If the forward argument was meant to be 0, it was not forwarded because it evaluated to false in if(condition). To pass it along, instead check for empty strings. Pick-to: 6.8 Change-Id: Ia366df147de0c2d333017da43dc0643b56a89e9c Reviewed-by: Joerg Bornemann --- cmake/QtPublicCMakeHelpers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtPublicCMakeHelpers.cmake b/cmake/QtPublicCMakeHelpers.cmake index 1a9cdc5a075..31e7591b990 100644 --- a/cmake/QtPublicCMakeHelpers.cmake +++ b/cmake/QtPublicCMakeHelpers.cmake @@ -641,13 +641,13 @@ function(_qt_internal_forward_function_args) endforeach() foreach(option_name IN LISTS arg_FORWARD_SINGLE) - if(${arg_FORWARD_PREFIX}_${option_name}) + if(NOT "${arg_FORWARD_PREFIX}_${option_name}" STREQUAL "") list(APPEND forward_args "${option_name}" "${${arg_FORWARD_PREFIX}_${option_name}}") endif() endforeach() foreach(option_name IN LISTS arg_FORWARD_MULTI) - if(${arg_FORWARD_PREFIX}_${option_name}) + if(NOT "${arg_FORWARD_PREFIX}_${option_name}" STREQUAL "") list(APPEND forward_args "${option_name}" ${${arg_FORWARD_PREFIX}_${option_name}}) endif() endforeach()