myx/MyxCMake/lib/macro/CreateSymlink.cmake

12 lines
362 B
CMake
Raw Normal View History

2022-10-04 18:02:40 +00:00
include_guard(GLOBAL)
macro(create_symlink original linkname)
if(NOT EXISTS ${linkname})
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${original} ${linkname})
else()
file(CREATE_LINK ${original} ${linkname} SYMBOLIC)
endif()
endif()
endmacro(create_symlink original linkname)