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 @@ -28,6 +28,14 @@ set(CLANG_CONFIG_CMAKE_DIR) set(CLANG_CONFIG_LLVM_CMAKE_DIR) +# For compatibility with projects that include(ClangConfig) +# via CMAKE_MODULE_PATH, place API modules next to it. +file(COPY . + DESTINATION ${clang_cmake_builddir} + FILES_MATCHING PATTERN *.cmake + PATTERN CMakeFiles EXCLUDE + ) + # Generate ClangConfig.cmake for the install tree. set(CLANG_CONFIG_CODE " # Compute the installation prefix from this LLVMConfig.cmake file location.