Hi All,
I have a CMake project that attempts to catch a huge number of errors in the configuration stage. This works quite well, and the output is normally no more than a hundred or so lines. However, even with such sparse output it can sometimes be difficult to pick out errors and warnings. If there have been errors and warnings, I would like to run a macro right at the end of configuration that tells the user if there have been any errors and warnings in a really obvious way.
My current solution is to override message(), and for the SEND_ERROR and WARNING cases I add one to a counter and pass the message on to _message(). This works, but it feels a bit hacky. Is there a more “official” way to do it? Something like CMAKE_NUMBER_OF_WARNINGS and CMAKE_NUMBER_OF_ERRORS variables - my understanding is that you don’t have to count FATAL_ERROR, because there can only ever be one of those.
If something like these variables doesn’t exist yet, might this ticket become a feature request?
Thanks,
Tom