myx/MyxCMake/lib/macro/CreateSymlink.cmake

12 lines
374 B
CMake
Raw Normal View History

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