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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 project(Wireshark C CXX)
26 cmake_minimum_required(VERSION 2.6)
27 set(CMAKE_BACKWARDS_COMPATIBILITY 2.6)
29 # Needs to be set after cmake_minimum_required or cmake_policy(VERSION)
31 cmake_policy(SET CMP0008 NEW)
33 # Backward compatibility for versions < 2.6.3
34 cmake_policy(SET CMP0011 OLD)
36 #cmake_policy(SET CMP0015 NEW)
38 if( ${CMAKE_MAJOR_VERSION} GREATER 2 OR
39 ${CMAKE_MINOR_VERSION} GREATER 8 OR
40 (${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 10) )
41 # Don't: Automatically link Qt executable to qtmain target on Windows
42 cmake_policy(SET CMP0020 OLD)
45 # This cannot be implemented via option(...)
46 if( NOT CMAKE_BUILD_TYPE )
47 set( CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
48 "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
51 message(STATUS "Configuration types: ${CMAKE_CONFIGURATION_TYPES}")
52 message(STATUS "${CMAKE_BUILD_TYPE}: ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
54 # set(PROJECT_MAJOR_VERSION 1)
55 # set(PROJECT_MINOR_VERSION 9)
56 # set(PROJECT_PATCH_VERSION 0)
57 # set(PROJECT_VERSION_EXTENSION "-rc5")
58 # If not set, copy over Wireshark version from configure.ac
59 if(NOT PROJECT_MAJOR_VERSION)
61 ${CMAKE_SOURCE_DIR}/configure.ac
62 PROJECT_MAJOR_VERSION_TMP
63 REGEX "^m4_define\\(\\[?version_major\\]?, *\\[?[0-9]+\\]?\\)"
66 ${CMAKE_SOURCE_DIR}/configure.ac
67 PROJECT_MINOR_VERSION_TMP
68 REGEX "^m4_define\\(\\[?version_minor\\]?, *\\[?[0-9]+\\]?\\)"
71 ${CMAKE_SOURCE_DIR}/configure.ac
72 PROJECT_PATCH_VERSION_TMP
73 REGEX "^m4_define\\(\\[?version_micro\\]?, *\\[?[0-9]+\\]?\\)"
75 # XXX pull VERSION_EXTENSION out of configure.ac ?
77 string(REGEX REPLACE "m4_define\\(\\[?version_major\\]?, *\\[?([0-9]+)\\]?\\)"
80 ${PROJECT_MAJOR_VERSION_TMP}
82 string(REGEX REPLACE "m4_define\\(\\[?version_minor\\]?, *\\[?([0-9]+)\\]?\\)"
85 ${PROJECT_MINOR_VERSION_TMP}
87 string(REGEX REPLACE "m4_define\\(\\[?version_micro\\]?, *\\[?([0-9]+)\\]?\\)"
90 ${PROJECT_PATCH_VERSION_TMP}
95 if(PROJECT_VERSION_EXTENSION)
96 set(PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}${PROJECT_VERSION_EXTENSION})
98 set(PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION})
101 message(STATUS "V: ${PROJECT_VERSION}, MaV: ${PROJECT_MAJOR_VERSION}, MiV: ${PROJECT_MINOR_VERSION}, PL: ${PROJECT_PATCH_VERSION}, EV: ${PROJECT_VERSION_EXTENSION}.")
103 #Where to find local cmake scripts
104 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
106 INCLUDE(UseMakeDissectorReg)
107 INCLUDE(UseMakeTapReg)
110 # Under linux the release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG
112 # Enable with: "make VERBOSE=1"
113 set(CMAKE_VERBOSE_MAKEFILE OFF)
115 #Defines CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_DATADIR, etc ...
116 include(CMakeInstallDirs)
121 ${CMAKE_SOURCE_DIR}/epan
122 ${CMAKE_SOURCE_DIR}/tools/lemon
123 ${CMAKE_SOURCE_DIR}/wiretap
126 #Where to put libraries
127 if(NOT LIBRARY_OUTPUT_PATH)
128 set(LIBRARY_OUTPUT_PATH ${Wireshark_BINARY_DIR}/lib CACHE INTERNAL
129 "Single output directory for building all libraries.")
133 include(CMakeOptions.txt)
135 if( CMAKE_C_COMPILER_ID MATCHES "MSVC")
140 /DWIN32_LEAN_AND_MEAN
141 "/DMSC_VER_REQUIRED=${MSC_VER_REQUIRED}"
142 /D_CRT_SECURE_NO_DEPRECATE
143 /D_CRT_NONSTDC_NO_DEPRECATE
145 # NOMINMAX keeps windows.h from defining "min" and "max" via windef.h.
146 # This avoids conflicts with the C++ standard library.
151 set(LOCAL_CFLAGS ${LOCAL_CFLAGS} "/D_BIND_TO_CURRENT_CRT_VERSION=1")
154 # Additional compiler warnings to be treated as "Level 3"
155 # when compiling Wireshark sources. (Selected from "level 4" warnings).
156 ## 4295: array is too small to include a terminating null character
157 set(WARNINGS_CFLAGS "/w34295")
159 set(WIRESHARK_C_FLAGS
160 # FIXME: This doen't work as PCAP_VERSION will be determined later
161 "/DPCAP_VERSION=${PCAP_VERSION}"
166 set(WIRESHARK_C_FLAGS
167 # -O<X> and -g get set by the CMAKE_BUILD_TYPE
182 -Wno-overlength-strings
188 set(WIRESHARK_C_ONLY_FLAGS
189 # The following are C only, not C++
191 -Wdeclaration-after-statement
194 -Wold-style-definition
200 set(WIRESHARK_EXTRA_C_FLAGS
203 -fstrict-overflow -Wstrict-overflow=4
205 -Wunsafe-loop-optimizations
210 # All the registration functions block these for now.
211 -Wmissing-declarations
214 set(WIRESHARK_EXTRA_C_ONLY_FLAGS
215 # The following are C only, not C++
217 # All the registration functions block these for now.
221 # With clang some tests don't fail properly during testing but only
222 # during real compiles
224 if(CMAKE_C_COMPILER_ID MATCHES "Clang")
225 set(WIRESHARK_C_FLAGS ${WIRESHARK_C_FLAGS}
230 set(WIRESHARK_C_FLAGS ${WIRESHARK_C_FLAGS}
231 -fexcess-precision=fast
234 set(WIRESHARK_C_ONLY_FLAGS ${WIRESHARK_C_ONLY_FLAGS}
238 if(ENABLE_EXTRA_GCC_CHECKS) # This overrides -Werror
239 set(WIRESHARK_C_FLAGS ${WIRESHARK_C_FLAGS} ${WIRESHARK_EXTRA_C_FLAGS})
240 set(WIRESHARK_C_ONLY_FLAGS ${WIRESHARK_C_ONLY_FLAGS} ${WIRESHARK_EXTRA_C_ONLY_FLAGS})
244 -DG_DISABLE_DEPRECATED
245 -DG_DISABLE_SINGLE_INCLUDES
249 # Counterhack to work around some cache magic in CHECK_C_SOURCE_COMPILES
250 include(CheckCCompilerFlag)
252 if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_GCC_CHECKS)
253 check_c_compiler_flag(-Werror=unknown-warning-option WERR_UNKNOWN)
254 check_c_compiler_flag(-Werror WERROR)
259 # string of additional compile command line flags for check_c_compiler_flag
261 set(CMAKE_REQUIRED_FLAGS -Werror=unknown-warning-option )
265 # Sigh: Have to use THIS_FLAG instead of ${F} for some reason
266 foreach(THIS_FLAG ${WIRESHARK_C_FLAGS})
267 set(F WS_C_FLAG_${C})
268 set(${F} ${THIS_FLAG})
269 set(V WS_C_FLAG_VALID${C})
270 message(STATUS "Checking for flag: ${${F}}")
271 check_c_compiler_flag(${${F}} ${V})
273 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${F}}")
274 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${F}}")
276 math(EXPR C "${C} + 1")
278 # Continue increasing C from previous loop
279 foreach(THIS_FLAG ${WIRESHARK_C_ONLY_FLAGS})
280 set(F WS_C_FLAG_${C})
281 set(${F} ${THIS_FLAG})
282 set(V WS_C_FLAG_VALID${C})
283 message(STATUS "Checking for flag: ${${F}}")
284 check_c_compiler_flag(${${F}} ${V})
286 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${F}}")
288 math(EXPR C "${C} + 1")
290 message(STATUS "C-Flags: ${CMAKE_C_FLAGS}\nCXX-Flags: ${CMAKE_CXX_FLAGS}")
292 check_c_compiler_flag(-fvisibility=hidden FVHIDDEN)
294 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
295 else() # TODO add alternate compiler flags for hiding symbols
296 message(WARNING "Hiding shared library symbols is not supported by the compiler."
297 " All shared library symbols will be exported.")
300 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
301 set (C_UNUSED "__attribute__((unused))" )
307 if( CMAKE_C_COMPILER_ID MATCHES "MSVC")
308 # Set in Makefile.nmake
309 set(WIRESHARK_LD_FLAGS
313 set(WIRESHARK_LD_FLAGS
321 include(CheckCLinkerFlag)
323 # Sigh: Have to use THIS_FLAG instead of ${F} for some reason
324 foreach(THIS_FLAG ${WIRESHARK_LD_FLAGS})
325 set(F WS_LD_FLAG_${C})
326 set(${F} ${THIS_FLAG})
327 set(V WS_LD_FLAG_VALID${C})
328 check_c_linker_flag(${${F}} ${V})
330 set(WS_LINK_FLAGS ${WS_LINK_FLAGS} ${${F}})
332 math(EXPR C "${C} + 1")
336 set(LINK_MODE_LIB STATIC)
337 set(LINK_MODE_MODULE STATIC)
339 set(LINK_MODE_LIB SHARED)
340 set(LINK_MODE_MODULE MODULE)
343 if(APPLE AND EXISTS /usr/local/opt/gettext)
344 # GLib on OS X requires libintl. Homebrew installs gettext (and
345 # libintl) in /usr/local/opt/gettext
346 include_directories(/usr/local/opt/gettext/include)
347 link_directories(/usr/local/opt/gettext/lib)
350 # The packagelist is doing some magic: If we add XXX to the packagelist, we
351 # - may optionally set XXX_OPTIONS to pass to the find_package command
352 # - will call FindXXX.cmake
353 # - return found libraries in XXX_LIBRARIES
354 # - return found include in XXX_INCLUDE_DIRS
357 #The minimum package list
358 set(PACKAGELIST Gettext GLIB2 GMODULE2 GTHREAD2 M LEX YACC Perl SED SH PythonInterp)
359 set(GLIB2_FIND_REQUIRED)
360 set(GLIB2_MIN_VERSION 2.14.0)
361 set(GTHREAD2_REQUIRED)
363 set(PythonInterp_FIND_VERSION 2)
364 set(Python_ADDITIONAL_VERSIONS 3)
366 set(PACKAGELIST ${PACKAGELIST} HtmlViewer)
369 set(PACKAGELIST ${PACKAGELIST} PCAP)
373 set(PACKAGELIST ${PACKAGELIST} AIRPCAP)
379 set(PACKAGELIST ${PACKAGELIST} GTK3)
381 set(PACKAGELIST ${PACKAGELIST} GTK2)
382 set(GTK2_OPTIONS COMPONENTS gtk)
383 set(GTK2_FIND_VERSION 2.12)
384 set(GTK2_DEBUG false)
391 set(PACKAGELIST ${PACKAGELIST} Qt5Widgets Qt5PrintSupport Qt5LinguistTools)
393 set(PACKAGELIST ${PACKAGELIST} Qt5MacExtras)
396 # Untested, may not work if CMAKE_PREFIX_PATH gets overwritten
397 # somewhere. The if WIN32 in this place is annoying as well.
399 set( QT5_BASE_PATH "$ENV{QT5_BASE_DIR}" )
400 set( CMAKE_PREFIX_PATH "${QT5_BASE_PATH}\\msvc2010" )
401 set( QT5_DLL_PATH "${CMAKE_PREFIX_PATH}/bin/dummy" )
402 set( WS_ALL_LIBS ${WS_ALL_LIBS} ${QT5_DLL_PATH} )
405 set(PACKAGELIST ${PACKAGELIST} Qt4)
406 # set(Qt4_OPTIONS 4.7.1 REQUIRED QtCore QtGui)
413 set(PACKAGELIST ${PACKAGELIST} SMI)
418 set(PACKAGELIST ${PACKAGELIST} GCRYPT)
421 # GNU SSL/TLS support
423 set(PACKAGELIST ${PACKAGELIST} GNUTLS)
428 set(PACKAGELIST ${PACKAGELIST} KERBEROS)
432 if(ENABLE_PORTAUDIO AND BUILD_wireshark)
433 set(PACKAGELIST ${PACKAGELIST} PORTAUDIO)
437 # Prefer c-ares over adns
438 if(ENABLE_CARES) # C Asynchronouse resolver
439 set(PACKAGELIST ${PACKAGELIST} CARES)
440 elseif(ENABLE_ADNS) # Gnu asynchronous DNS
441 set(PACKAGELIST ${PACKAGELIST} ADNS)
446 set(PACKAGELIST ${PACKAGELIST} ZLIB)
451 set(PACKAGELIST ${PACKAGELIST} LUA)
454 # GeoIP address resolving
456 set(PACKAGELIST ${PACKAGELIST} GEOIP)
460 set(PACKAGELIST ${PACKAGELIST} NL)
465 set(PACKAGELIST ${PACKAGELIST} CAP)
469 set(PACKAGELIST ${PACKAGELIST} PythonLibs)
472 set(PACKAGELIST ${PACKAGELIST} YAPP)
474 set(PACKAGELIST ${PACKAGELIST} POD)
476 set(PROGLIST text2pcap mergecap capinfos editcap reordercap dumpcap)
478 #Sort the package list
479 list(SORT PACKAGELIST)
480 message(STATUS "Packagelist: ${PACKAGELIST}")
481 #Let's loop the package list
482 foreach(PACKAGE ${PACKAGELIST})
483 if(${PACKAGE} STREQUAL "Qt4")
484 set(PACKAGE_VAR "QT")
485 elseif(${PACKAGE} STREQUAL "PythonInterp")
486 set(PACKAGE_VAR "PYTHON")
487 elseif(${PACKAGE} STREQUAL "PythonLibs")
488 set(PACKAGE_VAR "PYTHON")
490 set(PACKAGE_VAR ${PACKAGE})
492 if(${PACKAGE}_OPTIONS)
493 find_package(${PACKAGE} ${${PACKAGE}_OPTIONS})
494 elseif(${PACKAGE}_REQUIRED)
495 find_package(${PACKAGE} REQUIRED)
497 find_package(${PACKAGE})
499 message(${PACKAGE_VAR}_FOUND)
500 if (${PACKAGE_VAR}_FOUND)
501 set(HAVE_LIB${PACKAGE_VAR} 1)
502 include_directories(${${PACKAGE_VAR}_INCLUDE_DIRS})
503 set(WS_ALL_LIBS ${WS_ALL_LIBS} ${${PACKAGE_VAR}_LIBRARIES})
504 message(STATUS "${PACKAGE} includes: ${${PACKAGE_VAR}_INCLUDE_DIRS}")
505 message(STATUS "${PACKAGE} libs: ${${PACKAGE_VAR}_LIBRARIES}")
506 if (${PACKAGE}_DEFINITIONS)
507 message(STATUS "${PACKAGE} definitions: ${${PACKAGE_VAR}_DEFINITIONS}")
509 if (${PACKAGE_VAR}_EXECUTABLE)
510 message(STATUS "${PACKAGE} executable: ${${PACKAGE_VAR}_EXECUTABLE}")
515 # Provide Windows system lib names
516 include( UseWinLibs )
518 # Create file to set paths to run binaries from build dir
519 WSExtendPath( "${WS_ALL_LIBS}" "${CMAKE_BINARY_DIR}/setpath.bat" )
522 include(CPackConfig.txt)
526 set(PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/lib/wireshark/python/${CPACK_PACKAGE_VERSION}")
534 # HAVE_HEIMDAL_KERBEROS
535 set(HAVE_MIT_KERBEROS 1)
536 set(HAVE_KEYTYPE_ARCFOUR_56 1)
547 if(HAVE_LIBNL AND HAVE_AIRPCAP)
548 message(ERROR "Airpcap and Libnl support are mutually exclusive")
550 # No matter which version of GTK is present
551 if(GTK2_FOUND OR GTK3_FOUND)
554 # That's the name autofoo uses
558 if (Qt5Widgets_FOUND)
559 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
560 if (Qt5_POSITION_INDEPENDENT_CODE)
561 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
564 set (QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5PrintSupport_LIBRARIES})
565 if(Qt5MacExtras_FOUND)
566 set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5MacExtras_LIBRARIES})
567 # That's the name autofoo uses
568 set(QT_MACEXTRAS_LIB 1)
570 # If Qt4: QT_LIBRARIES and QT_INCLUDES are not set above. They require extra magic
572 include(${QT_USE_FILE})
573 include_directories(${QT_INCLUDE_DIR})
574 message(STATUS "QT includes: ${QT_INCLUDE_DIR}")
575 message(STATUS "QT libs: ${QT_LIBRARIES}")
577 include(ConfigureChecks.cmake)
579 #Big or little endian ?
580 include(TestBigEndian)
581 test_big_endian(WORDS_BIGENDIAN)
583 set(DATAFILE_DIR "${CMAKE_INSTALL_PREFIX}/share/${CPACK_PACKAGE_NAME}")
585 SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
589 set(PLUGIN_DIR="${DATAFILE_DIR}/plugins/${CPACK_PACKAGE_VERSION}")
606 # It seems this stuff doesn't build with autofoo either...
608 # set(PLUGIN_SRC_DIRS
614 set(PLUGIN_SRC_DIRS )
617 foreach(PLUGIN_DIR ${PLUGIN_SRC_DIRS})
618 add_subdirectory( ${PLUGIN_DIR} )
621 add_subdirectory( asn1 EXCLUDE_FROM_ALL )
622 add_subdirectory( codecs )
623 add_subdirectory( epan )
624 add_subdirectory( tools/lemon )
625 add_subdirectory( ui )
626 add_subdirectory( wiretap )
627 add_subdirectory( wsutil )
629 add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil color.h)
632 add_subdirectory( echld )
635 if(BUILD_wireshark AND GTK_FOUND)
636 add_subdirectory( ui/gtk )
639 if(BUILD_qtshark AND QT_FOUND)
640 add_subdirectory( ui/qt )
644 # Basedir where to install guides
645 set(DOC_DIR "$ENV{docdir}" CACHE FILEPATH "Installation directory for ug and dg pdfs.")
646 message(STATUS "docdir: ${DOC_DIR}")
649 add_subdirectory( docbook )
652 if(ENABLE_PCAP_NG_DEFAULT)
653 set(PCAP_NG_DEFAULT 1)
656 # Large file support (e.g. make off_t 64 bit if supported)
657 include(gmxTestLargeFiles)
658 gmx_test_large_files(GMX_LARGEFILES)
660 add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" )
664 # We assume that APPLE means OS X so that we have the OS X
667 set(HAVE_OS_X_FRAMEWORKS 1)
668 FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices)
669 FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation)
670 FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration)
674 set(WS_MSVC_NORETURN "__declspec(noreturn)")
676 # Disable deprecation
678 add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
681 set(WS_MSVC_NORETURN " ")
684 configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h)
686 set( configure_input "Built with CMake ${CMAKE_VERSION}" )
687 set( VERSION ${PROJECT_VERSION} )
690 ${CMAKE_SOURCE_DIR}/packaging/macosx/Info.plist.in
691 ${CMAKE_SOURCE_DIR}/packaging/macosx/Info.plist
694 include(FeatureSummary)
695 #SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ]
696 #FEATURE_SUMMARY(WHAT ALL) Requires removal of our local copy of FeatureSummary
697 PRINT_ENABLED_FEATURES()
698 PRINT_DISABLED_FEATURES()
701 ${CMAKE_BINARY_DIR}/ui
702 ${CMAKE_BINARY_DIR}/ui/gtk
703 ${CMAKE_BINARY_DIR}/ui/qt
704 ${CMAKE_BINARY_DIR}/codecs
705 ${CMAKE_BINARY_DIR}/epan
706 ${CMAKE_BINARY_DIR}/wiretap
707 ${CMAKE_BINARY_DIR}/wsutil
712 COMMAND ${PERL_EXECUTABLE}
713 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
714 ${CMAKE_CURRENT_SOURCE_DIR}
716 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
718 set_target_properties(svnversion PROPERTIES FOLDER "Auxiliary")
722 COMMAND ${PERL_EXECUTABLE}
723 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
724 ${CMAKE_CURRENT_SOURCE_DIR}
726 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
730 set(PLATFORM_CAPTURE_SRC
731 capture-pcap-util-unix.c
736 set(PLATFORM_CAPTURE_SRC
737 capture_win_ifnames.c
739 capture_wpcap_packet.c
742 ui/win32/console_win32.c
743 ui/win32/file_dlg_win32.c
744 ui/win32/print_win32.c
748 set(WTAP_PLUGIN_SOURCES
753 set(SHARK_COMMON_CAPTURE_SRC
758 set(WIRESHARK_COMMON_SRC
759 ${PLATFORM_CAPTURE_SRC}
772 ui/cli/tap-ansi_astat.c
773 ui/cli/tap-bootpstat.c
774 ui/cli/tap-camelcounter.c
775 ui/cli/tap-camelsrt.c
776 ui/cli/tap-comparestat.c
777 ui/cli/tap-dcerpcstat.c
778 ui/cli/tap-diameter-avp.c
782 ui/cli/tap-gsm_astat.c
783 ui/cli/tap-h225counter.c
784 ui/cli/tap-h225rassrt.c
786 ui/cli/tap-httpstat.c
787 ui/cli/tap-icmpstat.c
788 ui/cli/tap-icmpv6stat.c
791 ui/cli/tap-macltestat.c
792 ui/cli/tap-mgcpstat.c
793 ui/cli/tap-megacostat.c
794 ui/cli/tap-protocolinfo.c
795 ui/cli/tap-protohierstat.c
796 ui/cli/tap-radiusstat.c
797 ui/cli/tap-rlcltestat.c
799 ui/cli/tap-rpcprogs.c
801 ui/cli/tap-rtspstat.c
802 ui/cli/tap-scsistat.c
803 ui/cli/tap-sctpchunkstat.c
807 ui/cli/tap-stats_tree.c
822 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
824 ${CMAKE_BINARY_DIR}/capinfos.html
828 ${CMAKE_BINARY_DIR}/dftest.html
829 ${CMAKE_BINARY_DIR}/dumpcap.html
830 ${CMAKE_BINARY_DIR}/editcap.html
831 ${CMAKE_BINARY_DIR}/asn2deb.html
832 ${CMAKE_BINARY_DIR}/idl2deb.html
833 ${CMAKE_BINARY_DIR}/idl2wrs.html
836 ${CMAKE_BINARY_DIR}/mergecap.html
838 ${CMAKE_BINARY_DIR}/randpkt.html
839 ${CMAKE_BINARY_DIR}/rawshark.html
840 ${CMAKE_BINARY_DIR}/reordercap.html
843 ${CMAKE_BINARY_DIR}/text2pcap.html
844 ${CMAKE_BINARY_DIR}/tshark.html
845 ${CMAKE_BINARY_DIR}/wireshark-filter.html
846 ${CMAKE_BINARY_DIR}/wireshark.html
852 # @SOCKET_LIBS@ # -lsocket
853 # @SSL_LIBS@ # -lcrypto
855 # $(plugin_ldadd) # in case of static
860 ${KERBEROS_LIBRARIES}
871 if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
886 ${SHARK_COMMON_CAPTURE_SRC}
887 ${WIRESHARK_COMMON_SRC}
892 if(BUILD_wireshark AND GTK_FOUND)
898 ${GTHREAD2_LIBRARIES}
900 ${PORTAUDIO_LIBRARIES}
902 ${APPLE_APPLICATION_SERVICES_LIBRARY}
903 ${APPLE_CORE_SERVICES_LIBRARY}
904 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
906 ${WIN_COMCTL32_LIBRARY}
908 # qtshark and wireshark share wireshark_FILES
910 add_executable(wireshark ${wireshark_FILES})
911 add_dependencies(wireshark svnversion)
912 set_target_properties(wireshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
913 set_target_properties(wireshark PROPERTIES FOLDER "Executables")
914 target_link_libraries(wireshark ${wireshark_LIBS})
915 install(TARGETS wireshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
918 if(BUILD_qtshark AND QT_FOUND)
923 ${GTHREAD2_LIBRARIES}
926 ${APPLE_APPLICATION_SERVICES_LIBRARY}
927 ${APPLE_CORE_FOUNDATION_LIBRARY}
928 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
931 # qtshark and wireshark share wireshark_FILES
933 add_executable(qtshark ${wireshark_FILES})
934 add_dependencies(qtshark svnversion)
935 set_target_properties(qtshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
936 set_target_properties(qtshark PROPERTIES FOLDER "Executables")
937 target_link_libraries(qtshark ${qtshark_LIBS})
938 install(TARGETS qtshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
941 register_tap_files(tshark-tap-register.c
950 ${APPLE_CORE_FOUNDATION_LIBRARY}
951 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
956 tshark-tap-register.c
959 ${SHARK_COMMON_CAPTURE_SRC}
960 ${WIRESHARK_COMMON_SRC}
962 add_executable(tshark ${tshark_FILES})
963 add_dependencies(tshark svnversion)
964 set_target_properties(tshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
965 set_target_properties(tshark PROPERTIES FOLDER "Executables")
966 target_link_libraries(tshark ${tshark_LIBS})
967 install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
970 if(BUILD_rawshark AND PCAP_FOUND)
973 ${APPLE_CORE_FOUNDATION_LIBRARY}
974 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
977 ${WIRESHARK_COMMON_SRC}
981 add_executable(rawshark ${rawshark_FILES})
982 add_dependencies(rawshark svnversion)
983 set_target_properties(rawshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
984 set_target_properties(rawshark PROPERTIES FOLDER "Executables")
985 target_link_libraries(rawshark ${rawshark_LIBS})
986 install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
997 add_executable(dftest ${dftest_FILES})
998 set_target_properties(dftest PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
999 set_target_properties(dftest PROPERTIES FOLDER "Executables")
1000 target_link_libraries(dftest ${dftest_LIBS})
1001 install(TARGETS dftest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1019 add_executable(randpkt ${randpkt_FILES})
1020 set_target_properties(randpkt PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1021 set_target_properties(randpkt PROPERTIES FOLDER "Executables")
1022 target_link_libraries(randpkt ${randpkt_LIBS})
1023 install(TARGETS randpkt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1032 set(text2pcap_CLEAN_FILES
1037 ${text2pcap_CLEAN_FILES}
1039 add_lex_files(text2pcap_FILES
1042 add_executable(text2pcap ${text2pcap_FILES})
1043 add_dependencies(text2pcap svnversion)
1044 set_target_properties(text2pcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1045 set_target_properties(text2pcap PROPERTIES FOLDER "Executables")
1046 target_link_libraries(text2pcap ${text2pcap_LIBS})
1047 install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1059 ${WTAP_PLUGIN_SOURCES}
1061 add_executable(mergecap ${mergecap_FILES})
1062 add_dependencies(mergecap svnversion)
1063 set_target_properties(mergecap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1064 set_target_properties(mergecap PROPERTIES FOLDER "Executables")
1065 target_link_libraries(mergecap ${mergecap_LIBS})
1066 install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1069 if(BUILD_reordercap)
1075 set(reordercap_FILES
1078 ${WTAP_PLUGIN_SOURCES}
1080 add_executable(reordercap ${reordercap_FILES})
1081 add_dependencies(reordercap svnversion)
1082 set_target_properties(reordercap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1083 set_target_properties(reordercap PROPERTIES FOLDER "Executables")
1084 target_link_libraries(reordercap ${reordercap_LIBS})
1085 install(TARGETS reordercap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1098 ${WTAP_PLUGIN_SOURCES}
1100 add_executable(capinfos ${capinfos_FILES})
1101 add_dependencies(capinfos svnversion)
1102 set_target_properties(capinfos PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1103 set_target_properties(capinfos PROPERTIES FOLDER "Executables")
1104 target_link_libraries(capinfos ${capinfos_LIBS})
1105 install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1116 ${WTAP_PLUGIN_SOURCES}
1118 add_executable(editcap ${editcap_FILES})
1119 add_dependencies(editcap svnversion)
1120 set_target_properties(editcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1121 set_target_properties(editcap PROPERTIES FOLDER "Executables")
1122 target_link_libraries(editcap ${editcap_LIBS})
1123 install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1126 if(BUILD_dumpcap AND PCAP_FOUND)
1134 ${GTHREAD2_LIBRARIES}
1136 ${APPLE_CORE_FOUNDATION_LIBRARY}
1137 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
1144 capture_stop_conditions.c
1154 ${PLATFORM_CAPTURE_SRC}
1156 add_executable(dumpcap ${dumpcap_FILES})
1157 add_dependencies(dumpcap svnversion)
1158 set_target_properties(dumpcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1159 set_target_properties(dumpcap PROPERTIES FOLDER "Executables")
1160 target_link_libraries(dumpcap ${dumpcap_LIBS})
1161 install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1165 OUTPUT ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1166 COMMAND ${PERL_EXECUTABLE}
1167 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1168 ${CMAKE_SOURCE_DIR}/doc/make-authors-short.pl
1169 < ${CMAKE_SOURCE_DIR}/AUTHORS
1170 > ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1172 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1173 ${CMAKE_SOURCE_DIR}/doc/make-authors-short.pl
1174 ${CMAKE_SOURCE_DIR}/AUTHORS
1178 OUTPUT ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1179 ${CMAKE_BINARY_DIR}/wireshark.pod
1180 COMMAND ${PERL_EXECUTABLE}
1181 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1182 ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
1183 < ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1184 > ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1186 ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
1187 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1188 > ${CMAKE_BINARY_DIR}/wireshark.pod
1190 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1191 ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
1192 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1193 ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
1196 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/capinfos 1 )
1197 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dftest 1 )
1198 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dumpcap 1 )
1199 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/editcap 1 )
1200 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/asn2deb 1 )
1201 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2deb 1 )
1202 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2wrs 1 )
1203 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/mergecap 1 )
1204 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/randpkt 1 )
1205 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/rawshark 1 )
1206 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/reordercap 1 )
1207 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/text2pcap 1 )
1208 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/tshark 1 )
1209 pod2manhtml( ${CMAKE_BINARY_DIR}/wireshark 1 )
1210 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/wireshark-filter 4 )
1230 wireshark-filter.html
1232 set_target_properties(auxiliary PROPERTIES FOLDER "Docs")
1235 ${CMAKE_BINARY_DIR}/capinfos.1
1236 ${CMAKE_BINARY_DIR}/dftest.1
1237 ${CMAKE_BINARY_DIR}/dumpcap.1
1238 ${CMAKE_BINARY_DIR}/editcap.1
1239 ${CMAKE_BINARY_DIR}/idl2wrs.1
1240 ${CMAKE_BINARY_DIR}/mergecap.1
1241 ${CMAKE_BINARY_DIR}/randpkt.1
1242 ${CMAKE_BINARY_DIR}/rawshark.1
1243 ${CMAKE_BINARY_DIR}/reordercap.1
1244 ${CMAKE_BINARY_DIR}/text2pcap.1
1245 ${CMAKE_BINARY_DIR}/tshark.1
1246 ${CMAKE_BINARY_DIR}/wireshark.1
1250 ${CMAKE_BINARY_DIR}/wireshark-filter.4
1259 ${text2pcap_CLEAN_FILES}
1267 set_source_files_properties(
1270 COMPILE_FLAGS -Werror
1278 ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
1285 ${CMAKE_INSTALL_MANDIR}/man1
1292 ${CMAKE_INSTALL_MANDIR}/man4
1298 DIRECTORY_PERMISSIONS
1299 OWNER_EXECUTE OWNER_WRITE OWNER_READ
1300 GROUP_EXECUTE GROUP_READ
1301 WORLD_EXECUTE WORLD_READ
1303 ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
1304 PATTERN ".svn" EXCLUDE
1305 PATTERN "Makefile.*" EXCLUDE
1306 PATTERN "faq.py" EXCLUDE
1311 message(STATUS "Docdir install: ${DOC_DIR}")
1314 ${CMAKE_BINARY_DIR}/docbook/
1315 DIRECTORY_PERMISSIONS
1316 OWNER_EXECUTE OWNER_WRITE OWNER_READ
1317 GROUP_EXECUTE GROUP_READ
1318 WORLD_EXECUTE WORLD_READ