CMake/Tests/RunCMake/file/CREATE_LINK.cmake
Tushar Maheshwari 593d986470 Tests: Avoid cross-device links in CREATE_LINK test
Add a test for COPY_ON_ERROR to cover that scenario.
2019-01-16 10:03:35 -05:00

12 lines
346 B
CMake

# start with a file in the same directory to avoid cross-device links
set(test_file ${CMAKE_CURRENT_BINARY_DIR}/CreateLinkTest.txt)
file(TOUCH ${test_file})
file(CREATE_LINK
${test_file} ${CMAKE_CURRENT_BINARY_DIR}/TestCreateLink.txt
RESULT result
)
if(NOT result STREQUAL "0")
message(SEND_ERROR "Hard link result='${result}'")
endif()