myx/MyxCMake/lib/macro/CreateSymlink.cmake
2022-10-05 11:35:08 +03:00

12 lines
362 B
CMake

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)