forked from secure-software-engineering/phasar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.cmake.in
69 lines (55 loc) · 1.64 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
set(PHASAR_VERSION 1.0.0)
@PACKAGE_INIT@
set_and_check(PHASAR_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(PHASAR_LIBRARY_DIR "@PACKAGE_LIBRARY_INSTALL_DIR@")
include (CMakeFindDependencyMacro)
find_dependency(nlohmann_json)
find_dependency(nlohmann_json_schema_validator)
find_package(Boost 1.65.1 COMPONENTS graph REQUIRED)
find_package(LLVM 14 REQUIRED CONFIG)
set(PHASAR_USE_LLVM_FAT_LIB @USE_LLVM_FAT_LIB@)
set(PHASAR_BUILD_DYNLIB @PHASAR_BUILD_DYNLIB@)
# TODO: The order seems to be important in the include'ing loop below. Fix this!
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
controller
)
list(REMOVE_DUPLICATES phasar_FIND_COMPONENTS)
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()
endforeach()
foreach(component ${PHASAR_COMPONENTS})
include("${CMAKE_CURRENT_LIST_DIR}/phasar_${component}-targets.cmake")
endforeach()
include("${CMAKE_CURRENT_LIST_DIR}/phasar-targets.cmake")
if (NOT phasar_FIND_COMPONENTS)
list(APPEND PHASAR_NEEDED_LIBS phasar::phasar)
set(phasar_FIND_COMPONENTS ${PHASAR_NEEDED_LIBS})
endif()
foreach(component ${phasar_FIND_COMPONENTS})
list(APPEND PHASAR_NEEDED_LIBS phasar::phasar_${component})
endforeach()
function(phasar_config executable)
target_link_libraries(${executable}
PUBLIC
${PHASAR_NEEDED_LIBS}
)
endfunction()