Fixed CMakeLists.txt to export mlir/include/mlir/Dialenct/SparseTensor/IR/Enums.h...
authorMurali Vijayaraghavan <muralivi@google.com>
Fri, 21 Oct 2022 21:09:13 +0000 (21:09 +0000)
committerMurali Vijayaraghavan <muralivi@google.com>
Fri, 21 Oct 2022 21:47:02 +0000 (21:47 +0000)
Differential Revision: https://reviews.llvm.org/D136477

mlir/lib/Dialect/SparseTensor/IR/CMakeLists.txt

index 019b5d0..feb2273 100644 (file)
@@ -17,7 +17,9 @@ endif()
 # Older versions of cmake (< 3.19) require INTERFACE libraries to separate
 # the `add_library` and `target_sources` calls.
 add_library(MLIRSparseTensorEnums INTERFACE)
-target_sources(MLIRSparseTensorEnums INTERFACE ${MLIRSparseTensorEnums_srcs})
+target_sources(MLIRSparseTensorEnums INTERFACE
+       $<BUILD_INTERFACE:${MLIRSparseTensorEnums_srcs}>
+       $<INSTALL_INTERFACE:mlir/Dialect/SparseTensor/IR/Enums.h>)
 # The `add_mlir_library_install` is required for other libraries to
 # depend on this one, but the conditional itself and the phony target
 # are copypasta from `add_mlir_library`.  Afaict (wrengr), the version