[CMake] changing the cmake color scheme

Michael Hertling mhertling at online.de
Sat Sep 4 08:51:18 EDT 2010


On 09/04/2010 02:32 AM, Abe Bachrach wrote:
> Hi there,
> is there a way to change the color scheme that cmake uses while building??
> 
> I would rather not have the message for linking be red, since this
> immediately makes me think there was an error.

As Eric has pointed out in the meantime, those colors are hardcoded
in the CMake code base, but - if on *nix - look at the following:

ADD_CUSTOM_TARGET(red2yellow ALL
    COMMAND find ${CMAKE_BINARY_DIR} -name build.make
            -exec perl -pi -e "s/--red/--yellow/" "{}" "\;")

Placed in the top-level CMakeLists.txt, this custom target tweakes the
concerned Makefiles to present the linking message in a beautiful but
unreadable yellow. ;) If it doesn't luckily execute as the very first
target, you could resort to CMake's ordinary dependency mechanism.

Yours colorfully,

Michael


More information about the CMake mailing list