From 09838d9cbd3f5c4c6f38bbd7a889d63e0226beeb Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 9 Aug 2021 12:44:34 +0200 Subject: [PATCH] CMake: Fix build with CMake master / 3.22 CMake master / 3.22 introduced a behavior change in how conditions are evaluated in the while command. It is now consistent with how if() evaluates conditions. This caused an issue in Qt code where a "(" opening parenthesis was evaluated as part of the condition rather than as a string. Fix this by wrapping the evaluation of the variable in quotes. Change-Id: I70c26dc91394f4a14f7a26419df264a069dc7dc5 Reviewed-by: Kai Koehne Reviewed-by: Craig Scott (cherry picked from commit eb2282605734152440e840777d1f8a0576e3c7a6) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtCMakeHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtCMakeHelpers.cmake b/cmake/QtCMakeHelpers.cmake index f9b03d628cb..356c8ce3577 100644 --- a/cmake/QtCMakeHelpers.cmake +++ b/cmake/QtCMakeHelpers.cmake @@ -137,7 +137,7 @@ function(qt_remove_args out_var) endif() list(GET result ${find_result} arg_current) # remove values until we hit another arg or the end of the list - while(NOT ${arg_current} IN_LIST arg_ALL_ARGS AND find_result LESS result_len) + while(NOT "${arg_current}" IN_LIST arg_ALL_ARGS AND find_result LESS result_len) list(REMOVE_AT result ${find_result}) list(LENGTH result result_len) if (NOT find_result EQUAL result_len)