[CMake] Problem using ccache & cmake

Eric Noulard eric.noulard at gmail.com
Mon Nov 5 14:46:26 EST 2007


2007/11/5, Steven Van Ingelgem <steven at vaningelgem.be>:
> What I saw today in the sources is that cmake uses /usr/bin/ccache as
> it's compiler, and gcc/cc/g++ as it's first argument... So it should
> work, but I have no idea why it returns it cannot find the file cc.
>
> That is imho somewhere an error in the execute process (or a
> misinterpretion of the macro from my end).
>
> Either way, it would be nice if it could be supported ;)

I'm not sure what's wrong in your case
but I did successfully used ccache + gcc/g++ and CMake 2.4.7
with no problem at all.

I did not export GCC= etc..
and then run cmake
but I did:

CC="ccache gcc" CXX="ccache g++" cmake

which works fine for me.
I did that because there is an example on the CMake wiki
page for "distcc"
see:
http://www.cmake.org/Wiki/CMake_Useful_Variables
then search distcc.

I think your problem comes from the fact that you've tried
to set GCC="ccache gcc".
I think you shouldn't set GCC but only

CC="ccache gcc"
CXX="ccache g++"

then it should works.
Could you try this?


-- 
Erk


More information about the CMake mailing list