summaryrefslogtreecommitdiff
path: root/Modules/ExternalData.cmake
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2021-03-02 14:51:22 -0500
committerBen Boeckel <ben.boeckel@kitware.com>2021-03-11 08:43:30 -0500
commitb6c022eaa27abcc265a5961b22e5e0c44df88752 (patch)
treec6755eadd7db296778b38089dff6def78525745d /Modules/ExternalData.cmake
parent01cc8bf93084d91d0a1e2258a3b7307ef5ec5852 (diff)
downloadcmake-b6c022eaa27abcc265a5961b22e5e0c44df88752.tar.gz
ExternalData: use `file(CREATE_LINK)`
This avoids spawning a new CMake command which isn't necessary.
Diffstat (limited to 'Modules/ExternalData.cmake')
-rw-r--r--Modules/ExternalData.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 032e423c09..1850e74625 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -941,7 +941,8 @@ function(_ExternalData_link_or_copy src dst)
file(RELATIVE_PATH tgt "${dst_dir}" "${src}")
endif()
endif()
- execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink "${tgt}" "${tmp}" RESULT_VARIABLE result)
+ # Create link (falling back to copying if there's a problem).
+ file(CREATE_LINK "${tgt}" "${tmp}" RESULT result COPY_ON_ERROR SYMBOLIC)
else()
# Create a copy.
file(COPY_FILE "${src}" "${tmp}" RESULT result)