My top level cmake file says: set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
and a lower level cmake file says: set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)
But, when I try to build the project the lower level builds with the MSVC compiler option /WX which forces warnings to be errors which I don’t want to for that particular set of code.
I was setting as the first line in the lower level CMake file. In the end I removed the set (CMAKE_COMPILE_WARNING_AS_ERROR ON)from the top level CMake file.