Parcourir la source

ENH: fix test to work with in-source testing of CMake

Bill Hoffman il y a 17 ans
Parent
commit
407a2bc737
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      Tests/CMakeBuildTest.cmake.in

+ 6 - 0
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}"