summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/file/COPY_FILE-file-to-dir-capture.cmake
blob: 98621c6e18e62c60bd8f2b8d5a16d67ed8299f10 (plain)
1
2
3
4
5
6
7
8
9
set(oldname "${CMAKE_CURRENT_BINARY_DIR}/input")
set(newname "${CMAKE_CURRENT_BINARY_DIR}/output")
file(WRITE "${oldname}" "")
file(MAKE_DIRECTORY "${newname}")
file(COPY_FILE "${oldname}" "${newname}" RESULT result)
message(STATUS "file(COPY_FILE) failed with result: ${result}")
if(NOT EXISTS "${oldname}")
  message(FATAL_ERROR "The old name does not exist:\n ${oldname}")
endif()