blob: 4d7b2d755b9b1b451571b993275900048b38da5a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
################################################################################
# Build OpenPGM
################################################################################
INCLUDE( OpenPGMConfig )
ADD_DEFINITIONS(${LIBPGM_CFLAGS})
# OpenPGM will be built in the binary tree
SET(pgm
"${CMAKE_CURRENT_SOURCE_DIR}/openpgm-${pgm_VERSION}/pgm"
)
# This has been adapted from SConscript.libpgm
SET(pgm_SRCS
${pgm}/thread.c
${pgm}/mem.c
${pgm}/string.c
${pgm}/list.c
${pgm}/slist.c
${pgm}/queue.c
${pgm}/hashtable.c
${pgm}/messages.c
${pgm}/error.c
${pgm}/math.c
${pgm}/packet_parse.c
${pgm}/packet_test.c
${pgm}/sockaddr.c
${pgm}/time.c
${pgm}/if.c
${pgm}/getifaddrs.c
${pgm}/getnodeaddr.c
${pgm}/indextoaddr.c
${pgm}/indextoname.c
${pgm}/nametoindex.c
${pgm}/inet_network.c
${pgm}/md5.c
${pgm}/rand.c
${pgm}/gsi.c
${pgm}/tsi.c
${pgm}/txw.c
${pgm}/rxw.c
${pgm}/skbuff.c
${pgm}/socket.c
${pgm}/source.c
${pgm}/receiver.c
${pgm}/recv.c
${pgm}/engine.c
${pgm}/timer.c
${pgm}/net.c
${pgm}/rate_control.c
${pgm}/checksum.c
${pgm}/reed_solomon.c
${pgm}/wsastrerror.c
${pgm}/histogram.c
)
SET(pgm_HDRS
${pgm}/include/pgm/atomic.h
${pgm}/include/pgm/backtrace.h
${pgm}/include/pgm/engine.h
${pgm}/include/pgm/error.h
${pgm}/include/pgm/gsi.h
${pgm}/include/pgm/http.h
${pgm}/include/pgm/if.h
${pgm}/include/pgm/list.h
${pgm}/include/pgm/log.h
${pgm}/include/pgm/macros.h
${pgm}/include/pgm/mem.h
${pgm}/include/pgm/messages.h
${pgm}/include/pgm/msgv.h
${pgm}/include/pgm/packet.h
${pgm}/include/pgm/pgm.h
${pgm}/include/pgm/signal.h
${pgm}/include/pgm/skbuff.h
${pgm}/include/pgm/snmp.h
${pgm}/include/pgm/socket.h
${pgm}/include/pgm/time.h
${pgm}/include/pgm/tsi.h
${pgm}/include/pgm/types.h
${pgm}/include/pgm/version.h
${pgm}/include/pgm/winint.h
${pgm}/include/pgm/wininttypes.h
)
SET(pgm_GENERATED
${CMAKE_CURRENT_BINARY_DIR}/version.c
${CMAKE_CURRENT_BINARY_DIR}/galois_tables.c
)
# We need to generate galois_tables.c ...
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/galois_tables.c
COMMAND perl ${pgm}/galois_generator.pl > ${CMAKE_CURRENT_BINARY_DIR}/galois_tables.c
DEPENDS ${pgm}/galois_generator.pl
)
# ... and version.c ...
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.c
COMMAND python ${pgm}/version_generator.py > ${CMAKE_CURRENT_BINARY_DIR}/version.c
DEPENDS ${pgm}/version_generator.py
)
IF(comment_this_out_we_dont_need_it)
# ... and we need to unpack the tree.
ADD_CUSTOM_COMMAND(
OUTPUT
${pgm_SRCS}
${pgm_HDRS}
${pgm}/galois_generator.pl
${pgm}/version_generator.py
DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/libpgm-${pgm_VERSION}.tar.bz2"
"${CMAKE_CURRENT_SOURCE_DIR}/01-libpgm-fix-switch-fallthrough.patch"
COMMAND rm -rf "${CMAKE_CURRENT_BINARY_DIR}/libpgm-src"
COMMAND bzip2 -dc "${CMAKE_CURRENT_SOURCE_DIR}/libpgm-${pgm_VERSION}.tar.bz2" | tar -C "${CMAKE_CURRENT_BINARY_DIR}" -x
COMMAND mv "${CMAKE_CURRENT_BINARY_DIR}/libpgm-${pgm_VERSION}" "${CMAKE_CURRENT_BINARY_DIR}/libpgm-src"
COMMAND cd ${pgm} && patch -p1 < "${CMAKE_CURRENT_SOURCE_DIR}/01-libpgm-fix-switch-fallthrough.patch"
)
ADD_CUSTOM_COMMAND(TARGET clean
COMMAND rm -rf "${CMAKE_CURRENT_BINARY_DIR}/libpgm-src"
)
ADD_CUSTOM_TARGET(
unpack_libpgm
DEPENDS ${pgm_SRCS} ${pgm_HDRS}
)
ENDIF(comment_this_out_we_dont_need_it)
ADD_LIBRARY(
pgm
STATIC
${pgm_SRCS}
${pgm_HDRS}
${pgm_GENERATED}
)
TARGET_LINK_LIBRARIES(pgm
${LIBPGM_LIBRARIES}
)
LINK_DIRECTORIES(
${GLIB_LIBRARY_DIRS}
)
ADD_DEFINITIONS(
${GLIB_CFLAGS}
)
|