myx/MyxCMake/lib/macro/CreateSymlink.cmake

14 lines
504 B
CMake
Raw Normal View History

2022-10-04 18:02:40 +00:00
include_guard(GLOBAL)
2022-10-24 17:03:42 +00:00
# Создание символических ссылок
macro(myx_create_symlink ORIGINAL_FILENAME LINKNAME)
if(UNIX AND (NOT EXISTS ${LINKNAME}))
2024-03-18 21:16:53 +00:00
if(${CMAKE_VERSION} VERSION_LESS 3.14.0)
2022-10-24 17:03:42 +00:00
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${ORIGINAL_FILENAME} ${LINKNAME})
2022-10-04 18:02:40 +00:00
else()
2022-10-24 17:03:42 +00:00
file(CREATE_LINK ${ORIGINAL_FILENAME} ${LINKNAME} SYMBOLIC)
2022-10-04 18:02:40 +00:00
endif()
endif()
2022-10-24 17:03:42 +00:00
endmacro(myx_create_symlink ORIGINAL_FILENAME LINKNAME)