summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/file/COPY_FILE-link-to-file.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/file/COPY_FILE-link-to-file.cmake')
-rw-r--r--Tests/RunCMake/file/COPY_FILE-link-to-file.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/COPY_FILE-link-to-file.cmake b/Tests/RunCMake/file/COPY_FILE-link-to-file.cmake
new file mode 100644
index 0000000..93a0204
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-link-to-file.cmake
@@ -0,0 +1,10 @@
+set(lnkname "${CMAKE_CURRENT_BINARY_DIR}/link")
+set(oldname "${CMAKE_CURRENT_BINARY_DIR}/input")
+set(newname "${CMAKE_CURRENT_BINARY_DIR}/output")
+file(WRITE "${lnkname}" "a")
+file(CREATE_LINK "${lnkname}" "${oldname}")
+file(COPY_FILE "${oldname}" "${newname}")
+file(READ "${newname}" new)
+if(NOT "${new}" STREQUAL "a")
+ message(FATAL_ERROR "New name:\n ${newname}\ndoes not contain expected content 'a'.")
+endif()