diff options
author | Brad King <brad.king@kitware.com> | 2013-02-18 15:43:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-18 15:47:27 (GMT) |
commit | c307e1c911dbbafb1673799212a4e5f4e211b9f8 (patch) | |
tree | 0db58b6ce371ef40797d6a4b8611bf3d74771d3d /Tests | |
parent | 2963c9828ce5193334d60b38b051f1ce59bb3df3 (diff) | |
download | CMake-c307e1c911dbbafb1673799212a4e5f4e211b9f8.zip CMake-c307e1c911dbbafb1673799212a4e5f4e211b9f8.tar.gz CMake-c307e1c911dbbafb1673799212a4e5f4e211b9f8.tar.bz2 |
Tests/RunCMake: Allow tests to control build tree behavior
Teach the run_cmake to allow tests to set a custom test build directory.
Also add an option to skip removing the build directory.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 40b98d4..00faa4c 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -26,8 +26,12 @@ function(run_cmake test) endif() endforeach() set(RunCMake_TEST_SOURCE_DIR "${top_src}") - set(RunCMake_TEST_BINARY_DIR "${top_bin}/${test}-build") - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + if(NOT RunCMake_TEST_BINARY_DIR) + set(RunCMake_TEST_BINARY_DIR "${top_bin}/${test}-build") + endif() + if(NOT RunCMake_TEST_NO_CLEAN) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + endif() file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") if(NOT DEFINED RunCMake_TEST_OPTIONS) set(RunCMake_TEST_OPTIONS "") |