mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 21:58:50 -05:00
Merge topic 'ExternalData-stop-forking-to-cmake'
b6c022eaa2ExternalData: use `file(CREATE_LINK)`01cc8bf930ExternalData: use `file(COPY_FILE)` instead of forking CMake Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5875
This commit is contained in:
@@ -941,10 +941,11 @@ 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.
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${src}" "${tmp}" RESULT_VARIABLE result)
|
||||
file(COPY_FILE "${src}" "${tmp}" RESULT result)
|
||||
endif()
|
||||
if(result)
|
||||
file(REMOVE "${tmp}")
|
||||
|
||||
Reference in New Issue
Block a user