This should already work, at least it does for me: CC=/usr/bin/colorgcc cmake .. yields -- Check for working C compiler: /usr/bin/colorgcc -- Check for working C compiler: /usr/bin/colorgcc -- works . . .