1# This file allows users to call find_package(Polly) and pick up our targets.
2
3find_package(LLVM REQUIRED CONFIG
4             HINTS "@POLLY_CONFIG_LLVM_CMAKE_DIR@")
5
6set(Polly_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
7set(Polly_BUNDLED_ISL @POLLY_BUNDLED_ISL@)
8set(Polly_ENABLE_GPGPU_CODEGEN @POLLY_ENABLE_GPGPU_CODEGEN@)
9
10set(Polly_DEFINITIONS ${LLVM_DEFINITIONS})
11set(Polly_INCLUDE_DIRS @POLLY_CONFIG_INCLUDE_DIRS@ ${LLVM_INCLUDE_DIRS})
12set(Polly_LIBRARY_DIRS @POLLY_CONFIG_LIBRARY_DIRS@)
13set(Polly_EXPORTED_TARGETS @POLLY_CONFIG_EXPORTED_TARGETS@)
14set(Polly_LIBRARIES ${LLVM_LIBRARIES} ${Polly_EXPORTED_TARGETS})
15
16# Imported Targets:
17@ISL_CONFIG_CODE@
18
19if (Polly_ENABLE_GPGPU_CODEGEN AND NOT TARGET PollyPPCG)
20  add_library(PollyPPCG @POLLY_CONFIG_TARGET_PollyPPCG_TYPE@ IMPORTED)
21  set_property(TARGET PollyPPCG PROPERTY INTERFACE_LINK_LIBRARIES @ISL_TARGET@)
22endif()
23
24if (NOT TARGET Polly)
25  add_library(Polly @POLLY_CONFIG_TARGET_Polly_TYPE@ IMPORTED)
26  set_property(TARGET Polly PROPERTY INTERFACE_LINK_LIBRARIES @ISL_TARGET@)
27  if (Polly_ENABLE_GPGPU_CODEGEN)
28    set_property(TARGET Polly APPEND PROPERTY INTERFACE_LINK_LIBRARIES PollyPPCG)
29  endif()
30endif()
31
32if (NOT TARGET LLVMPolly)
33  add_library(LLVMPolly @POLLY_CONFIG_TARGET_LLVMPolly_TYPE@ IMPORTED)
34  set_property(TARGET LLVMPolly PROPERTY INTERFACE_LINK_LIBRARIES Polly)
35endif()
36
37# Exported locations:
38file(GLOB CONFIG_FILES "${Polly_CMAKE_DIR}/PollyExports-*.cmake")
39foreach(f ${CONFIG_FILES})
40  include(${f})
41endforeach()
42