1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
vcmi/cmake_modules/create_link.cmake

15 lines
556 B
CMake
Raw Normal View History

2023-11-06 14:29:36 +02:00
#message(${CMAKE_ARGV0}) # cmake.exe
#message(${CMAKE_ARGV1}) # -P
#message(${CMAKE_ARGV2}) # thisfilename
#message(${CMAKE_ARGV3}) # existing
#message(${CMAKE_ARGV4}) # linkname
if (WIN32)
file(TO_NATIVE_PATH ${CMAKE_ARGV3} existing_native)
file(TO_NATIVE_PATH ${CMAKE_ARGV4} linkname_native)
execute_process(COMMAND cmd.exe /c RD /Q "${linkname_native}")
execute_process(COMMAND cmd.exe /c mklink /J "${linkname_native}" "${existing_native}")
else()
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_ARGV3} ${CMAKE_ARGV4})
endif()