[mlir] Fix INSTALL_INTERFACE path for MLIRSparseTensorEnums
authorMichał Górny <mgorny@gentoo.org>
Mon, 24 Oct 2022 11:08:00 +0000 (13:08 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 24 Oct 2022 18:27:40 +0000 (20:27 +0200)
commit12281099dc9436920b9370ce1db714845ea662b9
treee3aeeff7af2b75057bbc21f1244ccb72ef3ff50a
parentcddea67663655591b3d650d81d6546abbdc50ae5
[mlir] Fix INSTALL_INTERFACE path for MLIRSparseTensorEnums

Fix INSTALL_INTERFACE path for exported MLIRSparseTensorEnums target
to include the include directory.  Otherwise, CMake attempts to find it
relatively to CMAKE_INSTALL_PREFIX rather than the include directory,
resulting in flang failing to configure with the following error:

    CMake Error at /usr/lib/llvm/16/lib64/cmake/llvm/AddLLVM.cmake:581 (add_library):
      Cannot find source file:

        /usr/lib/llvm/16/mlir/Dialect/SparseTensor/IR/Enums.h

      Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
      .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
    Call Stack (most recent call first):
      cmake/modules/AddFlang.cmake:64 (llvm_add_library)
      lib/Lower/CMakeLists.txt:3 (add_flang_library)

Differential Revision: https://reviews.llvm.org/D136590
mlir/lib/Dialect/SparseTensor/IR/CMakeLists.txt