myx/MyxCMake/lib/macro/CreateSymlink.cmake
2022-10-09 01:01:31 +03:00

12 lines
374 B
CMake

include_guard(GLOBAL)
macro(myx_create_symlink original linkname)
if(NOT EXISTS ${linkname})
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
execute_process(COMMAND ${CMAKE_COMMAND} -E myx_create_symlink ${original} ${linkname})
else()
file(CREATE_LINK ${original} ${linkname} SYMBOLIC)
endif()
endif()
endmacro(myx_create_symlink original linkname)