CMake integration for Windows.
[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 (NOT PLATFORM MATCHES nt)
48 set (SRC_LIST ${SRC_LIST}
49     src/SymLiteCodeSource.C
50 )
51 endif()
52
53 if (PLATFORM MATCHES amd64 OR PLATFORM MATCHES i386 OR PLATFORM
54 MATCHES x86_64)
55 set (SRC_LIST ${SRC_LIST}
56      src/InstructionSource-x86.C
57      src/IA_x86.C
58 )
59 elseif (PLATFORM MATCHES ppc)
60 set (SRC_LIST ${SRC_LIST}
61      src/InstructionSource-power.C
62      src/IA_power.C
63 )
64 endif()
65
66 if (ENABLE_PARSE_API_GRAPHS)
67 set (SRC_LIST ${SRC_LIST}
68      src/GraphAdapter.C
69     )
70 endif()
71
72 if (NOT ${LIGHTWEIGHT_SYMTAB})
73 set (SRC_LIST ${SRC_LIST}
74     src/SymtabCodeSource.C
75     )
76 endif()
77
78 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
79
80 ADD_DEFINITIONS(-DPARSER_LIB)
81 ADD_DEFINITIONS(-DDATAFLOW_LIB)
82
83 add_library (parseAPI ${SRC_LIST})
84 target_link_libraries(parseAPI common)
85 target_link_libraries(parseAPI instructionAPI)
86
87 if (UNIX)
88 target_link_libraries(parseAPI ${LIBELF_LIBRARIES})
89 endif()
90
91 if (${LIGHTWEIGHT_SYMTAB})
92 target_link_libraries(parseAPI symLite)
93 else()
94 target_link_libraries(parseAPI symtabAPI)
95 endif()
96
97 FILE (GLOB headers "h/*.h")
98 set_target_properties (parseAPI PROPERTIES PUBLIC_HEADER "${headers}")
99
100
101 INSTALL (TARGETS parseAPI
102         EXPORT DyninstTargets
103         RUNTIME DESTINATION ${INSTALL_LIB_DIR}
104         LIBRARY DESTINATION ${INSTALL_LIB_DIR}
105         ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
106         PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})