diff --git a/clang/cmake/modules/CMakeLists.txt b/clang/cmake/modules/CMakeLists.txt --- a/clang/cmake/modules/CMakeLists.txt +++ b/clang/cmake/modules/CMakeLists.txt @@ -15,7 +15,8 @@ set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(llvm_cmake_builddir "${LLVM_LIBRARY_DIR}/cmake/llvm") +string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") +set(llvm_cmake_builddir "${llvm_cmake_builddir}/cmake/llvm") get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS) export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake) diff --git a/flang/cmake/modules/CMakeLists.txt b/flang/cmake/modules/CMakeLists.txt --- a/flang/cmake/modules/CMakeLists.txt +++ b/flang/cmake/modules/CMakeLists.txt @@ -14,7 +14,8 @@ set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(llvm_cmake_builddir "${LLVM_LIBRARY_DIR}/cmake/llvm") +string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") +set(llvm_cmake_builddir "${llvm_cmake_builddir}/cmake/llvm") get_property(FLANG_EXPORTS GLOBAL PROPERTY FLANG_EXPORTS) export(TARGETS ${FLANG_EXPORTS} FILE ${flang_cmake_builddir}/FlangTargets.cmake) diff --git a/lld/cmake/modules/CMakeLists.txt b/lld/cmake/modules/CMakeLists.txt --- a/lld/cmake/modules/CMakeLists.txt +++ b/lld/cmake/modules/CMakeLists.txt @@ -14,7 +14,8 @@ set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(llvm_cmake_builddir "${LLVM_LIBRARY_DIR}/cmake/llvm") +string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") +set(llvm_cmake_builddir "${llvm_cmake_builddir}/cmake/llvm") get_property(LLD_EXPORTS GLOBAL PROPERTY LLD_EXPORTS) export(TARGETS ${LLD_EXPORTS} FILE ${lld_cmake_builddir}/LLDTargets.cmake) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -1126,7 +1126,7 @@ message(FATAL_ERROR "LLVM_INSTALL_PACKAGE_DIR must be defined and writable. GEN_CONFIG should only be passe when building LLVM proper.") endif() # LLVM_INSTALL_PACKAGE_DIR might be absolute, so don't reuse below. - string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") + string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") set(llvm_cmake_builddir "${llvm_cmake_builddir}/cmake/llvm") file(WRITE "${llvm_cmake_builddir}/LLVMConfigExtensions.cmake" diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt --- a/llvm/cmake/modules/CMakeLists.txt +++ b/llvm/cmake/modules/CMakeLists.txt @@ -3,7 +3,7 @@ include(FindPrefixFromConfig) # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") +string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") set(llvm_cmake_builddir "${llvm_cmake_builddir}/cmake/llvm") # First for users who use an installed LLVM, create the LLVMExports.cmake file. diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt --- a/mlir/cmake/modules/CMakeLists.txt +++ b/mlir/cmake/modules/CMakeLists.txt @@ -15,7 +15,8 @@ set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(llvm_cmake_builddir "${LLVM_LIBRARY_DIR}/cmake/llvm") +string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") +set(llvm_cmake_builddir "${llvm_cmake_builddir}/cmake/llvm") get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS) export(TARGETS ${MLIR_EXPORTS} FILE ${mlir_cmake_builddir}/MLIRTargets.cmake) diff --git a/polly/cmake/CMakeLists.txt b/polly/cmake/CMakeLists.txt --- a/polly/cmake/CMakeLists.txt +++ b/polly/cmake/CMakeLists.txt @@ -12,7 +12,8 @@ set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(llvm_cmake_builddir "${LLVM_LIBRARY_DIR}/cmake/llvm") +string(REPLACE "${CMAKE_CFG_INTDIR}" "." llvm_cmake_builddir "${LLVM_LIBRARY_DIR}") +set(llvm_cmake_builddir "${llvm_cmake_builddir}/cmake/llvm") if (CMAKE_CONFIGURATION_TYPES) set(POLLY_EXPORTS_FILE_NAME "PollyExports-$>.cmake")