summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/file/COPY_FILE-dir-to-file-capture.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/file/COPY_FILE-dir-to-file-capture.cmake')
-rw-r--r--Tests/RunCMake/file/COPY_FILE-dir-to-file-capture.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/COPY_FILE-dir-to-file-capture.cmake b/Tests/RunCMake/file/COPY_FILE-dir-to-file-capture.cmake
new file mode 100644
index 000000000..acec05ab3
--- /dev/null
+++ b/Tests/RunCMake/file/COPY_FILE-dir-to-file-capture.cmake
@@ -0,0 +1,8 @@
+set(oldname "${CMAKE_CURRENT_BINARY_DIR}/input")
+set(newname "${CMAKE_CURRENT_BINARY_DIR}/output")
+file(MAKE_DIRECTORY "${oldname}")
+file(COPY_FILE "${oldname}" "${newname}" RESULT result)
+message(STATUS "file(COPY_FILE) failed with result: ${result}")
+if(EXISTS "${newname}")
+ message(FATAL_ERROR "The new name exists:\n ${newname}")
+endif()