I would like to do the following: If CCache is present in PATH, use \"ccache g++\" for compilation, else use g++. I tried writing a small my-cmake script containing
In my opinion the best way is to symlink gcc,g++ to ccache, but if you would like to use within cmake, try this:
export CC="ccache gcc" CXX="ccache g++" cmake ...