I have following command:
add_custom_command(
TARGET Packaging POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
source_file
target_file )
Sometimes the source_file
is a symlink. However, when it is copied, the referenced file is copied not the symlink.
How can I tell CMake command to copy the symlink as it is without de-referencing it?
It seems that there is no direct solution in CMake till now https://gitlab.kitware.com/cmake/cmake/issues/14609
A work around is to call a shell script that does the trick.