diff options
author | David Cole <DLRdave@aol.com> | 2014-03-17 11:32:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-20 13:02:50 (GMT) |
commit | 84a423040686fb5855cbe65d4aa4e209dc4ca870 (patch) | |
tree | e52e7e3541202cbc79d3ac61b6b7e9af4c586333 | |
parent | 6313be44aa465ea883e3578b3a0424ae0c217d5c (diff) | |
download | CMake-84a423040686fb5855cbe65d4aa4e209dc4ca870.zip CMake-84a423040686fb5855cbe65d4aa4e209dc4ca870.tar.gz CMake-84a423040686fb5855cbe65d4aa4e209dc4ca870.tar.bz2 |
Tests: Prevent unnecessary rebuilds in CTestTestMemcheck
Repeated "cmake . && ninja" calls were resulting in rebuilds every time.
Change the test so that it uses "file(WRITE" to generate a ".in" file and
then configure_file to "copy if different" that ".in" file to the final
generated source file.
Now, rebuilds will only occur if there are changes to the generated source
file on "cmake ." runs after the first one.
-rw-r--r-- | Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt b/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt index c5aa2cd..47d6a24 100644 --- a/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/NoLogDummyChecker/CMakeLists.txt @@ -1,7 +1,12 @@ # A dummy checker implementation that does not write the requested output file # so it triggers an error for every checker. -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c" "int main(){return 0;}\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" "int main(){return 0;}\n") + +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" + "${CMAKE_CURRENT_BINARY_DIR}/ret0.c" + ) foreach(_pseudo IN ITEMS valgrind purify BC) add_executable(pseudonl_${_pseudo} "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") |