Merge branch 'v8.2' of ssh://follis.cs.wisc.edu/p/paradyn/development/bill/head/dynin...
[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 )
46 endif()
47
48 if (PLATFORM MATCHES freebsd)
49 set (SRC_LIST ${SRC_LIST}
50      src/freebsd.C
51      src/unix.C
52      src/notify_pipe.C
53      ../common/src/dthread-unix.C
54          ../common/src/dthread.C
55      src/loadLibrary/codegen-freebsd.C
56   )
57 elseif (PLATFORM MATCHES linux)
58 set (SRC_LIST ${SRC_LIST}
59      src/linux.C
60      src/unix.C
61      src/notify_pipe.C
62      ../common/src/dthread-unix.C
63          ../common/src/dthread.C
64      src/loadLibrary/codegen-linux.C
65   )
66 elseif (PLATFORM MATCHES bgq)
67 set (SRC_LIST ${SRC_LIST}
68      src/bluegeneq.C
69      src/bgq-messages.C
70      src/notify_pipe.C
71      ../common/src/dthread-unix.C
72          ../common/src/dthread.C
73      src/loadLibrary/codegen-linux.C
74   )
75 elseif (PLATFORM MATCHES cnl)
76 set (SRC_LIST ${SRC_LIST}
77      src/linux.C
78      src/unix.C
79      src/notify_pipe.C
80      ../common/src/dthread-unix.C
81          ../common/src/dthread.C
82      src/loadLibrary/codegen-stub.C
83   )
84 endif()
85
86 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
87
88 ADD_DEFINITIONS(-DPROCCONTROL_EXPORTS)
89
90 add_library (pcontrol ${SRC_LIST})
91 add_library (pcontrol_static STATIC ${SRC_LIST})
92 target_link_private_libraries(pcontrol common)
93 target_link_private_libraries(pcontrol ${CMAKE_DL_LIBS})
94
95 if (UNIX)
96 # Boost auto-links on Windows; don't double-link
97 target_link_private_libraries(pcontrol ${Boost_LIBRARIES})
98 target_link_private_libraries(pcontrol pthread)
99 endif()
100
101 if (LIGHTWEIGHT_SYMTAB)
102 target_link_private_libraries(pcontrol symLite)
103 else()
104 target_link_private_libraries(pcontrol symtabAPI)
105 endif()
106
107
108
109 FILE (GLOB headers "h/*.h")
110 set_target_properties (pcontrol pcontrol_static PROPERTIES PUBLIC_HEADER "${headers}")
111
112 INSTALL (TARGETS pcontrol pcontrol_static
113         EXPORT DyninstTargets
114         RUNTIME DESTINATION ${INSTALL_LIB_DIR}
115         LIBRARY DESTINATION ${INSTALL_LIB_DIR}
116         ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
117         PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})