LLVMInstallSymlink.cmake 569 B

123456789101112131415161718192021
  1. # We need to execute this script at installation time because the
  2. # DESTDIR environment variable may be unset at configuration time.
  3. # See PR8397.
  4. function(install_symlink name target outdir)
  5. set(DESTDIR $ENV{DESTDIR})
  6. if(CMAKE_HOST_UNIX)
  7. set(LINK_OR_COPY create_symlink)
  8. else()
  9. set(LINK_OR_COPY copy)
  10. endif()
  11. set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
  12. message(STATUS "Creating ${name}")
  13. execute_process(
  14. COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}"
  15. WORKING_DIRECTORY "${bindir}")
  16. endfunction()