foreach() with invalid arguments does not match with endforeach() in CMakeLists.txt
Minimum example:
cmake_minimum_required(VERSION 3.16)
project(test NONE)
foreach(b RANGE 2 1 1) # Error
message(STATUS "This should not be printed")
endforeach()