[CMake] Forwarding parameters to cmake through cmake-gui

Matthew Woehlke matthew.woehlke at kitware.com
Fri Nov 1 14:02:23 EDT 2013


On 2013-11-01 11:39, physhh . wrote:
> that's interesting. I'm currently at a windows only machine so i can't
> check out ccmake but can only lookup the source. It appears that ALL
> parameters get "forwarded" to cmake - at least that's what
>
> cmCursesMainForm.cxx:52
>> this->CMakeInstance->SetArgs(this->Args);
>
> looks to me.
> Why do you think that a simple forward is not enough? ccmake seems to do it
> exactly that way?

I don't know enough of the guts to know how values initially specified 
in ccmake / cmake-gui get passed to CMake. Where you could get into 
trouble is, say, you pass -DBOOST_ROOT=/some/ptah, realize you've made a 
mistake (e.g. 'ptah' -> 'path') and fix it in the gui before running 
cmake. Now does cmake see the original value or the corrected value?

That's where it *might* go sideways. But it might also be perfectly safe 
to just pass them through, e.g. if the corrected value is passed also as 
a -D argument later in the list.

However, what I was mainly getting at is that cmake-gui should also 
process the -D, etc., as I am pretty sure ccmake does, so that it can 
display those values and/or make appropriate use of the arguments.

-- 
Matthew



More information about the CMake mailing list