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