summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/BuildDepends
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-04-08 13:03:59 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-04-08 13:03:59 (GMT)
commitf6c5958047ee8a9084bf230a6c1acb4801cb2b93 (patch)
tree0822d1acd30fa67ad0a33b6c46a6303920d599c5 /Tests/RunCMake/BuildDepends
parent1baf2cbd3dfd76aadcbfd84f6d42d13fcb838218 (diff)
parentadd7abc8352b87184579401cb2493c72e07aa212 (diff)
downloadCMake-f6c5958047ee8a9084bf230a6c1acb4801cb2b93.zip
CMake-f6c5958047ee8a9084bf230a6c1acb4801cb2b93.tar.gz
CMake-f6c5958047ee8a9084bf230a6c1acb4801cb2b93.tar.bz2
Merge topic 'ninja-restat-custom-command-byproducts'
add7abc8 Ninja: Restat custom command byproducts even with a SYMBOLIC output (#16049) ff805113 Ninja: Fix detection of custom command symbolic outputs
Diffstat (limited to 'Tests/RunCMake/BuildDepends')
-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