From c7a24c4d21812ae82184f6d8d1ebdef332b84eaa Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Mon, 8 May 2023 14:27:00 -0500 Subject: [PATCH] [CMake] Add headers to install target (#2100) --- CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 790fcfeb5..818368d89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,3 +212,35 @@ else() endif() add_subdirectory(test) + +if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(DIRECTORY include/torch-mlir include/torch-mlir-c + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + COMPONENT torch-mlir-headers + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" + PATTERN "*.inc" + PATTERN "*.td" + PATTERN "LICENSE.TXT" + ) + + install(DIRECTORY ${TORCH_MLIR_BINARY_DIR}/include/torch-mlir + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + COMPONENT torch-mlir-headers + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" + PATTERN "*.gen" + PATTERN "*.inc" + PATTERN "*.td" + PATTERN "CMakeFiles" EXCLUDE + PATTERN "config.h" EXCLUDE + ) + + if (NOT LLVM_ENABLE_IDE) + add_llvm_install_targets(install-torch-mlir-headers + DEPENDS torch-mlir-headers + COMPONENT torch-mlir-headers) + endif() +endif() \ No newline at end of file