Merge branch 'v8.2' of ssh://git.dyninst.org/pub/dyninst into v8.2
[dyninst.git] / proccontrol / CMakeLists.txt
1 # CMake configuration for proccontrol directory
2
3 include_directories (
4     ${PROJECT_SOURCE_DIR}/proccontrol/src
5   )
6
7 set (SRC_LIST
8      src/event.C 
9      src/generator.C 
10      src/handler.C 
11      src/mailbox.C 
12      src/process.C 
13      src/pcerrors.C 
14      src/procpool.C 
15      src/irpc.C 
16      src/response.C 
17          src/resp.C
18      src/memcache.C 
19      src/procset.C 
20      src/processplat.C 
21      src/loadLibrary/injector.C 
22      src/loadLibrary/codegen.C 
23      src/x86_process.C 
24      src/loadLibrary/codegen-x86.C
25      src/loadLibrary/codegen-ppc.C 
26      src/ppc_process.C 
27      src/pcmachsyscall.C
28  )
29 if(UNIX)
30 set (SRC_LIST ${SRC_LIST}
31      src/sysv.C 
32      src/int_thread_db.C 
33      src/mmapalloc.C 
34 )
35 elseif(WIN32)
36 set (SRC_LIST ${SRC_LIST}
37         src/GeneratorWindows.C
38         src/DecoderWindows.C
39         src/windows_handler.C
40         src/windows_process.C
41         src/windows_thread.C
42         src/loadLibrary/codegen-win.C
43      ../common/src/dthread-win.C
44          ../common/src/dthread.C
45         ../common/src/MachSyscall.C
46 )
47 endif()
48
49 if (PLATFORM MATCHES freebsd)
50 set (SRC_LIST ${SRC_LIST}
51      src/freebsd.C
52      src/unix.C
53      src/notify_pipe.C
54      ../common/src/dthread-unix.C
55          ../common/src/dthread.C
56      src/loadLibrary/codegen-freebsd.C
57   )
58 elseif (PLATFORM MATCHES linux)
59 set (SRC_LIST ${SRC_LIST}
60      src/linux.C
61      src/unix.C
62      src/notify_pipe.C
63      ../common/src/dthread-unix.C
64          ../common/src/dthread.C
65      src/loadLibrary/codegen-linux.C
66   )
67 elseif (PLATFORM MATCHES bgq)
68 set (SRC_LIST ${SRC_LIST}
69      src/bluegeneq.C
70      src/bgq-messages.C
71      src/notify_pipe.C
72      ../common/src/dthread-unix.C
73          ../common/src/dthread.C
74      src/loadLibrary/codegen-linux.C
75   )
76 elseif (PLATFORM MATCHES cnl)
77 set (SRC_LIST ${SRC_LIST}
78      src/linux.C
79      src/unix.C
80      src/notify_pipe.C
81      ../common/src/dthread-unix.C
82          ../common/src/dthread.C
83      src/loadLibrary/codegen-stub.C
84   )
85 endif()
86
87 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
88
89 ADD_DEFINITIONS(-DPROCCONTROL_EXPORTS)
90
91 add_library (pcontrol ${SRC_LIST})
92 add_library (pcontrol_static STATIC ${SRC_LIST})
93 target_link_private_libraries(pcontrol common)
94 target_link_private_libraries(pcontrol ${CMAKE_DL_LIBS})
95
96 if (UNIX)
97 # Boost auto-links on Windows; don't double-link
98 target_link_private_libraries(pcontrol ${Boost_LIBRARIES})
99 target_link_private_libraries(pcontrol pthread)
100 endif()
101
102 if (LIGHTWEIGHT_SYMTAB)
103 target_link_private_libraries(pcontrol symLite)
104 else()
105 target_link_private_libraries(pcontrol symtabAPI)
106 endif()
107
108
109
110 FILE (GLOB headers "h/*.h")
111 set_target_properties (pcontrol pcontrol_static PROPERTIES PUBLIC_HEADER "${headers}")
112
113 INSTALL (TARGETS pcontrol pcontrol_static
114         EXPORT DyninstTargets
115         RUNTIME DESTINATION ${INSTALL_LIB_DIR}
116         LIBRARY DESTINATION ${INSTALL_LIB_DIR}
117         ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
118         PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})