View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009980CMakeCMakepublic2009-11-30 12:492016-06-10 14:31
ReporterDavid Faure 
Assigned ToBill Hoffman 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0009980: Separate user-specified and cached variables
Descriptioncmake is really missing the equivalent of autoconf's config.status: a way to re-run cmake with the same options as initially (plus any options modified by hand in cmake-gui, I suppose).

This would be useful for many use cases.
Use case 1: going to an old cmake project, and cmake needs to be rerun again for some reason (e.g. Qt is now in a different prefix). If one didn't write down the options he passed cmake, one has to figure them out again. I keep shell scripts around in every project, but that's just manual work that other buildsystems automate -- simply remembering which options were given by the user. The suggestion of "deleting the stuff from the cache that doesn't apply anymore" isn't a solution; in the example of Qt there are countless variables that depend on its location.

Use case 2: changing the compiler. See the bug report in the "Additional information" field.
Additional InformationI 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 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???
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0027013)
Alex Neundorf (developer)
2011-07-06 14:57

In cmake-gui there is in the Tools menu an entry "Show my changes".
Does this help ?

Alex
(0029475)
David Faure (reporter)
2012-05-15 13:05

I don't see how any GUI helps preventing the "typing make and losing settings" issue...
(0041629)
Kitware Robot (administrator)
2016-06-10 14:27

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2009-11-30 12:49 David Faure New Issue
2010-08-29 10:17 Kovarththanan Rajaratnam Severity major => feature
2010-12-15 09:02 David Cole Status new => assigned
2010-12-15 09:02 David Cole Assigned To => Bill Hoffman
2011-07-06 14:57 Alex Neundorf Note Added: 0027013
2012-05-15 13:05 David Faure Note Added: 0029475
2016-06-10 14:27 Kitware Robot Note Added: 0041629
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team