Is there a way how to produce a colorful output from gcc
which is called from Makefile generated by cmake
? It would make debugging application a lot easier.
Do you want colourful output from cmake
binary? For that I don't know any solution.
CMake
can generate Makefiles
that provide verbose (and colourful) information about the build process. This can be enabled in the following way:
SET(CMAKE_COLOR_MAKEFILE ON)
# And optionally
SET(CMAKE_VERBOSE_MAKEFILE ON)
If you want to have the gcc
output colourised, then have a look at colorgcc
perl script. Having it installed try something like this:
CC=/usr/bin/colorgcc cmake .....
Or use the newer solution proposed in another answer by gfour - the gccfilter
Download gccfilter (needs perl, libregexp and libgetopt-argvfile), then run:
gccfilter -c cmake ...
This will colorize the messages from the build process (which I assume are gcc mesages).
Try colout, it is designed to seamlessly color the output of any command, and comes with a g++ AND a cmake theme, which you can use together:
make something 2>&1 | colout -t cmake | colout -t g++
Besides improving the cmake colorscheme, it even applies syntax coloring on the code printed out by g++.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With