5 # Wireshark - Network traffic analyzer
6 # By Gerald Combs <gerald@wireshark.org>
7 # Copyright 1998 Gerald Combs
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License
11 # as published by the Free Software Foundation; either version 2
12 # of the License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 set(dumpcap_LIBS wiretap)
28 # Disable this later. Alternative: "make VERBOSE=1"
29 set(CMAKE_VERBOSE_MAKEFILE ON)
31 set(BUILD_SHARED_LIBS ON)
32 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
34 set(dumpcap_PLATFORM_SRC
35 capture-pcap-util-unix.c
42 capture_stop_conditions.c
52 ${dumpcap_PLATFORM_SRC}
55 include_directories(${CMAKE_BINARY_DIR}
57 ${CMAKE_SOURCE_DIR}/wiretap)
59 add_definitions(-DHAVE_CONFIG_H -D_U_=\"__attribute__\(\(unused\)\)\")
61 link_directories(wiretap)
63 add_executable(dumpcap ${dumpcap_FILES})
65 option(BUILD_WITH_GLIB2 "Build using gtk2/glib2 instead of gtk/glib" ON)
66 option(BUILD_WIRESHARK "Build the GUI version of Wireshark" ON)
67 option(ENABLE_STATIC "Build a static version of Wireshark" OFF)
71 find_package(GTK2 REQUIRED)
74 include_directories(${GTK2_INCLUDE_DIR})
75 # set(dumpcap_LIBS ${dumpcap_LIBS} ${GTK2_LIBRARIES})
77 endif (BUILD_WIRESHARK)
78 find_package(GLIB2 REQUIRED)
81 include_directories(${GLIB2_INCLUDE_DIR})
82 set(dumpcap_LIBS ${dumpcap_LIBS} ${GLIB2_glib_LIBRARY})
84 else (BUILD_WITH_GLIB2)
86 find_package(GTK REQUIRED)
89 include_directories(${GTK_INCLUDE_DIR})
90 # set(dumpcap_LIBS ${dumpcap_LIBS} ${GTK_LIBRARIES})
92 endif (BUILD_WIRESHARK)
93 find_package(GLIB REQUIRED)
96 include_directories(${GLIB_INCLUDE_DIR})
97 set(dumpcap_LIBS ${dumpcap_LIBS} ${GLIB_glib_LIBRARIES})
99 endif (BUILD_WITH_GLIB2)
101 set(PACKAGELIST ZLIB PCAP)
103 foreach(PACKAGE ${PACKAGELIST})
104 find_package(${PACKAGE})
105 message(${PACKAGE}_FOUND)
106 if (${PACKAGE}_FOUND)
107 include_directories(${${PACKAGE}_INCLUDE_DIR})
108 set(dumpcap_LIBS ${dumpcap_LIBS} ${${PACKAGE}_LIBRARIES})
109 endif (${PACKAGE}_FOUND)
112 configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h)
114 target_link_libraries(dumpcap ${dumpcap_LIBS})