[CMake] Setting initial CMake cache in extended Ctest scripting

Bill Hoffman bill.hoffman at kitware.com
Wed Dec 17 17:26:49 EST 2008


Bartlett, Roscoe A wrote:
> Hello,
>  
> How do I set the initial cache when using extended Ctest scripting?  I 
> tried setting the variable CTEST_INITIAL_CACHE but it seems to be 
> getting ignored.  I just set:
>  
>    SET(CTEST_CMAKE_GENERATOR "Unix Makefiles")
>  
> along with CTEST_INITIAL_CACHE and I expected the CTEST_COFNIGURE(...) 
> command to just work.
>  
> Are there some examples out there of real extended Ctest scripts that I 
> could look at?  I tend not to trust what gets written in untestable 
> documentation.

We use something like this:

# this is the initial cache to use for the binary tree, be careful to escape
# any quotes inside of this string if you use it
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
SITE:STRING=${hostname}
BUILDNAME:STRING=${BUILDNAME}
DART_ROOT:PATH=
CVSCOMMAND:FILEPATH=${CTEST_UPDATE_COMMAND}
DROP_METHOD:STRING=http
CTEST_TEST_CTEST:BOOL=1
CVS_UPDATE_OPTIONS:STRING=${CTEST_UPDATE_OPTIONS}
DART_TESTING_TIMEOUT:STRING=${CTEST_TEST_TIMEOUT}
")

Here is a script:
http://www.cdash.org/CDash/viewNotes.php?buildid=231851

-Bill


More information about the CMake mailing list