[cmake-developers] ExternalProject CMAKE_ARGS and CMAKE_CACHE_ARGS arguments

Brad King brad.king at kitware.com
Mon Oct 20 09:52:03 EDT 2014


On 10/16/2014 11:26 AM, Daniele E. Domenichelli wrote:
>   #    [CMAKE_ARGS args...]        # Arguments to CMake command line
>   #    [CMAKE_CACHE_ARGS args...]  # Initial cache arguments, of the form -Dvar:string=on
> 
> So, from what I understand, The first arguments are passed to the cmake
> command line, and from the second it is created a a cache file that is
> passed to cmake using -C. If the same variable is in both, CMAKE_ARGS
> wins over CMAKE_CACHE_ARGS.
[snip]
> This makes impossible to change a value later, and in my opinion makes
> one of the 2 arguments redundant, since the final effect of the 2
> variables is exactly the same.

CMAKE_CACHE_ARGS was added here:

 Added CMAKE_CACHE_ARGS to ExternalProject.
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68cd3fe0

to overcome command line length limits.  CMAKE_ARGS can contain
arguments other than cache values.  Therefore they are not fully
redundant although there is overlap.

The name "initial cache" is poor both here and for the -C argument
to cmake because the option can be used any time.  It just happened
to originate for purposes of pre-populating some cache values on
the first run.

If you'd like, please propose clearer wording for the docs.

Thanks,
-Brad




More information about the cmake-developers mailing list