CREATE_LINK-COPY_ON_ERROR.cmake 418 B

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