cmake, ccache, CCACHE_BASEDIR: wrong paths in compiler error messages

Thank you for your reply!

You are right, exactly.
I think this is what CCACHE_BASEDIR shall solve. I made a minimal application (just using our proprietary logging library and its dependencies) and it rebuilds in a different source directory with 100% cache hits, so I hope I’m on right way.

But how else should the IDE know which compiler error happened where? Do you think the IDE shall mimic all the make handling and run everything on its own (instead of invoking cmake --build or alike)?

I think in practice IDEs exec cmake/make and parse its output (Vim, QTCreator, Clion).

I think it is wrong that cmake uses cd in a way that it breaks make -w, but I understand that due to usage of absolute path it normally does not matter,
which leaves the question: how to effectively use ccache with cmake.