[CMake] Fwd: ARGV to pass to CMAKE_COMMAND

Bill Hoffman bill.hoffman at kitware.com
Tue Apr 7 21:47:51 EDT 2009


Alexander Neundorf wrote:
> On Wednesday 08 April 2009, Bill O'Hara wrote:
>> Perhaps I'm missing something. What I'm trying to do is script things so
>> the usercan do this
>>
>> cd build
>> cmake -Dfoo=bar /path/to/sources
>> make
> 
> The problem here is that the user could also do:
> cd build
> cmake-gui
> # set foo and maybe other variables inside cmake-gui
> make
> 
> In this case knowing the command line doesn't help you.
> That's why I suggest either give a list of known and useful variables to the 
> other cmake, or try to do something directly with the cache.
> 

Or, the could do this:

cd buld
cmake -Dfoo=bar /path/to/sources
....  // update some cmakelist file
make  // cmake will automatically re-run without the -Dfoo=bar

There are just so many ways cmake can run without that -Dfoo=bar, you 
really can not depend on it.

-Bill


More information about the CMake mailing list