forked from secure-software-engineering/phasar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.cmake.in
26 lines (23 loc) · 888 Bytes
/
Config.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set(PHASAR_VERSION 1.0.0)
@PACKAGE_INIT@
set_and_check(PHASAR_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
foreach(component ${phasar_FIND_COMPONENTS})
include("${CMAKE_CURRENT_LIST_DIR}/phasar_${component}-config.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/phasar_${component}-targets.cmake")
endforeach()
function(phasar_config executable)
find_package(LLVM 10 REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIB_PATH} ${LLVM_LIBRARY_DIRS})
find_library(LLVM_LIBRARY NAMES LLVM HINTS ${LLVM_LIBRARY_DIRS})
if(NOT ${LLVM_LIBRARY} STREQUAL "LLVM_LIBRARY-NOTFOUND")
llvm_config(${executable} USE_SHARED ${PHASAR_LLVM_DEPS})
else()
llvm_config(${executable} ${PHASAR_LLVM_DEPS})
endif()
list(REMOVE_DUPLICATES PHASAR_NEEDED_LIBS)
target_link_libraries(${executable}
PUBLIC
${PHASAR_NEEDED_LIBS}
)
endfunction()