[cmake-developers] [CMake] Forwarding parameters to cmake through cmake-gui

David Cole dlrdave at aol.com
Mon Nov 4 15:47:23 EST 2013


> My question is still not answered completely:
>
> When should the new variable be added? On startup is not really
> possible because it might be the case that your src/binary directory 
is not set properly.
>
> So you would agree that it makes sense to do it "on configure" but 
only if the cache
> is empty? This will not allow to overwrite the variable via parameter 
but I guess
> that usecase is not very common?

(This is all my opinion, and may be mine alone, and should be discussed 
on the developer's list to see if it is shared by most other CMake 
devs, or if somebody objects to it for "backwards compatibility" 
reasons. I am adding the CMake dev list on the cc line...)

On startup is the only time it does make sense. After that, the user 
should be in charge, and the command line settings should not be 
re-applied again after a user makes an edit. You don't need the 
src/binary directories set properly necessarily in order to add a cache 
entry to the UI.

ccmake and cmake-gui *should* behave (in *my* opinion) as follows:
- on startup, load the CMakeCache.txt values (if there are any) from 
the previous run
- then apply the -D arguments so that any -D arguments given on the 
command line overwrite previous cache entries (just like command line 
cmake does already)
- then put the user in charge and wait for user input

This is, apparently, NOT the way that ccmake behaves today, but I think 
it should be changed to be like that.

Please chime in, especially if you have a differing opinion.


David C.




More information about the cmake-developers mailing list