forked from secure-software-engineering/phasar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.cmake.in
75 lines (59 loc) · 1.75 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
set(PHASAR_VERSION 2403)
@PACKAGE_INIT@
set_and_check(PHASAR_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(PHASAR_LIBRARY_DIR "@PACKAGE_LIBRARY_INSTALL_DIR@")
include (CMakeFindDependencyMacro)
include("${CMAKE_CURRENT_LIST_DIR}/PhasarDepsExports.cmake")
find_dependency(Boost 1.65.1 COMPONENTS graph REQUIRED)
find_dependency(LLVM 14 REQUIRED CONFIG)
set(PHASAR_USE_LLVM_FAT_LIB @USE_LLVM_FAT_LIB@)
set(PHASAR_BUILD_DYNLIB @PHASAR_BUILD_DYNLIB@)
set(PHASAR_USE_Z3 @PHASAR_USE_Z3@)
if (PHASAR_USE_Z3)
find_dependency(Z3)
endif()
set(PHASAR_COMPONENTS
utils
passes
config
db
pointer
controlflow
llvm_utils
llvm_db
llvm_pointer
llvm_typehierarchy
llvm_controlflow
taintconfig
mono
llvm
llvm_ifdside
analysis_strategy
)
list(REMOVE_DUPLICATES phasar_FIND_COMPONENTS)
set(PHASAR_NEEDED_LIBS)
include("${CMAKE_CURRENT_LIST_DIR}/PhasarExports.cmake")
foreach(component ${phasar_FIND_COMPONENTS})
if(NOT ${component} IN_LIST PHASAR_COMPONENTS)
set(phasar_FOUND false)
set(phasar_NOT_FOUND_MESSAGE "Unsupported component: ${component}. Valid components are: ${PHASAR_COMPONENTS}")
endif()
list(APPEND PHASAR_NEEDED_LIBS phasar::${component})
endforeach()
if (NOT DEFINED phasar_FOUND OR phasar_FOUND EQUAL TRUE)
foreach(component ${phasar_FIND_COMPONENTS})
# For backwards compatibility -- will be removed with next release
add_library(phasar::phasar_${component} ALIAS phasar::${component})
endforeach()
if (NOT phasar_FIND_COMPONENTS)
list(APPEND PHASAR_NEEDED_LIBS phasar::phasar)
# Default target
add_library(phasar ALIAS phasar::phasar)
endif()
function(phasar_config executable)
target_link_libraries(${executable}
PUBLIC
${PHASAR_NEEDED_LIBS}
)
endfunction()
endif()