Investigating the issue a bit more, I can see why it's happening for the given example. When I made those changes, I only modified the "message" CMake command, to check the CMAKE_WARN/ERROR_DEPRECATED and CMAKE_SUPPRESS_DEVELOPER_WARNINGS variables before outputting the message. The message command uses cmake::IssueMessage to actually output the required message. What I wasn't aware of was that other commands and code also use the IssueMessage for outputting author and deprecated messages. As the IssueMessage command doesn't check those variables, or the new warning levels map, before outputting the message, that's why we're seeing this behaviour.

What I wanted to check before coming up with a fix, is whether the -W options are intended to only be applicable for the message command (and so the current behaviour is correct), or whether they should affect all author and deprecated messages output by other parts of CMake?

If the current behaviour isn't correct, then one thing to have a good think about, is how to handle turning warnings into errors when -Werr-dev or -Werr-deprecated (and also the required behaviour when -Wno- is used). As some users of IssueMessage do different things if an error occurs (and is output), *after* IssueMessage is called. So there might need to be a way to signal to the caller when a warning has been upgraded to an error because of the users options perhaps?

Cheers,
Michael
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to