How to use ccache for C++ compilation for faster compile times

It would be nice to be able to use e.g. ccache to speed up compile times on at least linux based systems. Is there a way to activate this? like overriding CC and CXX env vars?

Here is my pull request for this: