From 407a2bc7370ed9984ddfec8fc816631c0a4b650f Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Sat, 18 Oct 2008 10:31:16 -0400 Subject: [PATCH] ENH: fix test to work with in-source testing of CMake --- Tests/CMakeBuildTest.cmake.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in index b8c7791bc..ebba702f7 100644 --- a/Tests/CMakeBuildTest.cmake.in +++ b/Tests/CMakeBuildTest.cmake.in @@ -1,6 +1,12 @@ # create the binary directory make_directory("@CMAKE_BUILD_TEST_BINARY_DIR@") +# remove the CMakeCache.txt file from the source dir +# if there is one, so that in-source cmake tests +# still pass +message("Remove: @CMAKE_BUILD_TEST_SOURCE_DIR@/CMakeCache.txt") +file(REMOVE "@CMAKE_BUILD_TEST_SOURCE_DIR@/CMakeCache.txt") + # run cmake in the binary directory message("running: ${CMAKE_COMMAND}") execute_process(COMMAND "${CMAKE_COMMAND}"