provide "treat warnings as errors" option
It would help to get higher quality cmake files if there would be an option to treat warnings as errors, similar to the "-Werror" flag of gcc.
Proposal: Add a "--warnings-as-errors" option to the cmake command. Ideally this can also be set at a top level CMakeLists file to be inherited by all files which are part of the project.
For example, I would like to set: "--warn-unused-vars" and instead of getting many messages which I can ignore or wont catch on a complex build, stop the build, so it becomes obvious which problem needs to be solved.