diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 628428a28ae4..e6d8fdc382b5 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -365,6 +365,7 @@ macro(add_clang_library name) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang") install(TARGETS ${name} + EXPORT ClangTargets LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} RUNTIME DESTINATION bin) @@ -524,9 +525,10 @@ if (CLANG_BUILT_STANDALONE) # Install a /share/clang/cmake/ClangConfig.cmake file so that # find_package(Clang) works. Install the target list with it. + install(EXPORT ClangTargets DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake - ${CLANG_BINARY_DIR}/share/clang/cmake/ClangTargets.cmake DESTINATION share/clang/cmake) # Also copy ClangConfig.cmake to the build directory so that dependent projects