diff --git a/core/clingutils/CMakeLists.txt b/core/clingutils/CMakeLists.txt index 493c89e89141d..99342dc4b16df 100644 --- a/core/clingutils/CMakeLists.txt +++ b/core/clingutils/CMakeLists.txt @@ -85,7 +85,7 @@ if (builtin_clang) set(CLANG_RESOURCE_DIR_STEM ${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}/clang) set(CLANG_RESOURCE_DIR_VERSION ${LLVM_VERSION_MAJOR}) else () - set(CLANG_RESOURCE_DIR_STEM ${LLVM_LIBRARY_DIR}/clang) + set(CLANG_RESOURCE_DIR_STEM ${CLANG_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/clang) # A user can define a clang version to use, otherwise find it (but will error if more than one version is present) if (NOT DEFINED CLANG_RESOURCE_DIR_VERSION) if (NOT EXISTS ${CLANG_RESOURCE_DIR_STEM}) diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index 4f5a3d2adddda..a4fc805ce41b5 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -408,6 +408,9 @@ if (builtin_clang) else() find_package(Clang REQUIRED CONFIG) message(STATUS "Found Clang ${CLANG_PACKAGE_VERSION} in ${CLANG_CMAKE_DIR}") + + # Forward CLANG_INSTALL_PREFIX so it can be used by core/clingutils/CMakeLists.txt + set(CLANG_INSTALL_PREFIX ${CLANG_INSTALL_PREFIX} PARENT_SCOPE) endif() # Reset the compiler flags after compiling LLVM and Clang