2020-03-12 13:35:58 +08:00
|
|
|
# This file allows users to call find_package(MLIR) and pick up our targets.
|
|
|
|
|
|
|
|
@MLIR_CONFIG_CODE@
|
|
|
|
|
|
|
|
find_package(LLVM REQUIRED CONFIG
|
|
|
|
HINTS "@MLIR_CONFIG_LLVM_CMAKE_DIR@")
|
|
|
|
|
|
|
|
set(MLIR_EXPORTED_TARGETS "@MLIR_EXPORTS@")
|
|
|
|
set(MLIR_CMAKE_DIR "@MLIR_CONFIG_CMAKE_DIR@")
|
|
|
|
set(MLIR_INCLUDE_DIRS "@MLIR_CONFIG_INCLUDE_DIRS@")
|
2022-01-10 14:16:58 +08:00
|
|
|
set(MLIR_TABLEGEN_EXE "@MLIR_CONFIG_TABLEGEN_EXE@")
|
2021-10-20 03:22:56 +08:00
|
|
|
set(MLIR_INSTALL_AGGREGATE_OBJECTS "@MLIR_INSTALL_AGGREGATE_OBJECTS@")
|
2021-11-15 06:44:25 +08:00
|
|
|
set(MLIR_ENABLE_BINDINGS_PYTHON "@MLIR_ENABLE_BINDINGS_PYTHON@")
|
2020-03-12 13:35:58 +08:00
|
|
|
|
|
|
|
# For mlir_tablegen()
|
|
|
|
set(MLIR_INCLUDE_DIR "@MLIR_INCLUDE_DIR@")
|
|
|
|
set(MLIR_MAIN_SRC_DIR "@MLIR_MAIN_SRC_DIR@")
|
|
|
|
|
|
|
|
set_property(GLOBAL PROPERTY MLIR_ALL_LIBS "@MLIR_ALL_LIBS@")
|
|
|
|
set_property(GLOBAL PROPERTY MLIR_DIALECT_LIBS "@MLIR_DIALECT_LIBS@")
|
|
|
|
set_property(GLOBAL PROPERTY MLIR_CONVERSION_LIBS "@MLIR_CONVERSION_LIBS@")
|
2020-05-28 23:38:00 +08:00
|
|
|
set_property(GLOBAL PROPERTY MLIR_TRANSLATION_LIBS "@MLIR_TRANSLATION_LIBS@")
|
2020-03-12 13:35:58 +08:00
|
|
|
|
|
|
|
# Provide all our library targets to users.
|
2022-01-20 04:02:22 +08:00
|
|
|
# More specifically, configure MLIR so that it can be directly included in a top
|
|
|
|
# level CMakeLists.txt, but also so that it can be imported via `find_package`.
|
|
|
|
# This is based on how LLVM handles exports.
|
|
|
|
if(NOT TARGET MLIRSupport)
|
|
|
|
@MLIR_CONFIG_INCLUDE_EXPORTS@
|
|
|
|
endif()
|
2020-03-12 13:35:58 +08:00
|
|
|
|
|
|
|
# By creating these targets here, subprojects that depend on MLIR's
|
|
|
|
# tablegen-generated headers can always depend on these targets whether building
|
|
|
|
# in-tree with MLIR or not.
|
|
|
|
if(NOT TARGET mlir-tablegen-targets)
|
|
|
|
add_custom_target(mlir-tablegen-targets)
|
|
|
|
endif()
|
|
|
|
if(NOT TARGET mlir-headers)
|
|
|
|
add_custom_target(mlir-headers)
|
|
|
|
endif()
|
2020-05-02 13:12:40 +08:00
|
|
|
if(NOT TARGET mlir-generic-headers)
|
|
|
|
add_custom_target(mlir-generic-headers)
|
|
|
|
endif()
|
2020-03-12 13:35:58 +08:00
|
|
|
if(NOT TARGET mlir-doc)
|
|
|
|
add_custom_target(mlir-doc)
|
|
|
|
endif()
|