diff --git a/llvm/cmake/modules/LLVMInstallSymlink.cmake b/llvm/cmake/modules/LLVMInstallSymlink.cmake index b5c35f706cb7..ac25e40b1436 100644 --- a/cmake/modules/LLVMInstallSymlink.cmake +++ b/cmake/modules/LLVMInstallSymlink.cmake @@ -4,11 +4,16 @@ include(GNUInstallDirs) +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../cmake/Modules" ${CMAKE_MODULE_PATH}) +include(ExtendPath) + function(install_symlink name target outdir) set(DESTDIR $ENV{DESTDIR}) - set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}") + message(STATUS "Creating ${name} at ${bindir} (${CMAKE_MODULE_PATH})") + extend_path(prefixed_outdir "${CMAKE_INSTALL_PREFIX}" "${outdir}") + set(bindir "${DESTDIR}${prefixed_outdir}") - message(STATUS "Creating ${name}") + message(STATUS "Creating ${name} at ${bindir}") execute_process( COMMAND "${CMAKE_COMMAND}" -E create_symlink "${target}" "${name}"