]> The Tcpdump Group git mirrors - tcpdump/blob - CMakeLists.txt
getservent() is a replaceable function.
[tcpdump] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8.6)
2
3 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
4
5 project(tcpdump)
6 set(LIBRARY_NAME netdissect)
7
8 ###################################################################
9 # Parameters
10 ###################################################################
11
12 option(WITH_SMI "Build with libsmi, if available" ON)
13 option(ENABLE_SMB "Build with the SMB dissector" ON)
14
15 #
16 # By default, build universal with the appropriate set of architectures
17 # for the OS on which we're doing the build.
18 #
19 if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
20 #
21 # Get the major version of Darwin.
22 #
23 string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MAJOR "${CMAKE_SYSTEM_VERSION}")
24
25 if(SYSTEM_VERSION_MAJOR EQUAL 9)
26 #
27 # Leopard. Build for x86 and 32-bit PowerPC, with
28 # x86 first. (That's what Apple does.)
29 #
30 set(CMAKE_OSX_ARCHITECTURES "i386;ppc")
31 elseif(SYSTEM_VERSION_MAJOR EQUAL 10)
32 #
33 # Snow Leopard. Build for x86-64 and x86, with
34 # x86-64 first. (That's what Apple does.)
35 #
36 set(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
37 endif()
38 endif()
39
40 ###################################################################
41 # Versioning
42 ###################################################################
43
44 # Get, parse, format and set tcpdump's version string from
45 # [tcpdump_root]/VERSION for later use.
46
47 # Get MAJOR, MINOR, PATCH & SUFFIX
48 file(STRINGS ${tcpdump_SOURCE_DIR}/VERSION
49 PACKAGE_VERSION
50 LIMIT_COUNT 1 # Read only the first line
51 )
52
53 ######################################
54 # Project settings
55 ######################################
56
57 add_definitions(-DHAVE_CONFIG_H)
58
59 include_directories(
60 ${CMAKE_CURRENT_BINARY_DIR}
61 ${tcpdump_SOURCE_DIR}
62 )
63
64 if(MSVC)
65 add_definitions(-D__STDC__)
66 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
67 endif(MSVC)
68
69 if(MSVC)
70 if (USE_STATIC_RT)
71 MESSAGE(STATUS "Use STATIC runtime")
72 set(NAME_RT MT)
73 set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT")
74 set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
75 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
76 set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
77
78 set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
79 set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
80 set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
81 set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
82 else (USE_STATIC_RT)
83 MESSAGE(STATUS "Use DYNAMIC runtime")
84 set(NAME_RT MD)
85 set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
86 set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
87 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
88 set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
89
90 set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD")
91 set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD")
92 set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
93 set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd")
94 endif (USE_STATIC_RT)
95 endif(MSVC)
96
97 ###################################################################
98 # Detect available platform features
99 ###################################################################
100
101 include(CMakePushCheckState)
102 include(CheckIncludeFile)
103 include(CheckIncludeFiles)
104 include(CheckFunctionExists)
105 include(CheckSymbolExists)
106 include(CheckStructHasMember)
107 include(CheckTypeSize)
108
109 #
110 # Header files.
111 #
112 check_include_file(fcntl.h HAVE_FCNTL_H)
113 check_include_file(rpc/rpc.h HAVE_RPC_RPC_H)
114 check_include_file(rpc/rpcent.h HAVE_RPC_RPCENT_H)
115 check_include_file(netdnet/dnetdb.h HAVE_NETDNET_DNETDB_H)
116 check_include_files("sys/types.h sys/socket.h net/if.h net/pfvar.h"
117 HAVE_NET_PFVAR_H)
118 if(HAVE_NET_PFVAR_H)
119 check_include_files("sys/types.h sys/socket.h net/if.h net/pfvar.h net/if_pflog.h"
120 HAVE_NET_IF_PFLOG_H)
121 if(HAVE_NET_IF_PFLOG_H)
122 set(LOCALSRC print-pflog.c ${LOCALSRC})
123 endif(HAVE_NET_IF_PFLOG_H)
124 endif(HAVE_NET_PFVAR_H)
125 check_include_file(netinet/if_ether.h HAVE_NETINET_IF_ETHER_H)
126
127 #
128 # You are in a twisty little maze of UN*Xes, all different.
129 # Some might not have ether_ntohost().
130 # Some might have it and declare it in <net/ethernet.h>.
131 # Some might have it and declare it in <netinet/ether.h>
132 # Some might have it and declare it in <sys/ethernet.h>.
133 # Some might have it and declare it in <arpa/inet.h>.
134 # Some might have it and declare it in <netinet/if_ether.h>.
135 # Some might have it and not declare it in any header file.
136 #
137 # Before you is a C compiler.
138 #
139 check_function_exists(ether_ntohost HAVE_ETHER_NTOHOST)
140 if(HAVE_ETHER_NTOHOST)
141 #
142 # OK, we have ether_ntohost(). Is it declared in <net/ethernet.h>?
143 #
144 # This test fails if we don't have <net/ethernet.h> or if we do
145 # but it doesn't declare ether_ntohost().
146 #
147 check_symbol_exists(ether_ntohost net/ethernet.h NET_ETHERNET_H_DECLARES_ETHER_NTOHOST)
148 if(NET_ETHERNET_H_DECLARES_ETHER_NTOHOST)
149 #
150 # Yes - we have it declared.
151 #
152 set(HAVE_DECL_ETHER_NTOHOST TRUE)
153 endif()
154 #
155 # Did that succeed?
156 #
157 if(NOT HAVE_DECL_ETHER_NTOHOST)
158 #
159 # No - how about <netinet/ether.h>, as on Linux?
160 #
161 # This test fails if we don't have <netinet/ether.h>
162 # or if we do but it doesn't declare ether_ntohost().
163 #
164 check_symbol_exists(ether_ntohost netinet/ether.h NETINET_ETHER_H_DECLARES_ETHER_NTOHOST)
165 if(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST)
166 #
167 # Yes - we have it declared.
168 #
169 set(HAVE_DECL_ETHER_NTOHOST TRUE)
170 endif()
171 endif()
172 #
173 # Did that succeed?
174 #
175 if(NOT HAVE_DECL_ETHER_NTOHOST)
176 #
177 # No - how about <sys/ethernet.h>, as on Solaris 10 and later?
178 #
179 # This test fails if we don't have <sys/ethernet.h>
180 # or if we do but it doesn't declare ether_ntohost().
181 #
182 check_symbol_exists(ether_ntohost sys/ethernet.h SYS_ETHERNET_H_DECLARES_ETHER_NTOHOST)
183 if(SYS_ETHERNET_H_DECLARES_ETHER_NTOHOST)
184 #
185 # Yes - we have it declared.
186 #
187 set(HAVE_DECL_ETHER_NTOHOST TRUE)
188 endif()
189 endif()
190 #
191 # Did that succeed?
192 #
193 if(NOT HAVE_DECL_ETHER_NTOHOST)
194 #
195 # No, how about <arpa/inet.h>, as on AIX?
196 #
197 # This test fails if we don't have <arpa/inet.h>
198 # or if we do but it doesn't declare ether_ntohost().
199 #
200 check_symbol_exists(ether_ntohost arpa/inet.h ARPA_INET_H_DECLARES_ETHER_NTOHOST)
201 if(ARPA_INET_H_DECLARES_ETHER_NTOHOST)
202 #
203 # Yes - we have it declared.
204 #
205 set(HAVE_DECL_ETHER_NTOHOST TRUE)
206 endif()
207 endif()
208 #
209 # Did that succeed?
210 #
211 if(NOT HAVE_DECL_ETHER_NTOHOST)
212 #
213 # No, how about <netinet/if_ether.h>?
214 # On some platforms, it requires <net/if.h> and
215 # <netinet/in.h>, and we always include it with
216 # both of them, so test it with both of them.
217 #
218 # This test fails if we don't have <netinet/if_ether.h>
219 # and the headers we include before it, or if we do but
220 # <netinet/if_ether.h> doesn't declare ether_ntohost().
221 #
222 check_symbol_exists(ether_ntohost "sys/types.h;sys/socket.h;net/if.h;netinet/in.h;netinet/if_ether.h" NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST)
223 if(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST)
224 #
225 # Yes - we have it declared.
226 #
227 set(HAVE_DECL_ETHER_NTOHOST TRUE)
228 endif()
229 endif()
230 #
231 # After all that, is ether_ntohost() declared?
232 #
233 if(NOT HAVE_DECL_ETHER_NTOHOST)
234 #
235 # No, we'll have to declare it ourselves.
236 # Do we have "struct ether_addr" if we include<netinet/if_ether.h>?
237 #
238 check_struct_has_member("struct ether_addr" octet "sys/types.h;sys/socket.h;net/if.h;netinet/in.h;netinet/if_ether.h" HAVE_STRUCT_ETHER_ADDR)
239 endif()
240 endif()
241
242 #
243 # As the autoconf manual says, AC_HEADER_TIME is obsolete, as all UN*Xes
244 # let you include both time.h and sys/time.h, so just say we can.
245 #
246 check_include_file(bitypes.h HAVE_SYS_BITYPES_H)
247 check_include_file(limits.h HAVE_LIMITS_H)
248
249 #
250 # Functions.
251 #
252 check_function_exists(vfprintf HAVE_VFPRINTF)
253 check_function_exists(strlcat HAVE_STRLCAT)
254 check_function_exists(strlcpy HAVE_STRLCPY)
255 check_function_exists(strdup HAVE_STRDUP)
256 check_function_exists(strsep HAVE_STRSEP)
257 check_function_exists(getservent HAVE_GETSERVENT)
258 check_function_exists(getopt_long HAVE_GETOPT_LONG)
259 check_function_exists(vsnprintf HAVE_VSNPRINTF)
260 check_function_exists(snprintf HAVE_SNPRINTF)
261 check_function_exists(fork HAVE_FORK)
262 check_function_exists(vfork HAVE_VFORK)
263 check_function_exists(strftime HAVE_STRFTIME)
264 check_function_exists(setlinebuf HAVE_SETLINEBUF)
265
266 #
267 # Data types.
268 #
269 # XXX - there's no check_struct() macro that's like check_struct_has_member()
270 # except that it only checks for the existence of the structure type,
271 # so we use check_struct_has_member() and look for ss_family.
272 #
273 check_struct_has_member("struct sockaddr_storage" ss_family sys/socket.h HAVE_SOCKADDR_STORAGE)
274 set(CMAKE_EXTRA_INCLUDE_FILES unistd.h sys/socket.h)
275 check_type_size("socklen_t" SOCKLEN_T)
276 set(CMAKE_EXTRA_INCLUDE_FILES unistd.h)
277
278 #
279 # Structure fields.
280 #
281 check_struct_has_member("struct sockaddr" sa_len sys/socket.h HAVE_SOCKADDR_SA_LEN)
282
283 ######################################
284 # External dependencies
285 ######################################
286
287 #
288 # libsmi.
289 #
290 if(WITH_SMI)
291 find_package(SMI)
292 if(SMI_FOUND)
293 set(USE_LIBSMI ON)
294 endif(SMI_FOUND)
295 endif(WITH_SMI)
296
297 #
298 # libpcap/WinPcap.
299 # First find it, then check for functions in it.
300 #
301 find_package(PCAP REQUIRED)
302
303 #
304 # Check for various functions in libpcap/WinPcap.
305 #
306 include_directories(${PCAP_INCLUDE_DIR})
307 cmake_push_check_state()
308 set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY})
309
310 check_function_exists(pcap_list_datalinks HAVE_PCAP_LIST_DATALINKS)
311 if(HAVE_PCAP_LIST_DATALINKS)
312 check_function_exists(pcap_free_datalinks HAVE_PCAP_FREE_DATALINKS)
313 else(HAVE_PCAP_LIST_DATALINKS)
314 # XXX TODO - get our version of pcap_list_datalinks() and pcap_free_datalinks
315 endif(HAVE_PCAP_LIST_DATALINKS)
316 check_function_exists(pcap_set_datalink HAVE_PCAP_SET_DATALINK)
317 check_function_exists(pcap_datalink_name_to_val HAVE_PCAP_DATALINK_NAME_TO_VAL)
318 if(HAVE_PCAP_DATALINK_NAME_TO_VAL)
319 check_function_exists(pcap_datalink_val_to_description HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION)
320 if(NOT HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION)
321 # XXX TODO - get our version of pcap_datalink_val_to_description()
322 endif(NOT HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION)
323 else(HAVE_PCAP_DATALINK_NAME_TO_VAL)
324 # XXX TODO - get our version of pcap_datalink_name_to_val() etc.
325 endif(HAVE_PCAP_DATALINK_NAME_TO_VAL)
326
327 #
328 # Check for "pcap_breakloop()"; you can't substitute for it if
329 # it's absent (it has hooks into the live capture routines),
330 # so just define the HAVE_ value if it's there.
331 #
332 check_function_exists(pcap_breakloop HAVE_PCAP_BREAKLOOP)
333
334 #
335 # Check for "pcap_dump_ftell()" and use a substitute version
336 # if it's not present.
337 #
338 check_function_exists(pcap_dump_ftell HAVE_PCAP_DUMP_FTELL)
339 if(NOT HAVE_PCAP_DUMP_FTELL)
340 # XXX TODO - get our version of pcap_dump_ftell()
341 endif(NOT HAVE_PCAP_DUMP_FTELL)
342
343 #
344 # Do we have the new open API? Check for pcap_create, and assume that,
345 # if we do, we also have pcap_activate() and the other new routines
346 # introduced in libpcap 1.0.0.
347 #
348 check_function_exists(pcap_create HAVE_PCAP_CREATE)
349 if(HAVE_PCAP_CREATE)
350 #
351 # OK, do we have pcap_set_tstamp_type? If so, assume we have
352 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
353 #
354 check_function_exists(pcap_set_tstamp_type HAVE_PCAP_SET_TSTAMP_TYPE)
355
356 #
357 # And do we have pcap_set_tstamp_precision? If so, we assume
358 # we also have pcap_open_offline_with_tstamp_precision.
359 #
360 check_function_exists(pcap_set_tstamp_precision HAVE_PCAP_SET_TSTAMP_PRECISION)
361 endif(HAVE_PCAP_CREATE)
362
363 #
364 # Check for a miscellaneous collection of functions which we use
365 # if we have them.
366 #
367 check_function_exists(pcap_findalldevs HAVE_PCAP_FINDALLDEVS)
368 if(HAVE_PCAP_FINDALLDEVS)
369 #
370 # Check for libpcap having pcap_findalldevs() but the pcap.h header
371 # not having pcap_if_t; some versions of Mac OS X shipped with pcap.h
372 # from 0.6 and libpcap 0.8, so that libpcap had pcap_findalldevs but
373 # pcap.h didn't have pcap_if_t.
374 #
375 cmake_push_check_state()
376 set(CMAKE_EXTRA_INCLUDE_FILES pcap.h)
377 check_type_size(pcap_if_t PCAP_IF_T)
378 cmake_pop_check_state()
379 endif(HAVE_PCAP_FINDALLDEVS)
380 check_function_exists(pcap_dump_flush HAVE_PCAP_DUMP_FLUSH)
381 check_function_exists(pcap_lib_version HAVE_PCAP_LIB_VERSION)
382 if(NOT HAVE_PCAP_LIB_VERSION)
383 # Check for the pcap_version string variable and set HAVE_PCAP_VERSION
384 endif(NOT HAVE_PCAP_LIB_VERSION)
385 check_function_exists(pcap_setdirection HAVE_PCAP_SETDIRECTION)
386 check_function_exists(pcap_set_immediate_mode HAVE_PCAP_SET_IMMEDIATE_MODE)
387 check_function_exists(pcap_dump_ftell64 HAVE_PCAP_DUMP_FTELL64)
388 check_function_exists(pcap_open HAVE_PCAP_OPEN)
389 check_function_exists(pcap_findalldevs_ex HAVE_PCAP_FINDALLDEVS_EX)
390
391 #
392 # Check for special debugging functions
393 #
394 check_function_exists(pcap_set_parser_debug HAVE_PCAP_SET_PARSER_DEBUG)
395 if(NOT HAVE_PCAP_SET_PARSER_DEBUG)
396 # Check whether libpcap defines pcap_debug or yydebug
397 endif(NOT HAVE_PCAP_SET_PARSER_DEBUG)
398
399 check_function_exists(pcap_set_optimizer_debug HAVE_PCAP_SET_OPTIMIZER_DEBUG)
400
401 cmake_pop_check_state()
402
403 ######################################
404 # Input files
405 ######################################
406
407 set(NETDISSECT_SOURCE_LIST_C
408 addrtoname.c
409 addrtostr.c
410 af.c
411 ascii_strcasecmp.c
412 checksum.c
413 cpack.c
414 gmpls.c
415 gmt2local.c
416 in_cksum.c
417 ipproto.c
418 l2vpn.c
419 machdep.c
420 nlpid.c
421 oui.c
422 parsenfsfh.c
423 print.c
424 print-802_11.c
425 print-802_15_4.c
426 print-ah.c
427 print-ahcp.c
428 print-aodv.c
429 print-aoe.c
430 print-ap1394.c
431 print-arcnet.c
432 print-arp.c
433 print-ascii.c
434 print-atalk.c
435 print-atm.c
436 print-babel.c
437 print-beep.c
438 print-bfd.c
439 print-bgp.c
440 print-bootp.c
441 print-bt.c
442 print-calm-fast.c
443 print-carp.c
444 print-cdp.c
445 print-cfm.c
446 print-chdlc.c
447 print-cip.c
448 print-cnfp.c
449 print-dccp.c
450 print-decnet.c
451 print-dhcp6.c
452 print-domain.c
453 print-dtp.c
454 print-dvmrp.c
455 print-eap.c
456 print-egp.c
457 print-eigrp.c
458 print-enc.c
459 print-esp.c
460 print-ether.c
461 print-fddi.c
462 print-forces.c
463 print-fr.c
464 print-frag6.c
465 print-ftp.c
466 print-geneve.c
467 print-geonet.c
468 print-gre.c
469 print-hncp.c
470 print-hsrp.c
471 print-http.c
472 print-icmp.c
473 print-icmp6.c
474 print-igmp.c
475 print-igrp.c
476 print-ip.c
477 print-ip6.c
478 print-ip6opts.c
479 print-ipcomp.c
480 print-ipfc.c
481 print-ipnet.c
482 print-ipx.c
483 print-isakmp.c
484 print-isoclns.c
485 print-juniper.c
486 print-krb.c
487 print-l2tp.c
488 print-lane.c
489 print-ldp.c
490 print-lisp.c
491 print-llc.c
492 print-lldp.c
493 print-lmp.c
494 print-loopback.c
495 print-lspping.c
496 print-lwapp.c
497 print-lwres.c
498 print-m3ua.c
499 print-medsa.c
500 print-mobile.c
501 print-mobility.c
502 print-mpcp.c
503 print-mpls.c
504 print-mptcp.c
505 print-msdp.c
506 print-msnlb.c
507 print-nflog.c
508 print-nfs.c
509 print-nsh.c
510 print-ntp.c
511 print-null.c
512 print-olsr.c
513 print-openflow-1.0.c
514 print-openflow.c
515 print-ospf.c
516 print-ospf6.c
517 print-otv.c
518 print-pgm.c
519 print-pim.c
520 print-pktap.c
521 print-ppi.c
522 print-ppp.c
523 print-pppoe.c
524 print-pptp.c
525 print-radius.c
526 print-raw.c
527 print-resp.c
528 print-rip.c
529 print-ripng.c
530 print-rpki-rtr.c
531 print-rrcp.c
532 print-rsvp.c
533 print-rt6.c
534 print-rtsp.c
535 print-rx.c
536 print-sctp.c
537 print-sflow.c
538 print-sip.c
539 print-sl.c
540 print-sll.c
541 print-slow.c
542 print-smtp.c
543 print-snmp.c
544 print-stp.c
545 print-sunatm.c
546 print-sunrpc.c
547 print-symantec.c
548 print-syslog.c
549 print-tcp.c
550 print-telnet.c
551 print-tftp.c
552 print-timed.c
553 print-tipc.c
554 print-token.c
555 print-udld.c
556 print-udp.c
557 print-usb.c
558 print-vjc.c
559 print-vqp.c
560 print-vrrp.c
561 print-vtp.c
562 print-vxlan.c
563 print-vxlan-gpe.c
564 print-wb.c
565 print-zephyr.c
566 print-zeromq.c
567 netdissect.c
568 signature.c
569 strtoaddr.c
570 util-print.c
571 )
572
573 if(ENABLE_SMB)
574 #
575 # We allow the SMB dissector to be omitted.
576 #
577 set(NETDISSECT_SOURCE_LIST_C ${NETDISSECT_SOURCE_LIST_C}
578 print-smb.c
579 smbutil.c)
580 endif(ENABLE_SMB)
581
582 #
583 # Replace missing functions
584 #
585 foreach(FUNC vfprintf strlcat strlcpy strdup strsep getservent getopt_long)
586 string(TOUPPER ${FUNC} FUNC_UPPERCASE)
587 set(HAVE_FUNC_UPPERCASE HAVE_${FUNC_UPPERCASE})
588 if(NOT ${HAVE_FUNC_UPPERCASE})
589 set(NETDISSECT_SOURCE_LIST_C ${NETDISSECT_SOURCE_LIST_C} missing/${FUNC}.c)
590 endif()
591 endforeach()
592 if(NOT HAVE_VSNPRINTF OR NOT HAVE_SNPRINTF)
593 set(NETDISSECT_SOURCE_LIST_C ${NETDISSECT_SOURCE_LIST_C} missing/snprintf.c)
594 endif(NOT HAVE_VSNPRINTF OR NOT HAVE_SNPRINTF)
595
596 add_library(netdissect STATIC
597 ${NETDISSECT_SOURCE_LIST_C}
598 )
599
600 set(TCPDUMP_SOURCE_LIST_C tcpdump.c)
601
602 set(PROJECT_SOURCE_LIST_C ${NETDISSECT_SOURCE_LIST_C} ${TCPDUMP_SOURCE_LIST_C})
603
604 file(GLOB PROJECT_SOURCE_LIST_H
605 *.h
606 )
607
608 source_group("Source Files" FILES ${PROJECT_SOURCE_LIST_C})
609 source_group("Header Files" FILES ${PROJECT_SOURCE_LIST_H})
610
611 ######################################
612 # Register targets
613 ######################################
614
615 add_executable(tcpdump ${TCPDUMP_SOURCE_LIST_C})
616 target_link_libraries(tcpdump netdissect ${PCAP_LIBRARY} ${SMI_LIBRARY})
617
618 ######################################
619 # Write out the config.h file
620 ######################################
621
622 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)