[cmake-developers] ExternalProject CMAKE_ARGS and CMAKE_CACHE_ARGS arguments
Daniele E. Domenichelli
daniele.domenichelli at gmail.com
Thu Oct 16 11:26:10 EDT 2014
Hello all,
I have question about CMAKE_ARGS and CMAKE_CACHE_ARGS, and I'm not sure
if this is the intended behaviour or not...
>From the documentation:
# [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.
>From the documentation, I was expecting that the CMAKE_CACHE_ARGS would
be used only to create the initial cache, and that the user could go to
the build directory and change it, but the cache file passes the FORCE
argument to the set commands (lines 910 and 930).
set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)")
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.
So, is this the intended behaviour? The FORCE argument allows one to
change CMAKE_CACHE_ARGS and have the cache updated, but that's exactly
what CMAKE_ARGS does.
I don't know exactly how the -C flag works, but I was thinking that if
the FORCE argument is dropped, the 2 arguments could be used with
different purposes: CMAKE_ARGS is always enforced, CMAKE_CACHE_ARGS
could be modified by the user later. Would it work and does this make
sense for you?
Cheers,
Daniele
More information about the cmake-developers
mailing list