Add libdl link dependency to proccontrol.
[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  )
28 if(UNIX)
29 set (SRC_LIST ${SRC_LIST}
30      src/sysv.C 
31      src/int_thread_db.C 
32      src/mmapalloc.C 
33 )
34 elseif(WIN32)
35 set (SRC_LIST ${SRC_LIST}
36         src/GeneratorWindows.C
37         src/DecoderWindows.C
38         src/windows_handler.C
39         src/windows_process.C
40         src/windows_thread.C
41         src/loadLibrary/codegen-win.C
42 )
43 endif()
44
45 if (PLATFORM MATCHES freebsd)
46 set (SRC_LIST ${SRC_LIST}
47      src/freebsd.C
48      src/unix.C
49      src/notify_pipe.C
50      ../common/src/dthread-unix.C
51      src/loadLibrary/codegen-freebsd.C
52   )
53 elseif (PLATFORM MATCHES linux)
54 set (SRC_LIST ${SRC_LIST}
55      src/linux.C
56      src/unix.C
57      src/notify_pipe.C
58      ../common/src/dthread-unix.C
59      src/loadLibrary/codegen-linux.C
60   )
61 elseif (PLATFORM MATCHES bgq)
62 set (SRC_LIST ${SRC_LIST}
63      src/bluegeneq.C
64      src/bgq-messages.C
65      src/notify_pipe.C
66      ../common/src/dthread-unix.C
67      src/loadLibrary/codegen-linux.C
68   )
69 elseif (PLATFORM MATCHES cnl)
70 set (SRC_LIST ${SRC_LIST}
71      src/linux.C
72      src/unix.C
73      src/notify_pipe.C
74      ../common/src/dthread-unix.C
75      src/loadLibrary/codegen-stub.C
76   )
77 endif()
78
79 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
80
81 ADD_DEFINITIONS(-DPROCCONTROL_EXPORTS)
82
83 add_library (pcontrol ${SRC_LIST})
84 add_library (pcontrol_static STATIC ${SRC_LIST})
85 target_link_libraries(pcontrol common)
86 target_link_libraries(pcontrol ${CMAKE_DL_LIBS})
87
88 if (UNIX)
89 target_link_libraries(pcontrol dynElf)
90 target_link_libraries(pcontrol symLite)
91 endif()
92
93 if(WIN32)
94 target_link_libraries(pcontrol symtabAPI)
95 endif()
96
97 FILE (GLOB headers "h/*.h")
98 set_target_properties (pcontrol pcontrol_static PROPERTIES PUBLIC_HEADER "${headers}")
99
100 INSTALL (TARGETS pcontrol pcontrol_static
101         EXPORT DyninstTargets
102         RUNTIME DESTINATION ${INSTALL_LIB_DIR}
103         LIBRARY DESTINATION ${INSTALL_LIB_DIR}
104         ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
105         PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})