summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake28
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake1
2 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake
new file mode 100644
index 0000000..6948c35
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake
@@ -0,0 +1,28 @@
+add_custom_command(
+ OUTPUT gen-byproduct gen-byproduct-stamp
+ BYPRODUCTS byproduct
+ COMMAND ${CMAKE_COMMAND} -E touch gen-byproduct-stamp
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different gen-byproduct-stamp byproduct
+ )
+set_property(SOURCE gen-byproduct PROPERTY SYMBOLIC 1)
+add_custom_target(produce DEPENDS gen-byproduct)
+
+add_custom_command(
+ OUTPUT use-byproduct
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/byproduct
+ COMMAND ${CMAKE_COMMAND} -E touch use-byproduct
+ )
+add_custom_target(drive ALL DEPENDS use-byproduct)
+add_dependencies(drive produce)
+
+file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+if (check_step EQUAL 1)
+ set(check_pairs
+ \"${CMAKE_CURRENT_BINARY_DIR}/use-byproduct|${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp\"
+ )
+else()
+ set(check_pairs
+ \"${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp|${CMAKE_CURRENT_BINARY_DIR}/use-byproduct\"
+ )
+endif()
+")
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 6b2b85a..8541070 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -39,6 +39,7 @@ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 7|Xcode")
unset(run_BuildDepends_skip_step_2)
endif()
+run_BuildDepends(Custom-Symbolic-and-Byproduct)
run_BuildDepends(Custom-Always)
if(RunCMake_GENERATOR MATCHES "Make" AND