ExternalProject: Add CMAKE_CACHE_DEFAULT_ARGS arguments

This argument allows to set default arguments that are written in the
initial cache file, but that are not forced, and therefore allows the
user to change these values later (CMAKE_ARGS and CMAKE_CACHE_ARGS
always overwrite the values).

Also add some documentation to explain the differences between these 3
arguments.

Extend ExternalProjectLocal test to cover CMAKE_CACHE_DEFAULT_ARGS.
This commit is contained in:
Daniele E. Domenichelli
2014-10-28 10:52:16 +01:00
committed by Brad King
parent 36cf8a1eb9
commit 98cdb658e4
2 changed files with 46 additions and 9 deletions

View File

@@ -66,6 +66,7 @@ if(can_build_tutorial_step5)
ExternalProject_Add(${proj}
URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
TEST_AFTER_INSTALL 1
LOG_TEST 1
)