mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
#3151-windows-build-symlinks
This commit is contained in:
14
cmake_modules/create_link.cmake
Normal file
14
cmake_modules/create_link.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
#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()
|
||||
Reference in New Issue
Block a user