CMAKE_COMPILE_WARNING_AS_ERROR is not a cache variable by default in CMake, so it has no value in the configure summary when not set, and even when set cannot be toggled in ccmake. Define it as an option() to make it a cache BOOL with a default of OFF.
From the original MR to cmake, this was deliberately not set as a cache variable: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7187 (see Brad King’s reply to the collapsed comments from Marc Chevrier).
Most CMAKE_* variables which are expected to be toggled by users are (as far as I can research) cache variables by default. Those that are considered likely to be set by the project (e.g. CMAKE_CXX_STANDARD or CMAKE_POSITION_INDEPENDENT_CODE) are not, along with read-only variables, script/internal variables, platform sppecific variables, template variables. CMAKE_COMPILE_WARNING_AS_ERROR may be a slight outlier here.
I count ~ 600 documented CMAKE_* variables, of which ~ 60 are default cache variables.
I could only see a few of these like:
- CMAKE_COMPILE_WARNING_AS_ERROR
- CMAKE_CXX_STANDARD,
- CMAKE_POSITION_INDEPENDENT_CODE
- CMAKE_INTERPROCEDURAL_OPTIMIZATION
…that we (or any project) might want to expose as user-togglable, and would have to add as an option() in CMakeLists.txt.