GCCFilter is a neat perl script that allows to color the output of GCC and thus makes debugging much more fun and, more important, faster.
You can use GCCFilter with a CMake generated Makefile by calling
gccfilter -a -c make
However, this approach has some drawbacks: Delayed output of CMake status infos, no color in the CMake commands are the most obvious.
The question: Is there a way to write some CMake module that searches for gccfilter
if the compiler is gcc
, checks if, say COLOR_CXX
is set (rather easy up to here) and then tells CMake to replace all calls to gcc
by gccfilter -a -c gcc
.
CMake offers the variable CMAKE_CXX_COMPILER
, but changing this one will disallow CMake to find correct include paths and the like. Is there some variable we may change after the project()
command that is prefixed before each call to gcc
?