[CMake] Fwd: ARGV to pass to CMAKE_COMMAND

Bill Hoffman bill.hoffman at kitware.com
Tue Apr 7 16:14:07 EDT 2009


Bill O'Hara wrote:
> Also to mail list.
> 
> ---------- Forwarded message ----------
> From: *Bill O'Hara* <billtohara at gmail.com <mailto:billtohara at gmail.com>>
> Date: Tue, Apr 7, 2009 at 12:51 PM
> Subject: Re: [CMake] ARGV to pass to CMAKE_COMMAND
> To: a.neundorf-work at gmx.net <mailto:a.neundorf-work at gmx.net>
> 
> 
> I think it makes sense for us. We have a quite large build and sometimes 
> users want to rebuild part of our software automatically rather than use 
> a preinstalled version. We can support this with recursive calls to 
> cmake for the particular code they are trying to build but we need to 
> also pass down whatever parameters they passed to the top-level cmake 
> invocation. We don't know them all ahead of time, nor do we really want 
> to hardcode them explicitly in the calls to cmake.
> 

I suppose you might be able to copy the CMakeCache.txt or parts of it 
down to the sub-project.  Any -D options given to cmake will be in the 
cache with lots of other stuff....  Also, it is not really a reliable 
thing to do anyway.   What if the user does this:

cd build
cmake -Dfooba=bar ../source
cmake ../source   # this one does not have -Dfooba=bar on the command 
line, but it will have fooba set in the cache from the previous run.

-Bill


More information about the CMake mailing list