add interface for reading prefered based for windows binaries
[dyninst.git] / symtabAPI / CMakeLists.txt
1 # CMake configuration for symtabAPI directory
2
3 include_directories (
4     ${PROJECT_SOURCE_DIR}/symtabAPI/src
5   )
6
7
8 set (SRC_LIST
9                 src/Object.C 
10                 src/Aggregate.C 
11                 src/Function.C 
12                 src/Variable.C 
13                 src/Symbol.C 
14                 src/LineInformation.C 
15                 src/Symtab.C 
16                 src/Symtab-edit.C 
17                 src/Symtab-lookup.C 
18                 src/Symtab-deprecated.C 
19                 src/Module.C 
20                 src/Region.C 
21                 src/Collections.C 
22                 src/Type.C 
23                 src/AddrLookup.C 
24                 src/annotations.C 
25                 src/debug.C 
26                 src/SymtabReader.C 
27   )
28
29 if (PLATFORM MATCHES freebsd OR 
30     PLATFORM MATCHES linux OR 
31     PLATFORM MATCHES bgq OR
32     PLATFORM MATCHES cnl)
33
34 set (SRC_LIST ${SRC_LIST}
35     src/Object-elf.C 
36     src/Archive.C 
37     src/Archive-elf.C 
38     src/parseDwarf.C 
39     src/parseStab.C 
40     src/emitElf.C 
41     src/LinkMap.C 
42     src/emitElfStatic.C 
43     src/dwarfWalker.C
44 )
45
46 if (PLATFORM MATCHES x86_64 OR PLATFORM MATCHES amd64)
47 set (SRC_LIST ${SRC_LIST}
48     src/emitElf-64.C
49     src/emitElfStatic-x86.C 
50     src/relocationEntry-elf-x86.C
51     )
52 elseif (PLATFORM MATCHES i386)
53 set (SRC_LIST ${SRC_LIST}
54     src/emitElfStatic-x86.C
55     src/relocationEntry-elf-x86.C
56     )
57 elseif (PLATFORM MATCHES ppc32)
58 set (SRC_LIST ${SRC_LIST}
59     src/emitElfStatic-ppc32.C 
60     src/relocationEntry-elf-ppc32.C
61     )
62 elseif (PLATFORM MATCHES ppc64)
63 set (SRC_LIST ${SRC_LIST}
64     src/emitElf-64.C
65     src/emitElfStatic-ppc64.C
66     src/relocationEntry-elf-ppc64.C
67     )
68 endif()
69 endif()
70
71
72 if (PLATFORM MATCHES nt)
73 set (SRC_LIST ${SRC_LIST}
74     src/Object-nt.C
75         src/emitWin.C
76         src/relocationEntry-stub.C
77 )
78 endif()
79
80 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
81
82 ADD_DEFINITIONS(-DSYMTAB_LIB)
83   
84
85 add_library (symtabAPI ${SRC_LIST})
86 add_library (symtabAPI_static STATIC  ${SRC_LIST})
87 target_link_private_libraries (symtabAPI common)
88
89 FILE (GLOB headers "h/*.h")
90 set_target_properties (symtabAPI symtabAPI_static PROPERTIES PUBLIC_HEADER "${headers}")
91
92 if (UNIX)
93   target_link_private_libraries (symtabAPI dynElf ${LIBELF_LIBRARIES})
94   target_link_private_libraries (symtabAPI dynDwarf ${LIBDWARF_LIBRARIES})
95 endif()
96
97 INSTALL (TARGETS symtabAPI symtabAPI_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})
103