caching behavior

David Faure faure at kde.org
Fri Nov 27 18:38:58 CET 2009


On Tuesday 17 November 2009, you wrote:
> Well, it's for adjusting the build to your liking if there are more
>  options  than what you'd like to enter on the command line. Then these
>  settings should be kept.
> We are discussing the case that the cache has been removed and how to get
>  to  the same results again, right ?
> Actually I'd really recommend to not remove the cache, but use cmake-gui 
> (or "make edit_cache") and just remove what you want to have removed. If 
> there are issues with cmake-gui, or something which makes it inconvenient
>  for  you to use, please report it in the cmake bug tracker.

I just had another problem due to this cmake misbehavior.
I edited the cache file to change the path to gcc. After doing that, I typed
make, and cmake realized I had changed the compiler and re-configured 
everything, including... losing my install prefix!
This is exactly why cmake should differenciate between the options set by the 
user and the options it found itself. So that it never loses the options set 
by the user, like the install prefix....

Details and proof below:

> cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=$KDEDIR .
[...]
> grep INSTALL_PREFIX CMakeCache.txt
CMAKE_INSTALL_PREFIX:PATH=/d/kde/inst/kde4
> grep gcc CMakeCache.txt
CMAKE_C_COMPILER:FILEPATH=/usr/lib/icecc/bin/gcc

OK, let's change gcc to use ccache:

> perl -pi -e 's,/usr/lib/icecc/bin/gcc,/usr/lib/ccache/gcc,' CMakeCache.txt
> grep gcc CMakeCache.txt
CMAKE_C_COMPILER:FILEPATH=/usr/lib/ccache/gcc

> make
Executing command /d/qt/4/kde-qt-4.6/bin/qmake -query QT_VERSION            
-- Configuring done                                                         
You have changed variables that require your cache to be deleted.           
Configure will be re-run and you may have to reset some variables.          
The following variables have changed:                                       
CMAKE_C_COMPILER= /usr/lib/ccache/gcc           
[...]

> grep INSTALL_PREFIX CMakeCache.txt
CMAKE_INSTALL_PREFIX:PATH=/usr/local

Whoops, where did my install prefix go???

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).


More information about the Kde-buildsystem mailing list