-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
184 lines (156 loc) · 4.5 KB
/
CMakeLists.txt
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# (C) 2020-2022 by folkert van heusden <[email protected]>, released under Apache License v2.0
cmake_minimum_required(VERSION 3.9.4)
project(myip VERSION 6.5)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
add_definitions("-D_FILE_OFFSET_BITS=64")
#set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
add_compile_options(-Wall -pedantic)
add_executable(myip
address_cache.cpp
any_addr.cpp
arp.cpp
ax25.cpp
BearSSLHelpers.cpp
buffer_in.cpp
buffer_out.cpp
dns.cpp
duration_events.cpp
echo.cpp
fifo_stats.cpp
font.cpp
graphviz.cpp
hash.cpp
http.cpp
icmp.cpp
icmp4.cpp
icmp6.cpp
ipv4.cpp
ipv6.cpp
irc.cpp
lldp.cpp
log.cpp
mac_resolver.cpp
main.cpp
mdns.cpp
mqtt.cpp
mqtt_client.cpp
mynetperf.cpp
ndp.cpp
net.cpp
network_layer.cpp
nrpe.cpp
ntp.cpp
packet.cpp
phys.cpp
phys_gen_ppp.cpp
phys_kiss.cpp
phys_ppp.cpp
phys_promiscuous.cpp
phys_sctp_udp.cpp
phys_slip.cpp
phys_tap.cpp
phys_vpn_insertion_point.cpp
proc.cpp
router.cpp
sctp.cpp
sctp_crc32c.cpp
session.cpp
sip.cpp
snmp.cpp
snmp_data.cpp
snmp_elem.cpp
socks_proxy.cpp
stats.cpp
stats_tracker.cpp
stats_utils.cpp
str.cpp
syslog.cpp
tcp.cpp
tcp_udp_fw.cpp
time.cpp
transport_layer.cpp
tty.cpp
ud.cpp
udp.cpp
utils.cpp
vnc.cpp
vpn.cpp
)
add_executable(myiptop
log.cpp
myiptop.cpp
stats_utils.cpp
str.cpp
time.cpp
utils.cpp
)
add_executable(myipnetstat
log.cpp
myipnetstat.cpp
time.cpp
utils.cpp
)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)
target_link_libraries(myip Threads::Threads)
target_link_libraries(myiptop Threads::Threads)
target_link_libraries(myipnetstat Threads::Threads)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)
target_link_libraries(myip Threads::Threads)
target_link_libraries(myip -lrt)
target_link_libraries(myip -lbearssl)
target_link_libraries(myip -latomic)
target_link_libraries(myip -lpcap)
target_link_libraries(myip -lutil)
include(FindPkgConfig)
pkg_check_modules(JANSSON REQUIRED jansson)
target_link_libraries(myip ${JANSSON_LIBRARIES})
target_include_directories(myip PUBLIC ${JANSSON_INCLUDE_DIRS})
target_compile_options(myip PUBLIC ${JANSSON_CFLAGS_OTHER})
target_link_libraries(myipnetstat ${JANSSON_LIBRARIES})
target_include_directories(myipnetstat PUBLIC ${JANSSON_INCLUDE_DIRS})
target_compile_options(myipnetstat PUBLIC ${JANSSON_CFLAGS_OTHER})
pkg_check_modules(SNDFILE REQUIRED sndfile)
target_link_libraries(myip ${SNDFILE_LIBRARIES})
target_include_directories(myip PUBLIC ${SNDFILE_INCLUDE_DIRS})
target_compile_options(myip PUBLIC ${SNDFILE_CFLAGS_OTHER})
pkg_check_modules(SAMPLERATE REQUIRED samplerate)
target_link_libraries(myip ${SAMPLERATE_LIBRARIES})
target_include_directories(myip PUBLIC ${SAMPLERATE_INCLUDE_DIRS})
target_compile_options(myip PUBLIC ${SAMPLERATE_CFLAGS_OTHER})
pkg_check_modules(NCURSES REQUIRED ncurses)
target_link_libraries(myiptop ${NCURSES_LIBRARIES})
target_include_directories(myiptop PUBLIC ${NCURSES_INCLUDE_DIRS})
target_compile_options(myiptop PUBLIC ${NCURSES_CFLAGS_OTHER})
pkg_check_modules(SPEEX REQUIRED speex)
target_link_libraries(myip ${SPEEX_LIBRARIES})
target_include_directories(myip PUBLIC ${SPEEX_INCLUDE_DIRS})
target_compile_options(myip PUBLIC ${SPEEX_CFLAGS_OTHER})
pkg_check_modules(ZLIB REQUIRED zlib)
target_link_libraries(myip ${ZLIB_LIBRARIES})
target_include_directories(myip PUBLIC ${ZLIB_INCLUDE_DIRS})
target_compile_options(myip PUBLIC ${ZLIB_CFLAGS_OTHER})
pkg_check_modules(LIBBSD REQUIRED libbsd-overlay)
target_link_libraries(myip ${LIBBSD_LIBRARIES})
target_include_directories(myip PUBLIC ${LIBBSD_INCLUDE_DIRS})
target_compile_options(myip PUBLIC ${LIBBSD_CFLAGS_OTHER})
find_package(OpenSSL REQUIRED)
target_include_directories(myip PUBLIC ${OPENSSL_INCLUDE_DIR})
target_link_libraries(myip OpenSSL::SSL OpenSSL::Crypto)
target_include_directories(myiptop PUBLIC ${OPENSSL_INCLUDE_DIR})
target_link_libraries(myiptop OpenSSL::SSL OpenSSL::Crypto)
pkg_check_modules(LIBCONFIG REQUIRED libconfig++)
target_link_libraries(myip ${LIBCONFIG_LIBRARIES})
target_include_directories(myip PUBLIC ${LIBCONFIG_INCLUDE_DIRS})
target_compile_options(myip PUBLIC ${LIBCONFIG_CFLAGS_OTHER})
pkg_check_modules(LIBJPEG REQUIRED libturbojpeg)
target_link_libraries(myip ${LIBJPEG_LIBRARIES})
target_include_directories(myip PUBLIC ${LIBJPEG_INCLUDE_DIRS})
target_compile_options(myip PUBLIC ${LIBJPEG_CFLAGS_OTHER})
target_link_libraries(myiptop -lrt -lz)