llvm.org GIT mirror llvm / 2ec48fc cmake / modules / LLVMInstallSymlink.cmake
2ec48fc

Tree @2ec48fc (Download .tar.gz)

LLVMInstallSymlink.cmake @2ec48fc

2ec309f
 
 
 
26751e1
cb3923f
2ec309f
 
 
 
 
 
26751e1
2ec309f
 
 
 
26751e1
2ec309f
 
 
# We need to execute this script at installation time because the
# DESTDIR environment variable may be unset at configuration time.
# See PR8397.

function(install_symlink name target outdir)
  if(CMAKE_HOST_UNIX)
    set(LINK_OR_COPY create_symlink)
    set(DESTDIR $ENV{DESTDIR})
  else()
    set(LINK_OR_COPY copy)
  endif()

  set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")

  message("Creating ${name}")

  execute_process(
    COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}"
    WORKING_DIRECTORY "${bindir}")

endfunction()