mirror of
https://github.com/darlinghq/darling.git
synced 2024-11-23 12:19:43 +00:00
Add CREATE_LINK
polyfill for older CMakes
This commit is contained in:
parent
2beda36721
commit
23aacf047a
@ -46,6 +46,7 @@ include(MacroEnsureOutOfSourceBuild)
|
|||||||
include(dsym)
|
include(dsym)
|
||||||
include(xcproj)
|
include(xcproj)
|
||||||
include(architecture)
|
include(architecture)
|
||||||
|
include(create_symlink)
|
||||||
|
|
||||||
MACRO_ENSURE_OUT_OF_SOURCE_BUILD()
|
MACRO_ENSURE_OUT_OF_SOURCE_BUILD()
|
||||||
|
|
||||||
|
12
cmake/create_symlink.cmake
Normal file
12
cmake/create_symlink.cmake
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#
|
||||||
|
# used to create a symbolic link at configuration time
|
||||||
|
#
|
||||||
|
function(create_symlink target output_path)
|
||||||
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.0")
|
||||||
|
# use CREATE_LINK if we can
|
||||||
|
file(CREATE_LINK "${target}" "${output_path}" SYMBOLIC)
|
||||||
|
else()
|
||||||
|
# fallback to `ln` otherwise
|
||||||
|
execute_process(COMMAND ln -sfn "${target}" "${output_path}")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
Loading…
Reference in New Issue
Block a user