while: Behaviour change in condition evaluation
Sample project
cmake_minimum_required(VERSION 3.16)
project(proj)
set(var_with_paren "(")
set(some_list "")
#if(NOT ${var_with_paren} IN_LIST some_list)
#message("var not in some_list")
#else()
#message("var in some_list")
#endif()
while(NOT ${var_with_paren} IN_LIST some_list)
break()
endwhile()
Configuring with cmake 3.21 succeeds.
Configuring with master / 3.22 fails with
CMake Error at CMakeLists.txt:13 (while):
had incorrect arguments: NOT ${var_with_paren} IN_LIST some_list
(mismatched parenthesis in condition).
If you uncomment the if
code block, it fails both with 3.21 and master.
The MR causing this is !6392 (merged)
The new behavior is now more consistent with if
.
Don't know if it's an acceptable breakage for old project code though.