浏览代码

Tests: Add RunCMake "prep" step

Give tests a chance to write content to the build tree before CMake
runs on it.
Brad King 7 年之前
父节点
当前提交
c3635e502c
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Tests/RunCMake/RunCMake.cmake

+ 5 - 0
Tests/RunCMake/RunCMake.cmake

@@ -45,6 +45,11 @@ function(run_cmake test)
     file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
   endif()
   file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+  if(RunCMake-prep-file AND EXISTS ${top_src}/${RunCMake-prep-file})
+    include(${top_src}/${RunCMake-prep-file})
+  else()
+    include(${top_src}/${test}-prep.cmake OPTIONAL)
+  endif()
   if(NOT DEFINED RunCMake_TEST_OPTIONS)
     set(RunCMake_TEST_OPTIONS "")
   endif()