view cmake/modules/LLVMInstallSymlink.cmake @ 129:9ec641e857f8

Fix compile error to update llvm 5.0
author mir3636
date Tue, 12 Dec 2017 19:42:58 +0900
parents 7d135dc70f03
children 3a76565eade5
line wrap: on
line source

# 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(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()