File: create_link.cmake

package info (click to toggle)
vcmi 1.6.5%2Bdfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid, trixie
  • size: 32,060 kB
  • sloc: cpp: 238,971; python: 265; sh: 224; xml: 157; ansic: 78; objc: 61; makefile: 49
file content (14 lines) | stat: -rw-r--r-- 556 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
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()