mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 12:16:40 +08:00
ExternalData: use file(CREATE_LINK)
This avoids spawning a new CMake command which isn't necessary.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user