summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/file/CREATE_LINK-COPY_ON_ERROR.cmake
blob: 777ef4e6c47004efbf8b508f21b6687a268a6ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
# Use COPY_ON_ERROR to handle the case where the source and destination
# directory are on different devices. Cross-device links are not permitted
# and the following command falls back to copying the file if link fails.
file(CREATE_LINK
  ${CMAKE_CURRENT_LIST_FILE} TestCreateLink.cmake
  RESULT result
  COPY_ON_ERROR
  )
if(NOT result STREQUAL "0")
  message(SEND_ERROR "COPY_ON_ERROR failed: '${result}'")
endif()