[CMake] [PATCH] support for CTEST_INITIAL_CACHE in new-style ctest script

Bill Hoffman bill.hoffman at kitware.com
Wed Nov 12 19:31:43 EST 2008


Alexander Neundorf wrote:
> Hi,
> 
> the attached patch adds support for the CTEST_INITIAL_CACHE variable when 
> using new-style ctest commands.
> Now ctest_configure() checks the CTEST_INITIAL_CACHE variable and if it is not 
> empty, AND there is no CMakeCache.txt yet, it writes the initial 
> CMakeCache.txt
> I had a look at the code of the old-style ctest script, it seems there any 
> existing CMakeCache.txt is overwritten if CTEST_INITIAL_CACHE is set. Is this 
> correct ? Is this behaviour also wanted for the new-style commands ?
> I think it is not necessary, because if I want to have a fresh cmake run, I 
> can use ctest_empty_binary_directory() before, then I will also get the 
> initial cache again.
> 
> What do you think ?
> Ok to commit ?
> 

I am not sure I like the idea.  The old style ctest was declarative in 
nature.  The new one is procedural.  I am not sure I like magic global 
variables affecting commands.   A better way to do this would be to add 
an optional argument to ctest_configure that allows an initial cache to 
be passed into the function.

-Bill


More information about the CMake mailing list