summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-12-08 14:07:18 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-12-08 14:07:18 (GMT)
commite72987dc11b17a9c0630ba053dc4d6488f751002 (patch)
tree25c0e48b6bfba986e92de4f9d3285aaf4a7e40a5 /Tests
parentcf54d8597d23141273f6e2a07f00ece959bb06e3 (diff)
parent6c67b8168cd44e5900982ca3e36049792934d83d (diff)
downloadCMake-e72987dc11b17a9c0630ba053dc4d6488f751002.zip
CMake-e72987dc11b17a9c0630ba053dc4d6488f751002.tar.gz
CMake-e72987dc11b17a9c0630ba053dc4d6488f751002.tar.bz2
Merge topic 'custom-command-multiple-outputs'
6c67b816 Makefile: Workaround Borland Make bug with multiple outputs 65ea5eb7 Tests: Cover rebuild with multiple custom command outputs (#15116) 644b4688 Makefile: Fix rebuild with multiple custom command outputs (#15116) 8a4c6d2d Xcode: Fix rebuild with multiple custom command outputs (#15116)
Diffstat (limited to 'Tests')
-rw-r--r--Tests/BuildDepends/CMakeLists.txt28
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt13
2 files changed, 41 insertions, 0 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 6209bb8..78e9e17 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -65,6 +65,7 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_exe.h
set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_check.txt)
file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in original\n")
help_xcode_depends()
@@ -177,6 +178,19 @@ else()
"external.out is missing")
endif()
+if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi1-out2-copy.txt)
+ file(STRINGS ${BuildDepends_BINARY_DIR}/Project/multi1-out2-copy.txt multi1_out)
+ if("${multi1_out}" STREQUAL "multi1-in original")
+ message(STATUS "multi1-out2-copy.txt contains '${multi1_out}'")
+ else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "multi1-out2-copy.txt contains '${multi1_out}'")
+ endif()
+else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "multi1-out2-copy.txt is missing")
+endif()
+
message("Waiting 3 seconds...")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 3)
@@ -202,6 +216,7 @@ if(TEST_LINK_DEPENDS)
endif()
file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in changed\n")
help_xcode_depends()
@@ -319,3 +334,16 @@ else()
message(SEND_ERROR "Project did not rebuild properly: "
"external.out is missing")
endif()
+
+if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi1-out2-copy.txt)
+ file(STRINGS ${BuildDepends_BINARY_DIR}/Project/multi1-out2-copy.txt multi1_out)
+ if("${multi1_out}" STREQUAL "multi1-in changed")
+ message(STATUS "multi1-out2-copy.txt contains '${multi1_out}'")
+ else()
+ message(SEND_ERROR "Project did not rebuild properly: "
+ "multi1-out2-copy.txt contains '${multi1_out}'")
+ endif()
+else()
+ message(SEND_ERROR "Project did not rebuild properly: "
+ "multi1-out2-copy.txt is missing")
+endif()
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index 9ee4a43..cb9fbf8 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -151,3 +151,16 @@ ExternalProject_Add(ExternalBuild
-Dexternal_out=${CMAKE_CURRENT_BINARY_DIR}/external.out
INSTALL_COMMAND ""
)
+
+add_custom_command(
+ OUTPUT multi1-out1.txt multi1-out2.txt
+ COMMAND ${CMAKE_COMMAND} -E copy multi1-in.txt multi1-out1.txt
+ COMMAND ${CMAKE_COMMAND} -E copy multi1-in.txt multi1-out2.txt
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/multi1-in.txt
+ )
+add_custom_command(
+ OUTPUT multi1-out2-copy.txt
+ COMMAND ${CMAKE_COMMAND} -E copy multi1-out2.txt multi1-out2-copy.txt
+ DEPENDS multi1-out2.txt
+ )
+add_custom_target(multi1 ALL DEPENDS multi1-out2-copy.txt)