# Updated by make-version.pl
set(GIT_REVISION 0)
set(PROJECT_MAJOR_VERSION 2)
-set(PROJECT_MINOR_VERSION 3)
+set(PROJECT_MINOR_VERSION 5)
set(PROJECT_PATCH_VERSION 0)
set(PROJECT_BUILD_VERSION ${GIT_REVISION})
set(PROJECT_VERSION_EXTENSION "")
set(PROJECT_VERSION "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}${PROJECT_VERSION_EXTENSION}")
+# packaging information
+if(WIN32)
+ set(CPACK_PACKAGE_NAME Wireshark)
+else()
+ set(CPACK_PACKAGE_NAME wireshark)
+endif()
+
+set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
+
message(STATUS "Generating build using CMake ${CMAKE_VERSION}")
if(WIN32)
- # Needed for proper Qt linking. See
- # http://www.cmake.org/cmake/help/v3.0/policy/CMP0020.html
- # 3.1.3 is the currently supported version
- cmake_minimum_required(VERSION 3.1.3)
+ # Needed for GREATER_EQUAL operator
+ cmake_minimum_required(VERSION 3.7)
else()
cmake_minimum_required(VERSION 2.8.8)
endif()
"Single output directory for building all libraries.")
endif()
-# Under linux the release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG
+#
+# The release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG for
+# the Unix Makefile generator.
+#
+
#Defines CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_DATADIR, etc ...
-include(CMakeInstallDirs)
+include(GNUInstallDirs)
+# Make sure our executables can can load our libraries if we install into
+# a non-default directory on Unix-like systems other than macOS.
+# https://cmake.org/Wiki/CMake_RPATH_handling
+if(NOT CMAKE_INSTALL_RPATH AND NOT (WIN32 OR APPLE))
+ LIST(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" IS_SYSTEM_DIR)
+ if("${IS_SYSTEM_DIR}" STREQUAL "-1")
+ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
+ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ endif("${IS_SYSTEM_DIR}" STREQUAL "-1")
+endif()
# Banner shown at top right of Qt welcome screen.
if(DEFINED ENV{WIRESHARK_VERSION_FLAVOR})
include(UseMakeTapReg)
include(UseAsn2Wrs)
+# The following snippet has been taken from
+# https://github.com/USESystemEngineeringBV/cmake-eclipse-helper/wiki/HowToWorkaroundIndexer
+# The eclipse indexer otherwise assumes __cplusplus=199711L which will lead to broken
+# lookup tables for the epan libraries
+# Check if CXX flags have been set to c++11 -> Setup Eclipse Indexer correctly!
+# Also setup the project slightly different
+if (${CMAKE_EXTRA_GENERATOR} MATCHES "Eclipse CDT4" )
+ SET(CXX_ENABLED 0)
+ LIST(LENGTH CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS LIST_LEN)
+ if ( ${LIST_LEN} GREATER 0 )
+ SET(CXX_ENABLED 1)
+ endif()
+ SET(C_ENABLED 0)
+ LIST(LENGTH CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS LIST_LEN)
+ if ( ${LIST_LEN} GREATER 0)
+ SET(C_ENABLED 1)
+ endif()
+ if (${C_ENABLED} EQUAL 1 AND ${CXX_ENABLED} EQUAL 1)
+ # Combined project (C and CXX). This will confuse the indexer. For that reason
+ # we unsert set the __cplusplus variable for the indexer
+ list(FIND CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "__cplusplus" GEN_MACRO_INDEX)
+ if( ${GEN_MACRO_INDEX} GREATER -1 )
+ list(REMOVE_AT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${GEN_MACRO_INDEX})
+ list(REMOVE_AT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${GEN_MACRO_INDEX})
+ endif()
+ SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS} CACHE INTERNAL "")
+ elseif ( (${CXX_ENABLED} EQUAL 1) AND (${CMAKE_CXX_FLAGS} MATCHES ".*-std=c\\+\\+11.*"))
+ #add_definitions (-D__cplusplus=201103L)
+ # CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS
+ list(FIND CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "199711L" GEN_MACRO_INDEX)
+ if( ${GEN_MACRO_INDEX} GREATER -1 )
+ list(REMOVE_AT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${GEN_MACRO_INDEX})
+ list(INSERT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${GEN_MACRO_INDEX} "201103L")
+ SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS} CACHE INTERNAL "")
+ endif()
+ endif()
+endif()
+
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}
set( DUMPCAP_INSTALL_OPTION )
endif()
+if(APPLE AND EXISTS /usr/local/opt/qt5)
+ # Homebrew installs Qt5 (up to at least 5.9.1) in
+ # /usr/local/qt5, ensure it can be found by CMake since
+ # it is not in the default /usr/local prefix.
+ list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
+endif()
+
# Always enable position-independent code when compiling, even for
# executables, so you can build position-independent executables.
# -pie is added below for non-MSVC.
if(CMAKE_OSX_DEPLOYMENT_TARGET)
if(APPLE)
if(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.0")
- message(FATAL_ERROR "We don't support building for OS X 10.0")
+ message(FATAL_ERROR "We don't support building for Mac OS X 10.0")
elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.1")
- message(FATAL_ERROR "We don't support building for OS X 10.1")
+ message(FATAL_ERROR "We don't support building for Mac OS X 10.1")
elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.2")
- message(FATAL_ERROR "We don't support building for OS X 10.2")
+ message(FATAL_ERROR "We don't support building for Mac OS X 10.2")
elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.4" OR ${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.5")
#
# Only 32-bit builds are supported. 10.5
set(CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
set(WS_LINK_FLAGS "-m32 ${WS_LINK_FLAGS}")
endif()
- message(STATUS "Building for OS X ${CMAKE_OSX_DEPLOYMENT_TARGET}")
+ message(STATUS "Building for Mac OS X/OS X/macOS ${CMAKE_OSX_DEPLOYMENT_TARGET}")
else()
- message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET only applies when building for OS X")
+ message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET only applies when building for macOS")
endif()
endif()
-Wno-overlength-strings
-Wno-long-long
-Wheader-guard
+ -Wcomma
)
+ #
+ # Code that may be worth looking into (coding practices)
+ #
+ if((NOT ENABLE_ASAN) AND (NOT ENABLE_UBSAN) AND (NOT DISABLE_FRAME_LARGER_THAN_WARNING))
+ #
+ # Only do this if neither ASan nor UBSan are
+ # enabled; the instrumentation they add increases
+ # the stack usage - we only care about stack
+ # usage in normal operation.
+ #
+ set(COMMON_WARN_FLAGS ${COMMON_WARN_FLAGS}
+ -Wframe-larger-than=16384
+ )
+ endif()
+
set(C_WARN_FLAGS
# The following are C only, not C++
-Wc++-compat
+ -Wunused-const-variable
+ #
+ # XXX - some versions of GCC, including the one in at
+ # least some Xcode versions that come with Mac OS X
+ # 10.5, complain about variables in function and
+ # function pointer *declarations* shadowing other
+ # variables. The autoconf script checks for that; we
+ # don't.
-Wshadow
-Wno-pointer-sign
-Wold-style-definition
-Wstrict-prototypes
+ #
+ # Some versions of GCC, such as 4.3.2 and 4.4.5,
+ # generate logical-op warnings when strchr() is given a
+ # constant string. The autoconf script checks for that;
+ # we don't.
+ #
-Wlogical-op
-Wjump-misses-init
- -Wunused-const-variable
- # The Qt headers generate a ton of shortening errors on 64-bit systems
- # so only enable this for C for now.
+ #
+ # The Qt headers generate a ton of shortening warnings
+ # on 64-bit systems, so we only enable this for C for
+ # now.
+ #
-Wshorten-64-to-32
-
#
# Implicit function declarations are an error in C++ and most
# likely a programming error in C. Turn -Wimplicit-int and
set(CXX_WARN_FLAGS
)
+ find_package(Qt5Core) # Needed to check for Qt version
+ if (Qt5Core_VERSION VERSION_GREATER 5.8)
+ # The Qt headers in version 5.8 and older generate a ton of shortening
+ # errors on 64-bit systems so only enable this for version 5.9 and greater.
+ set(CXX_WARN_FLAGS ${CXX_WARN_FLAGS}
+ -Wshorten-64-to-32
+ )
+ endif()
+
+ #
+ # These are not enabled by default, because the warnings they
+ # produce are very hard or impossible to eliminate.
+ #
set(COMMON_EXTRA_WARN_FLAGS
# The following are for C and C++
-Wpedantic
-Wmissing-declarations
#
# A bunch of "that might not work on SPARC" code blocks
- # this one for now.
+ # this one for now; some of it is code that *will* work
+ # on SPARC, such as casts of "struct sockaddr *" to
+ # "struct sockaddr_in *", which are required by some
+ # APIs such as getifaddrs().
#
-Wcast-align
#
#
-Wdocumentation
#
+ # Works only with GCC 7
+ #
+ -Wduplicated-branches
+ #
# No longer supported by El Capitan clang on C++
+ # XXX - is this one of those where CMake's check
+ # doesn't fail, so it won't reject this?
#
-fno-delete-null-pointer-checks
)
endforeach()
set(WS_WARNINGS_CXX_FLAGS ${ADDED_WARN_CXX_FLAGS})
+include(CMakePushCheckState)
+
if(ENABLE_ASAN)
+ cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES "-fsanitize=address")
check_c_compiler_flag(-fsanitize=address C__fsanitize_address_VALID)
check_cxx_compiler_flag(-fsanitize=address CXX__fsanitize_address_VALID)
- set(CMAKE_REQUIRED_LIBRARIES "")
+ cmake_pop_check_state()
if(NOT C__fsanitize_address_VALID OR NOT CXX__fsanitize_address_VALID)
message(FATAL_ERROR "ENABLE_ASAN was requested, but not supported!")
endif()
endif()
endif()
+if(ENABLE_UBSAN)
+ cmake_push_check_state()
+ set(CMAKE_REQUIRED_LIBRARIES "-fsanitize=undefined")
+ check_c_compiler_flag(-fsanitize=undefined C__fsanitize_undefined_VALID)
+ check_cxx_compiler_flag(-fsanitize=undefined CXX__fsanitize_undefined_VALID)
+ cmake_pop_check_state()
+ if(NOT C__fsanitize_undefined_VALID OR NOT CXX__fsanitize_undefined_VALID)
+ message(FATAL_ERROR "ENABLE_UBSAN was requested, but not supported!")
+ endif()
+ set(CMAKE_C_FLAGS "-fsanitize=undefined ${CMAKE_C_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-fsanitize=undefined ${CMAKE_CXX_FLAGS}")
+endif()
+
set(WERROR_COMMON_FLAGS "")
set(NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS "")
if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
endif()
endif()
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
- set (C_UNUSED "__attribute__((unused))" )
- set (WS_NORETURN "__attribute__((noreturn))")
-elseif(MSVC)
- set (C_UNUSED "")
- set (WS_NORETURN "__declspec(noreturn)")
-else()
- set (C_UNUSED "")
- set (WS_NORETURN "")
-endif()
-
set(WIRESHARK_LD_FLAGS
-Wl,--as-needed
# -flto
endforeach()
if(APPLE AND EXISTS /usr/local/opt/gettext)
- # GLib on OS X requires libintl. Homebrew installs gettext (and
+ # GLib on macOS requires libintl. Homebrew installs gettext (and
# libintl) in /usr/local/opt/gettext
include_directories(/usr/local/opt/gettext/include)
link_directories(/usr/local/opt/gettext/lib)
endif()
-# The packagelist is doing some magic: If we add XXX to the packagelist, we
+# The packagelist is doing some magic: If we add XXX to the packagelist, we
# - may optionally set XXX_OPTIONS to pass to the find_package command
-# - will call FindXXX.cmake
+# - will call FindXXX.cmake or find_package
# - return found libraries in XXX_LIBRARIES
# - return found include in XXX_INCLUDE_DIRS
# - set HAVE_XXX
-#The minimum package list
-set(PACKAGELIST Gettext M Git GLIB2 GMODULE2 GTHREAD2 LEX YACC Perl SED SH PythonInterp NGHTTP2)
-set(LEX_REQUIRED TRUE)
-set(GLIB2_REQUIRED TRUE)
-set(GLIB2_FIND_REQUIRED TRUE)
+# The minimum package list
+set(PACKAGELIST Gettext M Git GLIB2 GMODULE2 GTHREAD2 GCRYPT LEX YACC Perl SH PythonInterp)
+set(LEX_OPTIONS REQUIRED)
+set(GLIB2_OPTIONS REQUIRED)
+set(GLIB2_FIND_OPTIONS REQUIRED)
set(GLIB2_MIN_VERSION 2.22.0)
-set(GTHREAD2_REQUIRED TRUE)
+set(GTHREAD2_OPTIONS REQUIRED)
+set(GCRYPT_OPTIONS "1.4.2" REQUIRED)
set(PythonInterp_FIND_VERSION 2)
set(Python_ADDITIONAL_VERSIONS 3)
-set(YACC_REQUIRED TRUE)
+set(YACC_OPTIONS REQUIRED)
if (NOT WIN32)
- set(M_REQUIRED TRUE)
+ set(M_OPTIONS REQUIRED)
endif()
set(PACKAGELIST ${PACKAGELIST} LIBSSH)
set(PACKAGELIST ${PACKAGELIST} SMI)
endif()
-# GNU crypto
-if(ENABLE_GCRYPT)
- set(PACKAGELIST ${PACKAGELIST} GCRYPT)
- # Minimum version needed.
- set(GCRYPT_OPTIONS "1.4.2")
-endif()
-
# GNU SSL/TLS support
if(ENABLE_GNUTLS)
set(PACKAGELIST ${PACKAGELIST} GNUTLS)
# C Asynchronous resolver
if(ENABLE_CARES)
set(PACKAGELIST ${PACKAGELIST} CARES)
+ # Minimum version needed.
+ set(CARES_OPTIONS "1.5.0")
endif()
# Zlib compression
if(ENABLE_ZLIB)
if (WIN32)
# On Windows we build our own version of zlib, so add the paths
- set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.8-ws")
+ set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.11-ws")
set(SKIP_INSTALL_ALL True) # We copy the DLL ourselves.
add_subdirectory("${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
unset(SKIP_INSTALL_ALL)
set(PACKAGELIST ${PACKAGELIST} SNAPPY)
endif()
+# Enhanced HTTP/2 dissection
+if(ENABLE_NGHTTP2)
+ set(PACKAGELIST ${PACKAGELIST} NGHTTP2)
+endif()
+
# Embedded Lua interpreter
if(ENABLE_LUA)
set(PACKAGELIST ${PACKAGELIST} LUA)
set(PACKAGELIST ${PACKAGELIST} SPANDSP)
endif()
+if(ENABLE_BCG729)
+ set(PACKAGELIST ${PACKAGELIST} BCG729)
+endif()
+
+if(ENABLE_LIBXML2)
+ set(PACKAGELIST ${PACKAGELIST} LibXml2)
+endif()
+
# Capabilities
if(ENABLE_CAP)
set(PACKAGELIST ${PACKAGELIST} CAP SETCAP)
# Sort the package list
list(SORT PACKAGELIST)
-message(STATUS "Packagelist: ${PACKAGELIST}")
+string(REPLACE ";" " " _package_list "${PACKAGELIST}")
+message(STATUS "Package List: ${_package_list}")
# Let's loop the package list
foreach(PACKAGE ${PACKAGELIST})
if(${PACKAGE} STREQUAL "Qt4")
set(PACKAGE_VAR "GETTEXT")
elseif(${PACKAGE} STREQUAL "Perl")
set(PACKAGE_VAR "PERL")
+ elseif(${PACKAGE} STREQUAL "LibXml2")
+ set(PACKAGE_VAR "LIBXML2")
else()
set(PACKAGE_VAR ${PACKAGE})
endif()
if(${PACKAGE}_OPTIONS)
find_package(${PACKAGE} ${${PACKAGE}_OPTIONS})
- elseif(${PACKAGE}_REQUIRED)
- find_package(${PACKAGE} REQUIRED)
else()
find_package(${PACKAGE})
endif()
- if (${PACKAGE_VAR}_FOUND)
+ # FindPackageHandleStandardArgs before CMake 3.2 always uses uppercase
+ # for the FOUND variables (e.g. GIT_FOUND is set, but not Git_FOUND).
+ string(TOUPPER "${PACKAGE_VAR}" PACKAGE_VAR_UPPER)
+ if (${PACKAGE_VAR}_FOUND OR ${PACKAGE_VAR_UPPER}_FOUND)
message(STATUS "${PACKAGE_VAR} FOUND")
set(HAVE_LIB${PACKAGE_VAR} 1)
- include_directories(SYSTEM ${${PACKAGE_VAR}_INCLUDE_DIRS})
- set(WS_ALL_LIBS ${WS_ALL_LIBS} ${${PACKAGE_VAR}_LIBRARIES})
- message(STATUS "${PACKAGE} includes: ${${PACKAGE_VAR}_INCLUDE_DIRS}")
- message(STATUS "${PACKAGE} libs: ${${PACKAGE_VAR}_LIBRARIES}")
- if (${PACKAGE}_DEFINITIONS)
+ if (NOT DEFINED ${PACKAGE_VAR}_INCLUDE_DIRS AND ${PACKAGE_VAR}_INCLUDE_DIR)
+ set(${PACKAGE_VAR}_INCLUDE_DIRS ${${PACKAGE_VAR}_INCLUDE_DIR})
+ endif()
+ if (${PACKAGE_VAR}_INCLUDE_DIRS)
+ include_directories(SYSTEM ${${PACKAGE_VAR}_INCLUDE_DIRS})
+ message(STATUS "${PACKAGE} includes: ${${PACKAGE_VAR}_INCLUDE_DIRS}")
+ endif()
+ if (${PACKAGE_VAR}_LIBRARIES)
+ list(APPEND WS_ALL_LIBS ${${PACKAGE_VAR}_LIBRARIES})
+ message(STATUS "${PACKAGE} libs: ${${PACKAGE_VAR}_LIBRARIES}")
+ endif()
+ if (${PACKAGE_VAR}_DEFINITIONS)
message(STATUS "${PACKAGE} definitions: ${${PACKAGE_VAR}_DEFINITIONS}")
endif()
if (${PACKAGE_VAR}_EXECUTABLE)
#
# Not finding a package is only a fatal error if the
# package is required; if it's required, then its
- # XXX_REQUIRED variable is set to TRUE, and the above
+ # XXX_OPTIONS variable contains REQUIRED, and the above
# code will pass REQUIRED to find_package, and the
# configure will fail if the package isn't found.
#
# Provide Windows system lib names
include( UseWinLibs )
-#packaging
-include(CPackConfig.txt)
+# dist target that prepares source dir
+add_custom_target(dist
+ COMMAND "${CMAKE_COMMAND}"
+ -DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}"
+ -DGIT_EXECUTABLE="${GIT_EXECUTABLE}"
+ -DWS_SOURCE_DIR="${WS_SOURCE_DIR}"
+ -P "${CMAKE_SOURCE_DIR}/cmake/modules/Dist.cmake"
+ COMMAND "${CMAKE_MAKE_PROGRAM}" package_source
+)
+
if(HAVE_LIBAIRPCAP)
set(HAVE_AIRPCAP 1)
if(SPANDSP_FOUND)
set(HAVE_SPANDSP 1)
endif()
+if(BCG729_FOUND)
+ set(HAVE_BCG729 1)
+endif()
+if(LIBXML2_FOUND)
+ set(HAVE_LIBXML2 1)
+else()
+ # The (official) FindLibXml2.cmake file sets this cache variable to a
+ # non-empty value, be sure to clear it when not found.
+ set(LIBXML2_LIBRARIES "")
+endif()
if(EXTCAP_ANDROIDDUMP_LIBPCAP)
set(ANDROIDDUMP_USE_LIBPCAP 1)
endif()
set(ENABLE_CHECK_FILTER 1)
endif()
-string(REPLACE ";" " " _warnings_c_flags "${WS_WARNINGS_C_FLAGS}")
-message(STATUS "C-Flags: ${CMAKE_C_FLAGS} ${_warnings_c_flags}")
-string(REPLACE ";" " " _warnings_cxx_flags "${WS_WARNINGS_CXX_FLAGS}")
-message(STATUS "CXX-Flags: ${CMAKE_CXX_FLAGS} ${_warnings_cxx_flags}")
-message(STATUS "Warnings as errors: ${WERROR_COMMON_FLAGS}")
-
if(APPLE)
#
- # We assume that APPLE means OS X so that we have the OS X
+ # We assume that APPLE means macOS so that we have the macOS
# frameworks.
#
- set(HAVE_OS_X_FRAMEWORKS 1)
+ set(HAVE_MACOS_FRAMEWORKS 1)
FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices)
FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation)
FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration)
add_subdirectory( writecap )
# Location of our data files. This should be set to a value that allows
-# running from the build directory on Windows, on OS X when building an
-# application bundle, and on UNIX if WIRESHARK_RUN_FROM_BUILD_DIRECTORY
-# is set.
+# running from the build directory on Windows, on macOS when building an
+# application bundle, and on UNIX in general if
+# WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set.
if(ENABLE_APPLICATION_BUNDLE)
set(_datafile_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/share/wireshark")
else()
add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil)
endif()
-if(ENABLE_ECHLD)
- add_subdirectory( echld )
-endif()
-
if(BUILD_wireshark_gtk AND GTK_FOUND)
add_subdirectory( ui/gtk )
endif()
if(ENABLE_EXTCAP)
# Target platform locations
- # UNIX, Linux, non-bundled OS X: $DESTDIR/lib/wireshark/extcap
+ # UN*X in general, including macOS if not building an app bundle:
+ # $DESTDIR/lib/wireshark/extcap
# Windows: $DESTDIR/extcap
- # OS X app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap
+ # macOS app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap
set(HAVE_EXTCAP 1)
if (WIN32)
set(EXTCAP_DIR "extcap")
endif()
# Directory where plugins and Lua dissectors can be found.
+set(PLUGIN_VERSION_DIR "plugins/${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}")
+set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/${PLUGIN_VERSION_DIR}")
+# Used by the WiresharkConfig.cmake.in module
if (WIN32)
- set(PLUGIN_INSTALL_DIR "plugins/${CPACK_PACKAGE_VERSION}")
+ set(PLUGIN_INSTALL_DIR "${PLUGIN_VERSION_DIR}")
else ()
- set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}")
+ set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_LIBDIR}")
endif()
# Location of our plugins. PLUGIN_DIR should allow running
# from the build directory similar to DATAFILE_DIR above.
if(ENABLE_PLUGINS)
# Target platform locations
- # UNIX, Linux, non-bundled OS X: $DESTDIR/lib/wireshark/plugins/$VERSION
+ # UN*X in general, including macOS if not building an app bundle:
+ # $DESTDIR/lib/wireshark/plugins/$VERSION
# Windows: $DESTDIR/wireshark/plubins/$VERSION
- # OS X app bundle: Wireshark.app/Contents/PlugIns/wireshark
+ # macOS app bundle: Wireshark.app/Contents/PlugIns/wireshark
set(HAVE_PLUGINS 1)
add_custom_target(plugins)
set_target_properties(plugins PROPERTIES FOLDER "Plugins")
plugins/wimaxmacphy
${CUSTOM_PLUGIN_SRC_DIR}
)
+
+ # Build demo plugin, only if asked explicitly
+ if(ENABLE_PLUGIN_IFDEMO)
+ set(PLUGIN_SRC_DIRS
+ ${PLUGIN_SRC_DIRS}
+ plugins/pluginifdemo
+ )
+ endif()
+
# It seems this stuff doesn't build with autofoo either...
# if(YAPP_FOUND)
# set(PLUGIN_SRC_DIRS
endif()
if(ENABLE_APPLICATION_BUNDLE)
- set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark")
+ set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}")
else()
get_target_property(_libwireshark_location epan LOCATION)
get_filename_component(_plugin_dir "${_libwireshark_location}" PATH)
- set(_plugin_dir "${_plugin_dir}/plugins")
+ set(_plugin_dir "${_plugin_dir}/${PLUGIN_VERSION_DIR}")
endif()
-# XXX The NMake environment appends the version. Should we do so here?
set (PLUGIN_DIR ${_plugin_dir} CACHE INTERNAL "Build time plugin location.")
foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS})
add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" )
-if(WIN32)
- # Disable deprecation
- if(MSVC80 OR MSVC90)
- add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
- endif()
-endif()
-
if (${GIT_EXECUTABLE})
set(GIT_BIN_PARAM "--git-bin ${GIT_EXECUTABLE}")
endif()
set( VERSION ${PROJECT_VERSION} )
+if(NOT CMAKE_VERSION VERSION_LESS "3.2.1")
+ # Prevents unnecessary rebuilds by ensuring that dependents are not
+ # built before make-version.pl finishes (which may touch version.h).
+ set(version_byproducts BYPRODUCTS version.h)
+else()
+ set(version_byproducts "")
+endif()
add_custom_target(version
+ ${version_byproducts}
COMMAND ${PERL_EXECUTABLE}
${CMAKE_SOURCE_DIR}/make-version.pl
--set-vcs ${GIT_BIN_PARAM}
set( exec_prefix "\${prefix}" )
set( libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}" )
set( includedir "\${prefix}/include" )
-set( plugindir "\${libdir}/wireshark/plugins/${CPACK_PACKAGE_VERSION}" )
+set( plugindir "\${libdir}/wireshark/${PLUGIN_VERSION_DIR}" )
set(ICON_PATH "${CMAKE_SOURCE_DIR}/image/")
set( IN_FILES
endforeach()
include(FeatureSummary)
-#SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ])
-SET_FEATURE_INFO(SBC "SBC Codec for Bluetooth A2DP stream playing" "www: http://git.kernel.org/cgit/bluetooth/sbc.git" )
-SET_FEATURE_INFO(SPANDSP "Support for G.722 and G.726 codecs in RTP player" "http://www.soft-switch.org/" )
-SET_FEATURE_INFO(LIBSSH "libssh is library for ssh connections and it is needed to build sshdump/ciscodump" "www: https://www.libssh.org/get-it/" )
+set_package_properties(SBC PROPERTIES
+ DESCRIPTION "Bluetooth low-complexity, subband codec (SBC) decoder"
+ URL "https://git.kernel.org/pub/scm/bluetooth/sbc.git"
+ PURPOSE "Support for playing SBC codec in RTP player"
+)
+set_package_properties(SPANDSP PROPERTIES
+ DESCRIPTION "a library of many DSP functions for telephony"
+ URL "http://www.soft-switch.org/"
+ PURPOSE "Support for G.722 and G.726 codecs in RTP player"
+)
+set_package_properties(BCG729 PROPERTIES
+ DESCRIPTION "G.729 decoder"
+ URL "https://www.linphone.org/technical-corner/bcg729/overview"
+ PURPOSE "Support for G.729 codec in RTP player"
+)
+set_package_properties(LIBXML2 PROPERTIES
+ DESCRIPTION "XML parsing library"
+ URL "http://xmlsoft.org/"
+ PURPOSE "Read XML configuration files in EPL dissector"
+)
+set_package_properties(LIBSSH PROPERTIES
+ DESCRIPTION "Library for implementing SSH clients"
+ URL "https://www.libssh.org/"
+ PURPOSE "extcap remote SSH interfaces (sshdump, ciscodump)"
+)
+set_package_properties(LZ4 PROPERTIES
+ DESCRIPTION "LZ4 is lossless compression algorithm used in some protocol (CQL...)"
+ URL "http://www.lz4.org"
+ PURPOSE "LZ4 decompression in CQL and Kafka dissectors"
+)
+set_package_properties(SNAPPY PROPERTIES
+ DESCRIPTION "A fast compressor/decompressor from Google"
+ URL "http://google.github.io/snappy/"
+ PURPOSE "Snappy decompression in CQL and Kafka dissectors"
+)
+set_package_properties(NGHTTP2 PROPERTIES
+ DESCRIPTION "HTTP/2 C library and tools"
+ URL "https://nghttp2.org"
+ PURPOSE "Header decompression in HTTP2"
+)
+# XXX tpg plugin is not added in CMakeLists/Makefile.am, remove plugins/tpg/?
+set_package_properties(YAPP PROPERTIES
+ DESCRIPTION "Yet Another Perl Parser compiler"
+ URL "http://search.cpan.org/dist/Parse-Yapp/"
+ PURPOSE "tpg plugin"
+)
-FEATURE_SUMMARY(WHAT ALL)
+string(REPLACE ";" " " _warnings_c_flags "${WS_WARNINGS_C_FLAGS}")
+message(STATUS "C-Flags: ${CMAKE_C_FLAGS} ${_warnings_c_flags}")
+string(REPLACE ";" " " _warnings_cxx_flags "${WS_WARNINGS_CXX_FLAGS}")
+message(STATUS "CXX-Flags: ${CMAKE_CXX_FLAGS} ${_warnings_cxx_flags}")
+message(STATUS "Warnings as errors: ${WERROR_COMMON_FLAGS}")
+
+feature_summary(WHAT ALL)
link_directories(
${CMAKE_BINARY_DIR}/ui
cfile.c
frame_tvbuff.c
sync_pipe_write.c
- ws_version_info.c
+ version_info.c
)
# sources for external capture interfaces
ui/cli/tap-expert.c
ui/cli/tap-exportobject.c
ui/cli/tap-endpoints.c
+ ui/cli/tap-flow.c
ui/cli/tap-follow.c
ui/cli/tap-funnel.c
ui/cli/tap-gsm_astat.c
set(INSTALL_DIRS
diameter
dtds
- help
+ ${DATAFILE_DIR}/help
profiles
radius
tpncp
cfilters
colorfilters
dfilters
+ enterprises.tsv
ipmap.html
manuf
pdml2html.xsl
services
smi_modules
+ wka
docbook/ws.css
${CMAKE_BINARY_DIR}/doc/AUTHORS-SHORT
- ${CMAKE_BINARY_DIR}/doc/asn2deb.html
${CMAKE_BINARY_DIR}/doc/androiddump.html
${CMAKE_BINARY_DIR}/doc/udpdump.html
${CMAKE_BINARY_DIR}/doc/capinfos.html
${CMAKE_BINARY_DIR}/doc/dumpcap.html
${CMAKE_BINARY_DIR}/doc/editcap.html
${CMAKE_BINARY_DIR}/doc/extcap.html
- ${CMAKE_BINARY_DIR}/doc/idl2deb.html
- ${CMAKE_BINARY_DIR}/doc/idl2wrs.html
${CMAKE_BINARY_DIR}/doc/mergecap.html
${CMAKE_BINARY_DIR}/doc/randpkt.html
${CMAKE_BINARY_DIR}/doc/randpktdump.html
${CMAKE_BINARY_DIR}/doc/wireshark-filter.html
)
+if (BUILD_corbaidl2wrs)
+ list(APPEND INSTALL_FILES ${CMAKE_BINARY_DIR}/doc/idl2wrs.html)
+endif()
+if (BUILD_xxx2deb)
+ list(APPEND INSTALL_FILES
+ ${CMAKE_BINARY_DIR}/doc/asn2deb.html
+ ${CMAKE_BINARY_DIR}/doc/idl2deb.html
+ )
+endif()
+
if(WIN32)
- set(TEXTIFY_FILES COPYING NEWS README README.windows)
- foreach(_text_file ${TEXTIFY_FILES})
- set(INSTALL_FILES ${CMAKE_BINARY_DIR}/${_text_file}.txt ${INSTALL_FILES})
+ set(TEXTIFY_FILES COPYING NEWS README.windows)
+ set(TEXTIFY_MD_FILES README.md)
+ foreach(_text_file ${TEXTIFY_FILES} ${TEXTIFY_MD_FILES})
+ string(REGEX REPLACE ".md$" "" _out_file ${_text_file})
+ set(INSTALL_FILES ${CMAKE_BINARY_DIR}/${_out_file}.txt ${INSTALL_FILES})
endforeach()
else()
set(INSTALL_FILES COPYING ${INSTALL_FILES})
"${_dll_output_dir}"
)
endif(LIBSSH_FOUND)
- if(GCRYPT_FOUND)
- foreach( _dll ${GCRYPT_DLLS} )
- add_custom_command(TARGET copy_cli_dlls PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${GCRYPT_DLL_DIR}/${_dll}"
- "${_dll_output_dir}"
- )
- endforeach(_dll)
- endif(GCRYPT_FOUND)
+ foreach( _dll ${GCRYPT_DLLS} )
+ add_custom_command(TARGET copy_cli_dlls PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${GCRYPT_DLL_DIR}/${_dll}"
+ "${_dll_output_dir}"
+ )
+ endforeach(_dll)
if(GNUTLS_FOUND)
foreach( _dll ${GNUTLS_DLLS} )
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
"${_dll_output_dir}"
)
endif(SPANDSP_FOUND)
+ if (BCG729_FOUND)
+ add_custom_command(TARGET copy_cli_dlls PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${BCG729_DLL_DIR}/${BCG729_DLL}"
+ "${_dll_output_dir}"
+ )
+ endif(BCG729_FOUND)
+ if (LIBXML2_FOUND)
+ add_custom_command(TARGET copy_cli_dlls PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${LIBXML2_DLL_DIR}/${LIBXML2_DLL}"
+ "${_dll_output_dir}"
+ )
+ endif(LIBXML2_FOUND)
if (SMI_FOUND)
# Wireshark.nsi wants SMI_DIR which is the base SMI directory
get_filename_component(SMI_DIR ${SMI_DLL_DIR} DIRECTORY)
${CMAKE_SOURCE_DIR}/${_text_file}
)
endforeach()
+ foreach(_md_file ${TEXTIFY_MD_FILES})
+ string(REGEX REPLACE ".md$" ".txt" _text_file ${_md_file})
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${_text_file}
+ COMMAND ${POWERSHELL_COMMAND} "${CMAKE_SOURCE_DIR}/tools/textify.ps1"
+ -Destination ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/${_md_file}
+ COMMAND ${CMAKE_COMMAND} -E rename
+ ${CMAKE_BINARY_DIR}/${_md_file}.txt
+ ${CMAKE_BINARY_DIR}/${_text_file}
+ DEPENDS
+ ${CMAKE_SOURCE_DIR}/${_text_file}
+ )
+ endforeach()
endif()
foreach(_install_file ${INSTALL_FILES})
+ get_filename_component(_install_file_src "${_install_file}" ABSOLUTE)
get_filename_component(_install_basename "${_install_file}" NAME)
set(_output_file "${DATAFILE_DIR}/${_install_basename}")
add_custom_command(OUTPUT "${_output_file}"
COMMAND ${CMAKE_COMMAND} -E copy
- "${_install_file}"
+ "${_install_file_src}"
"${_output_file}"
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS
docs
"${_install_file}"
)
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/extcap")
endif()
-set(_help_files
+
+# faq.txt is handled separately below.
+set(_help_source_files
help/capture_filters.txt
help/capturing.txt
help/display_filters.txt
help/getting_started.txt
help/overview.txt
)
+
if(WIN32)
file(TO_NATIVE_PATH "${DATAFILE_DIR}/help" _help_dest_dir)
- foreach(_help_file IN LISTS _help_files)
+ foreach(_help_file IN LISTS _help_source_files)
add_custom_command(OUTPUT "${DATAFILE_DIR}/${_help_file}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/help"
COMMAND ${POWERSHELL_COMMAND} "${CMAKE_SOURCE_DIR}/tools/textify.ps1"
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/${_help_file}")
endforeach()
else()
- list(APPEND DATA_FILES_SRC ${_help_files})
+ list(APPEND DATA_FILES_SRC ${_help_source_files})
endif(WIN32)
# Create help/faq.txt when missing
capture_opts.c
file.c
fileset.c
- filter_files.c
summary.c
${SHARK_COMMON_SRC}
${PLATFORM_UI_SRC}
${APPLE_CORE_FOUNDATION_LIBRARY}
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
${NL_LIBRARIES}
+ ${WIN_VERSION_LIBRARY}
)
# Policy since 2.8.11
)
set(tshark_FILES
capture_opts.c
- filter_files.c
tshark-tap-register.c
tshark.c
${TSHARK_TAP_SRC}
if(BUILD_rawshark AND PCAP_FOUND)
set(rawshark_LIBS
caputils
+ ui
${LIBEPAN_LIBS}
${APPLE_CORE_FOUNDATION_LIBRARY}
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
set(rawshark_FILES
${SHARK_COMMON_SRC}
rawshark.c
- ui/util.c
${CMAKE_BINARY_DIR}/image/rawshark.rc
)
add_executable(rawshark ${rawshark_FILES})
if(BUILD_sharkd)
set(sharkd_LIBS
ui
+ wscodecs
${LIBEPAN_LIBS}
${APPLE_CORE_FOUNDATION_LIBRARY}
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
)
set(sharkd_FILES
- capture_opts.c
- filter_files.c
sharkd.c
sharkd_daemon.c
sharkd_session.c
if(BUILD_dftest)
set(dftest_LIBS
+ ui
${LIBEPAN_LIBS}
)
set(dftest_FILES
dftest.c
- ui/util.c
)
add_executable(dftest ${dftest_FILES})
add_dependencies(dftest version)
if(BUILD_randpkt)
set(randpkt_LIBS
randpkt_core
+ ui
wiretap
wsutil
${M_LIBRARIES}
)
set(randpkt_FILES
randpkt.c
- ws_version_info.c
+ version_info.c
)
add_executable(randpkt ${randpkt_FILES})
add_dependencies(randpkt version)
)
set(text2pcap_CLEAN_FILES
text2pcap.c
- ws_version_info.c
+ version_info.c
)
set(text2pcap_FILES
${text2pcap_CLEAN_FILES}
if(BUILD_mergecap)
set(mergecap_LIBS
+ ui
wiretap
${ZLIB_LIBRARIES}
${CMAKE_DL_LIBS}
)
set(mergecap_FILES
mergecap.c
- ws_version_info.c
+ version_info.c
${CMAKE_BINARY_DIR}/image/mergecap.rc
)
add_executable(mergecap ${mergecap_FILES})
if(BUILD_reordercap)
set(reordercap_LIBS
+ ui
wiretap
${ZLIB_LIBRARIES}
${CMAKE_DL_LIBS}
)
set(reordercap_FILES
reordercap.c
- ws_version_info.c
+ version_info.c
${CMAKE_BINARY_DIR}/image/reordercap.rc
)
add_executable(reordercap ${reordercap_FILES})
if(BUILD_capinfos)
set(capinfos_LIBS
+ ui
wiretap
wsutil
${ZLIB_LIBRARIES}
)
set(capinfos_FILES
capinfos.c
- ws_version_info.c
+ version_info.c
${CMAKE_BINARY_DIR}/image/capinfos.rc
)
add_executable(capinfos ${capinfos_FILES})
if(BUILD_captype)
set(captype_LIBS
+ ui
wiretap
wsutil
${ZLIB_LIBRARIES}
)
set(captype_FILES
captype.c
- ws_version_info.c
+ version_info.c
${CMAKE_BINARY_DIR}/image/captype.rc
)
add_executable(captype ${captype_FILES})
if(BUILD_editcap)
set(editcap_LIBS
+ ui
wiretap
${ZLIB_LIBRARIES}
+ ${GCRYPT_LIBRARIES}
${CMAKE_DL_LIBS}
)
set(editcap_FILES
editcap.c
- ws_version_info.c
+ version_info.c
${CMAKE_BINARY_DIR}/image/editcap.rc
)
add_executable(editcap ${editcap_FILES})
writecap
wsutil
caputils
+ ui
${PCAP_LIBRARIES}
${CAP_LIBRARIES}
${GLIB2_LIBRARIES}
capture_stop_conditions.c
conditions.c
dumpcap.c
- filter_files.c
ringbuffer.c
sync_pipe_write.c
- ws_version_info.c
+ version_info.c
${CMAKE_BINARY_DIR}/image/dumpcap.rc
)
add_executable(dumpcap ${dumpcap_FILES})
endif()
endif()
+# We have two idl2wrs utilities: this and the CORBA version in tools.
+# We probably shouldn't do that.
+if(BUILD_dcerpcidl2wrs)
+ set(idl2wrs_LIBS
+ ${GLIB2_LIBRARIES}
+ wsutil
+ )
+ set(idl2wrs_FILES
+ epan/dissectors/dcerpc/idl2wrs.c
+ )
+
+ add_executable(idl2wrs ${idl2wrs_FILES})
+ set_target_properties(idl2wrs PROPERTIES FOLDER "Executables")
+ set_extra_executable_properties(idl2wrs "Executables")
+ target_link_libraries(idl2wrs ${idl2wrs_LIBS})
+ install(TARGETS idl2wrs RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif()
+
if (WIN32)
find_package( MSVC_REDIST )
endif()
endif()
+add_custom_target(extcaps)
+
if(ENABLE_EXTCAP AND BUILD_androiddump)
if(EXTCAP_ANDROIDDUMP_LIBPCAP)
if(HAVE_LIBPCAP)
set(androiddump_LIBS
+ ui
${GLIB2_LIBRARIES}
${PCAP_LIBRARIES}
)
endif()
else()
set(androiddump_LIBS
+ ui
wiretap
${GLIB2_LIBRARIES}
${CMAKE_DL_LIBS}
set_extcap_executable_properties(androiddump)
target_link_libraries(androiddump ${androiddump_LIBS})
install(TARGETS androiddump RUNTIME DESTINATION ${EXTCAP_DIR})
+ add_dependencies(extcaps androiddump)
endif()
if(ENABLE_EXTCAP AND BUILD_sshdump AND LIBSSH_FOUND)
${CMAKE_DL_LIBS}
${LIBSSH_LIBRARIES}
)
- if (WIN32)
- set(sshdump_LIBS wsutil ${sshdump_LIBS})
- endif()
set(sshdump_FILES
extcap/sshdump.c
extcap/extcap-base.c
target_link_libraries(sshdump ${sshdump_LIBS})
target_include_directories(sshdump PUBLIC ${LIBSSH_INCLUDE_DIR})
install(TARGETS sshdump RUNTIME DESTINATION ${EXTCAP_DIR})
+ add_dependencies(extcaps sshdump)
elseif (BUILD_sshdump)
#message( WARNING "Cannot find libssh, cannot build sshdump" )
endif()
${CMAKE_DL_LIBS}
${LIBSSH_LIBRARIES}
)
- if (WIN32)
- set(ciscodump_LIBS wsutil ${ciscodump_LIBS})
- endif()
set(ciscodump_FILES
extcap/ciscodump.c
extcap/extcap-base.c
target_link_libraries(ciscodump ${ciscodump_LIBS})
target_include_directories(ciscodump PUBLIC ${LIBSSH_INCLUDE_DIR})
install(TARGETS ciscodump RUNTIME DESTINATION ${EXTCAP_DIR})
+ add_dependencies(extcaps ciscodump)
elseif (BUILD_ciscodump)
#message( WARNING "Cannot find libssh, cannot build ciscodump" )
endif()
set_extcap_executable_properties(udpdump)
target_link_libraries(udpdump ${udpdump_LIBS})
install(TARGETS udpdump RUNTIME DESTINATION ${EXTCAP_DIR})
+ add_dependencies(extcaps udpdump)
endif()
if(ENABLE_EXTCAP AND BUILD_randpktdump)
set(randpktdump_LIBS
randpkt_core
+ ui
wiretap
${GLIB2_LIBRARIES}
${CMAKE_DL_LIBS}
set_extcap_executable_properties(randpktdump)
target_link_libraries(randpktdump ${randpktdump_LIBS})
install(TARGETS randpktdump RUNTIME DESTINATION ${EXTCAP_DIR})
+ add_dependencies(extcaps randpktdump)
endif()
if(ENABLE_APPLICATION_BUNDLE)
endif()
-set(CLEAN_FILES
+set(CLEAN_C_FILES
${wireshark_FILES}
${tshark_FILES}
${rawshark_FILES}
${capinfos_FILES}
${captype_FILES}
${editcap_FILES}
+ ${idl2wrs_FILES}
${dumpcap_FILES}
${androiddump_FILES}
${sshdump_FILES}
${udpdump_FILES}
)
+# Make sure we don't pass /WX to rc.exe. Rc doesn't have a /WX flag,
+# but it does have /W (warn about invalid code pages) and /X (ignore
+# the INCLUDE environment variable).
+# This should apparently be handled for us via CMAKE_RC_FLAG_REGEX
+# in CMakeRCInformation.cmake but that doesn't appear to work.
+if (WIN32)
+ list(FILTER CLEAN_C_FILES EXCLUDE REGEX ".*\\.rc")
+endif (WIN32)
+
set_source_files_properties(
- ${CLEAN_FILES}
+ ${CLEAN_C_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
)
+set(SHARK_PUBLIC_HEADERS
+ cfile.h
+ file.h
+ register.h
+ globals.h
+ log.h
+ ws_symbol_export.h
+ ws_attributes.h
+ ws_diag_control.h
+)
+
+if(NOT WIN32)
+ install(
+ FILES
+ ${SHARK_PUBLIC_HEADERS}
+ DESTINATION
+ ${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}
+ )
+endif()
+
# Install icons and other desktop files for Freedesktop.org-compliant desktops.
if(((BUILD_wireshark AND QT_FOUND) OR BUILD_wireshark_gtk) AND NOT (WIN32 OR APPLE))
install(FILES wireshark-mime-package.xml
PATTERN ".git" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "Makefile.*" EXCLUDE
- PATTERN "faq.py" EXCLUDE
)
set(CMAKE_INSTALL_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME})
)
endif()
-
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#