Clean up library linkage
[dyninst.git] / parseAPI / CMakeLists.txt
1 # CMake configuration for parseAPI directory
2
3 include_directories (
4     ${PROJECT_SOURCE_DIR}/parseAPI/src
5   )
6
7
8 set (SRC_LIST
9         src/ParserDetails.C 
10         src/Parser.C 
11         src/CFGFactory.C 
12         src/Function.C 
13         src/Block.C 
14         src/CodeObject.C 
15         src/debug_parse.C 
16         src/CodeSource.C 
17         src/ParseData.C
18         src/InstructionAdapter.C
19         src/Parser-speculative.C
20         src/ParseCallback.C 
21         src/IA_IAPI.C
22         src/IA_x86Details.C 
23         src/IA_powerDetails.C 
24         src/IA_platformDetailsFactory.C 
25         src/CFGModifier.C
26         src/StackTamperVisitor.C
27         ../dataflowAPI/src/ABI.C 
28         ../dataflowAPI/src/Absloc.C 
29         ../dataflowAPI/src/AbslocInterface.C 
30         ../dataflowAPI/src/convertOpcodes.C 
31         ../dataflowAPI/src/debug_dataflow.C 
32         ../dataflowAPI/src/ExpressionConversionVisitor.C 
33         ../dataflowAPI/src/InstructionCache.C 
34         ../dataflowAPI/src/liveness.C 
35         ../dataflowAPI/src/RegisterMap.C 
36         ../dataflowAPI/src/RoseImpl.C 
37         ../dataflowAPI/src/RoseInsnFactory.C 
38         ../dataflowAPI/src/slicing.C 
39         ../dataflowAPI/src/stackanalysis.C 
40         ../dataflowAPI/src/SymbolicExpansion.C 
41         ../dataflowAPI/src/SymEval.C 
42         ../dataflowAPI/src/SymEvalPolicy.C 
43         ../dataflowAPI/src/templates.C 
44         ../dataflowAPI/src/Visitors.C 
45     )
46
47 if (LIGHTWEIGHT_SYMTAB)
48 set (SRC_LIST ${SRC_LIST}
49     src/SymLiteCodeSource.C
50 )
51 else()
52 set (SRC_LIST ${SRC_LIST}
53     src/SymtabCodeSource.C
54 )
55 endif()
56
57 if (PLATFORM MATCHES amd64 OR PLATFORM MATCHES i386 OR PLATFORM
58 MATCHES x86_64)
59 set (SRC_LIST ${SRC_LIST}
60      src/InstructionSource-x86.C
61      src/IA_x86.C
62 )
63 elseif (PLATFORM MATCHES ppc)
64 set (SRC_LIST ${SRC_LIST}
65      src/InstructionSource-power.C
66      src/IA_power.C
67 )
68 endif()
69
70 if (ENABLE_PARSE_API_GRAPHS)
71 set (SRC_LIST ${SRC_LIST}
72      src/GraphAdapter.C
73     )
74 endif()
75
76 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
77
78 ADD_DEFINITIONS(-DPARSER_LIB)
79 ADD_DEFINITIONS(-DDATAFLOW_LIB)
80
81 add_library (parseAPI ${SRC_LIST})
82 add_library (parseAPI_static STATIC ${SRC_LIST})
83 target_link_private_libraries(parseAPI common)
84 target_link_private_libraries(parseAPI instructionAPI)
85
86 if (LIGHTWEIGHT_SYMTAB)
87 target_link_private_libraries(parseAPI symLite)
88 else()
89 target_link_private_libraries(parseAPI symtabAPI)
90 endif()
91
92 FILE (GLOB headers "h/*.h")
93 FILE (GLOB dataflowheaders "../dataflowAPI/h/*.h")
94 set_target_properties (parseAPI parseAPI_static PROPERTIES PUBLIC_HEADER "${headers};${dataflowheaders}")
95
96
97 INSTALL (TARGETS parseAPI parseAPI_static
98         EXPORT DyninstTargets
99         RUNTIME DESTINATION ${INSTALL_LIB_DIR}
100         LIBRARY DESTINATION ${INSTALL_LIB_DIR}
101         ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
102         PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})