[CMake] Add headers to install target (#2100)

pull/2103/head
Maksim Levental 2023-05-08 14:27:00 -05:00 committed by GitHub
parent ef6dae6ae2
commit c7a24c4d21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 0 deletions

View File

@ -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()