myx/MyxCMake/lib/macro/CreateSymlink.cmake
2022-10-24 20:03:42 +03:00

14 lines
506 B
CMake

include_guard(GLOBAL)
# Создание символических ссылок
macro(myx_create_symlink ORIGINAL_FILENAME LINKNAME)
if(UNIX AND (NOT EXISTS ${LINKNAME}))
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${ORIGINAL_FILENAME} ${LINKNAME})
else()
file(CREATE_LINK ${ORIGINAL_FILENAME} ${LINKNAME} SYMBOLIC)
endif()
endif()
endmacro(myx_create_symlink ORIGINAL_FILENAME LINKNAME)