MantisBT - CMake
View Issue Details
0011707CMake(No Category)public2011-01-16 13:502011-01-31 16:13
Nicolas Despres 
Brad King 
normalminoralways
closedfixed 
Linux 2.6.32-27-generic #49 i686Ubuntu10.04.1 LTS
CMake 2.8.3 
CMake 2.8.4CMake 2.8.4 
0011707: Cannot use ccache when building cmake
If have tried to bootstrap cmake using ccache and gcc by setting CC='ccache gcc' and CXX='ccache g++' but it does not work and ccache is not used.
$ mkdir _build
$ cd _build
$ CC='ccache gcc' CXX='ccache g++' ../configure --prefix="$HOME/usr/stow/cmake" --qt-gui --qt-qmake=/usr/bin/qmake --parallel=2 --verbose
I have attached the cmake_bootstrap.log. Apparently bootstrap understands CC and CXX as a list so it first tries ccache alone as a compiler and then gcc alone. Of course ccache alone fails to build the test program so gcc is picked up instead of 'ccache gcc'.

I would suggest to add a --enable-ccache option to this script. I'll try to write a patch.
No tags attached.
log cmake_bootstrap.log (192,125) 2011-01-16 13:50
https://public.kitware.com/Bug/file/3630/cmake_bootstrap.log
patch bootstrap-enable-ccache.patch (1,446) 2011-01-16 16:34
https://public.kitware.com/Bug/file/3632/bootstrap-enable-ccache.patch
Issue History
2011-01-16 13:50Nicolas DespresNew Issue
2011-01-16 13:50Nicolas DespresFile Added: cmake_bootstrap.log
2011-01-16 16:34Nicolas DespresFile Added: bootstrap-enable-ccache.patch
2011-01-16 18:49Nicolas DespresNote Added: 0024731
2011-01-17 06:54Michael WildNote Added: 0024733
2011-01-17 07:06Michael WildNote Added: 0024734
2011-01-17 09:03Brad KingAssigned To => Brad King
2011-01-17 09:03Brad KingStatusnew => assigned
2011-01-17 09:04Brad KingNote Added: 0024744
2011-01-17 09:04Brad KingStatusassigned => closed
2011-01-17 09:04Brad KingResolutionopen => fixed
2011-01-31 16:13David ColeFixed in Version => CMake 2.8.4
2011-01-31 16:13David ColeTarget Version => CMake 2.8.4

Notes
(0024731)
Nicolas Despres   
2011-01-16 18:49   
Oups. My patch 'bootstrap-enable-ccache.patch' that accurate in the usage message.

Now it is:
Enable ccache when bootstrapping and building cmake.

But it should be:
Enable ccache when building cmake.
(0024733)
Michael Wild   
2011-01-17 06:54   
alternatively, simply symlink ccache to ./gcc and ./g++ and then set CC=$PWD/gcc and CXX=$PWD/g++.
(0024734)
Michael Wild   
2011-01-17 07:06   
And if you're using Ubuntu/Debian and installed ccache using the package manager, use CC=/usr/lib/ccache/gcc and CXX=/usr/lib/ccache/g++ directly. If using CentOS/RHEL/Fedora/OpenSUSE/..., replace the /usr/lib with /usr/lib64 if running a 64-bit operating system. Other operating systems will have similar facilities.
(0024744)
Brad King   
2011-01-17 09:04   
Applied. Thanks.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3cba29d2 [^]