2006-09-05 09:50:45 +00:00
|
|
|
# CMakeLists.txt
|
|
|
|
#
|
|
|
|
# Wireshark - Network traffic analyzer
|
|
|
|
# By Gerald Combs <gerald@wireshark.org>
|
|
|
|
# Copyright 1998 Gerald Combs
|
|
|
|
#
|
2018-03-06 14:31:02 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2006-09-05 09:50:45 +00:00
|
|
|
#
|
|
|
|
|
2018-11-18 02:14:42 +00:00
|
|
|
if(WIN32)
|
2019-09-03 18:28:52 +00:00
|
|
|
# Needed for add_custom_command() WORKING_DIRECTORY generator expressions
|
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2018-11-18 02:14:42 +00:00
|
|
|
else()
|
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
endif()
|
2020-06-28 15:42:43 +00:00
|
|
|
if(POLICY CMP0069)
|
|
|
|
cmake_policy(SET CMP0069 NEW)
|
|
|
|
endif()
|
2019-09-27 15:53:47 +00:00
|
|
|
if(POLICY CMP0074)
|
|
|
|
cmake_policy(SET CMP0074 NEW)
|
|
|
|
endif()
|
2019-01-17 18:34:37 +00:00
|
|
|
if(POLICY CMP0083)
|
|
|
|
cmake_policy(SET CMP0083 NEW)
|
|
|
|
endif()
|
2019-02-01 16:25:24 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(_project_name Wireshark)
|
|
|
|
else()
|
|
|
|
set(_project_name wireshark)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
project(${_project_name} C CXX)
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2019-01-09 22:47:02 +00:00
|
|
|
# Updated by tools/make-version.pl
|
2016-09-01 22:09:12 +00:00
|
|
|
set(GIT_REVISION 0)
|
2019-02-05 01:19:58 +00:00
|
|
|
set(PROJECT_MAJOR_VERSION 3)
|
2019-11-20 22:55:57 +00:00
|
|
|
set(PROJECT_MINOR_VERSION 3)
|
|
|
|
set(PROJECT_PATCH_VERSION 0)
|
2016-09-01 22:09:12 +00:00
|
|
|
set(PROJECT_BUILD_VERSION ${GIT_REVISION})
|
|
|
|
set(PROJECT_VERSION_EXTENSION "")
|
|
|
|
|
|
|
|
if(DEFINED ENV{WIRESHARK_VERSION_EXTRA})
|
|
|
|
set(PROJECT_VERSION_EXTENSION "$ENV{WIRESHARK_VERSION_EXTRA}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(PROJECT_VERSION "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}${PROJECT_VERSION_EXTENSION}")
|
|
|
|
|
2017-09-06 10:49:12 +00:00
|
|
|
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
|
|
|
|
2019-09-17 18:07:54 +00:00
|
|
|
include( CMakeOptions.txt )
|
|
|
|
|
2019-06-17 13:59:47 +00:00
|
|
|
# We require minimum C++11
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
|
2015-04-20 15:36:06 +00:00
|
|
|
message(STATUS "Generating build using CMake ${CMAKE_VERSION}")
|
2009-06-16 04:12:30 +00:00
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
#Where to find local cmake scripts
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
|
|
|
|
2020-06-28 15:42:43 +00:00
|
|
|
# CMake >= 3.9.0 enables LTO/IPO
|
|
|
|
# Policy CMP0069 enables this behavior when we set the minimum CMake version < 3.9.0
|
|
|
|
if (ENABLE_LTO)
|
|
|
|
include(CheckIPOSupported)
|
|
|
|
check_ipo_supported(RESULT lto_supported)
|
|
|
|
if(lto_supported)
|
|
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if (CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
|
|
|
message(STATUS "LTO/IPO is enabled")
|
|
|
|
else()
|
|
|
|
message(STATUS "LTO/LPO is not enabled")
|
|
|
|
endif()
|
|
|
|
|
2015-01-09 21:53:17 +00:00
|
|
|
# If our target platform is enforced by our generator, set
|
|
|
|
# WIRESHARK_TARGET_PLATFORM accordingly. Otherwise use
|
|
|
|
# %WIRESHARK_TARGET_PLATFORM%.
|
2015-04-02 19:10:36 +00:00
|
|
|
|
2015-01-09 21:53:17 +00:00
|
|
|
if(WIN32)
|
2015-04-07 21:05:52 +00:00
|
|
|
find_package(PowerShell REQUIRED)
|
|
|
|
|
2018-05-10 12:54:31 +00:00
|
|
|
if(CMAKE_CL_64 OR CMAKE_GENERATOR MATCHES "Win64")
|
2015-01-09 21:53:17 +00:00
|
|
|
set(WIRESHARK_TARGET_PLATFORM win64)
|
2018-05-10 12:54:31 +00:00
|
|
|
elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
|
2015-01-09 21:53:17 +00:00
|
|
|
set(WIRESHARK_TARGET_PLATFORM win32)
|
|
|
|
else()
|
|
|
|
set(WIRESHARK_TARGET_PLATFORM $ENV{WIRESHARK_TARGET_PLATFORM})
|
|
|
|
endif()
|
2015-04-09 00:36:35 +00:00
|
|
|
|
2018-05-10 12:54:31 +00:00
|
|
|
if(WIRESHARK_TARGET_PLATFORM MATCHES "win64")
|
2018-02-09 21:59:15 +00:00
|
|
|
set(WIRESHARK_TARGET_PROCESSOR_ARCHITECTURE amd64)
|
2015-04-30 18:35:57 +00:00
|
|
|
else()
|
2018-02-09 21:59:15 +00:00
|
|
|
set(WIRESHARK_TARGET_PROCESSOR_ARCHITECTURE x86)
|
2015-04-30 18:35:57 +00:00
|
|
|
endif()
|
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
# Sanity check
|
2015-04-09 00:36:35 +00:00
|
|
|
if(DEFINED ENV{PLATFORM})
|
|
|
|
string(TOLOWER $ENV{PLATFORM} _vs_platform)
|
|
|
|
else()
|
|
|
|
set(_vs_platform "[undefined]") # x86
|
|
|
|
endif()
|
|
|
|
if(
|
|
|
|
(_vs_platform STREQUAL "x64" AND NOT WIRESHARK_TARGET_PLATFORM STREQUAL "win64")
|
|
|
|
OR
|
|
|
|
(_vs_platform STREQUAL "[undefined]" AND NOT WIRESHARK_TARGET_PLATFORM STREQUAL "win32")
|
|
|
|
)
|
|
|
|
message(FATAL_ERROR "The PLATFORM environment variable (${_vs_platform})"
|
|
|
|
" doesn't match the generator platform (${WIRESHARK_TARGET_PLATFORM})")
|
|
|
|
endif()
|
2015-04-20 15:36:06 +00:00
|
|
|
message(STATUS "Building for ${WIRESHARK_TARGET_PLATFORM} using ${CMAKE_GENERATOR}")
|
2015-01-09 21:53:17 +00:00
|
|
|
|
2015-11-16 14:02:16 +00:00
|
|
|
# Determine where the 3rd party libraries will be
|
2015-04-30 14:00:29 +00:00
|
|
|
if( DEFINED ENV{WIRESHARK_LIB_DIR} )
|
|
|
|
# The buildbots set WIRESHARK_LIB_DIR but not WIRESHARK_BASE_DIR.
|
|
|
|
file( TO_CMAKE_PATH "$ENV{WIRESHARK_LIB_DIR}" _PROJECT_LIB_DIR )
|
|
|
|
elseif( DEFINED ENV{WIRESHARK_BASE_DIR} )
|
|
|
|
file( TO_CMAKE_PATH "$ENV{WIRESHARK_BASE_DIR}" _WS_BASE_DIR )
|
|
|
|
set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${WIRESHARK_TARGET_PLATFORM}-libs" )
|
2015-11-16 14:02:16 +00:00
|
|
|
else()
|
|
|
|
# Don't know what to do
|
|
|
|
message(FATAL_ERROR "Neither WIRESHARK_BASE_DIR or WIRESHARK_LIB_DIR are defined")
|
2015-04-30 14:00:29 +00:00
|
|
|
endif()
|
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
# Download third-party libraries
|
|
|
|
file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/tools/win-setup.ps1 _win_setup)
|
2015-04-30 14:00:29 +00:00
|
|
|
file (TO_NATIVE_PATH ${_PROJECT_LIB_DIR} _ws_lib_dir)
|
2015-04-20 15:36:06 +00:00
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
# Is it possible to have a one-time, non-cached option in CMake? If
|
|
|
|
# so, we could add a "-DFORCE_WIN_SETUP" which passes -Force to
|
|
|
|
# win-setup.ps1.
|
|
|
|
execute_process(
|
2018-05-16 23:35:12 +00:00
|
|
|
COMMAND ${POWERSHELL_COMMAND} "\"${_win_setup}\"" -Destination "${_ws_lib_dir}" -Platform ${WIRESHARK_TARGET_PLATFORM}
|
2015-04-07 21:05:52 +00:00
|
|
|
RESULT_VARIABLE _win_setup_failed
|
|
|
|
)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(_win_setup_failed)
|
2015-04-07 21:05:52 +00:00
|
|
|
message(FATAL_ERROR "Windows setup (win-setup.ps1) failed.")
|
|
|
|
endif()
|
|
|
|
|
2019-03-18 23:32:54 +00:00
|
|
|
set(EXTRA_INSTALLER_DIR ${_ws_lib_dir})
|
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
# XXX Add a dependency on ${_ws_lib_dir}/current_tag.txt?
|
2015-10-15 21:45:45 +00:00
|
|
|
|
2018-05-16 17:58:11 +00:00
|
|
|
# Prepopulate some ConfigureChecks values. Compilation checks
|
|
|
|
# on Windows can be slow.
|
|
|
|
set(HAVE_FCNTL_H TRUE)
|
|
|
|
set(HAVE_FLOORL TRUE)
|
2015-04-07 21:05:52 +00:00
|
|
|
endif(WIN32)
|
2014-06-21 09:10:38 +00:00
|
|
|
|
2014-09-18 06:05:48 +00:00
|
|
|
include(UseCustomIncludes)
|
2016-06-14 15:37:33 +00:00
|
|
|
ADD_CUSTOM_CMAKE_INCLUDE()
|
2014-09-18 06:05:48 +00:00
|
|
|
|
2013-11-04 20:29:29 +00:00
|
|
|
# This cannot be implemented via option(...)
|
|
|
|
if( NOT CMAKE_BUILD_TYPE )
|
2013-11-17 14:03:58 +00:00
|
|
|
set( CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
FORCE)
|
2013-11-04 20:29:29 +00:00
|
|
|
endif()
|
2019-01-28 20:02:34 +00:00
|
|
|
message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}")
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2017-10-14 19:13:52 +00:00
|
|
|
# Ensure that all executables and libraries end up in the same directory. Actual
|
|
|
|
# files might end up in a configuration subdirectory, e.g. run/Debug or
|
|
|
|
# run/Release. We try to set DATAFILE_DIR to actual location below.
|
2014-06-21 09:10:38 +00:00
|
|
|
if(NOT ARCHIVE_OUTPUT_PATH)
|
2019-02-01 16:25:24 +00:00
|
|
|
set(ARCHIVE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/run CACHE INTERNAL
|
2014-06-21 09:10:38 +00:00
|
|
|
"Single output directory for building all archives.")
|
|
|
|
endif()
|
|
|
|
if(NOT EXECUTABLE_OUTPUT_PATH)
|
2019-02-01 16:25:24 +00:00
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/run CACHE INTERNAL
|
2014-06-21 09:10:38 +00:00
|
|
|
"Single output directory for building all executables.")
|
|
|
|
endif()
|
|
|
|
if(NOT LIBRARY_OUTPUT_PATH)
|
2019-02-01 16:25:24 +00:00
|
|
|
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/run CACHE INTERNAL
|
2014-06-21 09:10:38 +00:00
|
|
|
"Single output directory for building all libraries.")
|
|
|
|
endif()
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2017-08-17 21:38:54 +00:00
|
|
|
#
|
|
|
|
# The release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG for
|
|
|
|
# the Unix Makefile generator.
|
|
|
|
#
|
|
|
|
|
2018-11-23 20:39:51 +00:00
|
|
|
# Defines CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_DATADIR, etc ...
|
|
|
|
if(WIN32)
|
|
|
|
# Override some values on Windows, to match the existing
|
|
|
|
# convention of installing everything to a single root folder.
|
|
|
|
set(CMAKE_INSTALL_BINDIR ".")
|
|
|
|
set(CMAKE_INSTALL_LIBDIR ".")
|
|
|
|
set(CMAKE_INSTALL_INCLUDEDIR "include")
|
|
|
|
set(CMAKE_INSTALL_DATADIR ".")
|
2019-02-01 16:46:45 +00:00
|
|
|
set(CMAKE_INSTALL_DOCDIR ".")
|
2018-12-03 19:23:35 +00:00
|
|
|
else()
|
|
|
|
# By default INSTALL_DATADIR is set to INSTALL_DATAROOTDIR, set the
|
|
|
|
# proper value here.
|
2019-02-01 16:25:24 +00:00
|
|
|
set(CMAKE_INSTALL_DATADIR "share/${PROJECT_NAME}"
|
2018-12-03 19:23:35 +00:00
|
|
|
CACHE PATH "Read-only architecture-independent data"
|
|
|
|
)
|
2018-11-23 20:39:51 +00:00
|
|
|
endif()
|
2017-09-03 15:22:17 +00:00
|
|
|
include(GNUInstallDirs)
|
2018-11-23 20:39:51 +00:00
|
|
|
|
2019-02-01 16:25:24 +00:00
|
|
|
set(PROJECT_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}")
|
|
|
|
|
2017-08-10 16:35:21 +00:00
|
|
|
# Make sure our executables can can load our libraries if we install into
|
2017-08-17 21:38:54 +00:00
|
|
|
# a non-default directory on Unix-like systems other than macOS.
|
2019-01-19 00:59:29 +00:00
|
|
|
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
|
2019-01-21 10:56:57 +00:00
|
|
|
set(LIBRARY_INSTALL_RPATH "")
|
|
|
|
set(EXECUTABLE_INSTALL_RPATH "")
|
|
|
|
set(EXTCAP_INSTALL_RPATH "")
|
2019-04-22 16:39:52 +00:00
|
|
|
if(NOT (WIN32 OR APPLE OR USE_STATIC))
|
2019-01-19 00:59:29 +00:00
|
|
|
# Try to set a RPATH for installed binaries if the library directory is
|
|
|
|
# not already included in the default search list.
|
|
|
|
list(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" IS_SYSTEM_DIR)
|
|
|
|
if(IS_SYSTEM_DIR EQUAL -1)
|
|
|
|
# Some systems support $ORIGIN in RPATH to enable relocatable
|
|
|
|
# binaries. In other cases, only absolute paths can be used.
|
|
|
|
# https://www.lekensteyn.nl/rpath.html
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|SunOS|FreeBSD)$")
|
2019-02-12 16:55:27 +00:00
|
|
|
set(_enable_rpath_origin TRUE)
|
2019-09-22 12:35:27 +00:00
|
|
|
if(BUILD_dumpcap AND ENABLE_PCAP)
|
2019-02-12 16:55:27 +00:00
|
|
|
# dumpcap will most likely be installed with
|
|
|
|
# capabilities or setuid. Relative RPATHs that
|
|
|
|
# resolve to non-standard library directories
|
|
|
|
# are ignored for such binaries and since we
|
|
|
|
# cannot achieve relocatable builds, just
|
|
|
|
# disable it by default.
|
|
|
|
set(_enable_rpath_origin FALSE)
|
|
|
|
endif()
|
2019-09-17 18:07:54 +00:00
|
|
|
# Provide a knob to optionally force absolute rpaths,
|
|
|
|
# to support old/buggy systems and as a user preference
|
|
|
|
# for hardening.
|
2019-02-12 16:55:27 +00:00
|
|
|
set(ENABLE_RPATH_ORIGIN ${_enable_rpath_origin} CACHE BOOL
|
2019-01-19 00:59:29 +00:00
|
|
|
"Use $ORIGIN with INSTALL_RPATH")
|
|
|
|
mark_as_advanced(ENABLE_RPATH_ORIGIN)
|
|
|
|
else()
|
|
|
|
set(ENABLE_RPATH_ORIGIN FALSE)
|
|
|
|
endif()
|
|
|
|
if(ENABLE_RPATH_ORIGIN)
|
2019-01-21 10:56:57 +00:00
|
|
|
set(LIBRARY_INSTALL_RPATH "$ORIGIN")
|
|
|
|
set(EXECUTABLE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
|
|
|
|
set(EXTCAP_INSTALL_RPATH "$ORIGIN/../..")
|
2019-01-19 00:59:29 +00:00
|
|
|
else()
|
2019-01-21 10:56:57 +00:00
|
|
|
set(LIBRARY_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
|
|
|
set(EXECUTABLE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
|
|
|
set(EXTCAP_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
2019-01-19 00:59:29 +00:00
|
|
|
endif()
|
|
|
|
# Include non-standard external libraries by default in RPATH.
|
|
|
|
if(NOT DEFINED CMAKE_INSTALL_RPATH_USE_LINK_PATH)
|
2018-12-03 05:32:17 +00:00
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
endif()
|
2018-05-10 12:54:31 +00:00
|
|
|
endif()
|
2017-08-10 16:35:21 +00:00
|
|
|
endif()
|
2013-11-04 20:29:29 +00:00
|
|
|
|
2019-01-18 10:18:42 +00:00
|
|
|
# Ensure that executables in the build directory always have the same RPATH.
|
|
|
|
# This ensures relocatable binaries and reproducible builds (invariant of the
|
|
|
|
# build directory location). (Requires CMake 3.14)
|
|
|
|
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
|
|
|
|
|
2018-10-02 20:33:02 +00:00
|
|
|
if(WIN32)
|
2018-10-07 17:06:00 +00:00
|
|
|
# Linking with wsetargv.obj enables "wildcard expansion" of
|
2018-10-02 20:33:02 +00:00
|
|
|
# command-line arguments.
|
2018-10-07 17:06:00 +00:00
|
|
|
set(WILDCARD_OBJ wsetargv.obj)
|
2018-10-02 20:33:02 +00:00
|
|
|
endif(WIN32)
|
|
|
|
|
2015-02-10 21:48:48 +00:00
|
|
|
# Banner shown at top right of Qt welcome screen.
|
|
|
|
if(DEFINED ENV{WIRESHARK_VERSION_FLAVOR})
|
|
|
|
set(VERSION_FLAVOR "$ENV{WIRESHARK_VERSION_FLAVOR}")
|
|
|
|
else()
|
|
|
|
set(VERSION_FLAVOR "Development Build")
|
|
|
|
endif()
|
|
|
|
|
2015-01-10 21:29:57 +00:00
|
|
|
# These are required in .rc files and manifests
|
|
|
|
set(VERSION_MAJOR ${PROJECT_MAJOR_VERSION})
|
|
|
|
set(VERSION_MINOR ${PROJECT_MINOR_VERSION})
|
|
|
|
set(VERSION_MICRO ${PROJECT_PATCH_VERSION})
|
2015-01-06 23:07:50 +00:00
|
|
|
set(VERSION_BUILD ${PROJECT_BUILD_VERSION})
|
|
|
|
set(RC_VERSION ${PROJECT_MAJOR_VERSION},${PROJECT_MINOR_VERSION},${PROJECT_PATCH_VERSION},${PROJECT_BUILD_VERSION})
|
2015-01-10 21:29:57 +00:00
|
|
|
|
2010-03-07 19:40:25 +00:00
|
|
|
message(STATUS "V: ${PROJECT_VERSION}, MaV: ${PROJECT_MAJOR_VERSION}, MiV: ${PROJECT_MINOR_VERSION}, PL: ${PROJECT_PATCH_VERSION}, EV: ${PROJECT_VERSION_EXTENSION}.")
|
|
|
|
|
2013-12-01 21:55:21 +00:00
|
|
|
include(UseLemon)
|
2017-11-20 19:58:46 +00:00
|
|
|
include(UseMakePluginReg)
|
2017-12-10 17:29:40 +00:00
|
|
|
include(UseMakeTaps)
|
2018-10-08 23:34:39 +00:00
|
|
|
include(UseExecutableResources)
|
2013-12-01 21:55:21 +00:00
|
|
|
include(UseAsn2Wrs)
|
2006-10-26 15:36:50 +00:00
|
|
|
|
2017-07-04 08:22:34 +00:00
|
|
|
# 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
|
2018-05-10 12:54:31 +00:00
|
|
|
if(CMAKE_EXTRA_GENERATOR MATCHES "Eclipse CDT4")
|
2017-07-04 08:22:34 +00:00
|
|
|
SET(CXX_ENABLED 0)
|
|
|
|
LIST(LENGTH CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS LIST_LEN)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(LIST_LEN GREATER 0)
|
2017-07-04 08:22:34 +00:00
|
|
|
SET(CXX_ENABLED 1)
|
|
|
|
endif()
|
|
|
|
SET(C_ENABLED 0)
|
|
|
|
LIST(LENGTH CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS LIST_LEN)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(LIST_LEN GREATER 0)
|
2017-07-04 08:22:34 +00:00
|
|
|
SET(C_ENABLED 1)
|
|
|
|
endif()
|
2018-05-10 12:54:31 +00:00
|
|
|
if(C_ENABLED EQUAL 1 AND CXX_ENABLED EQUAL 1)
|
2017-07-04 08:22:34 +00:00
|
|
|
# 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)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(GEN_MACRO_INDEX GREATER -1)
|
2017-07-04 08:22:34 +00:00
|
|
|
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 "")
|
2018-05-10 12:54:31 +00:00
|
|
|
elseif((CXX_ENABLED EQUAL 1) AND (CMAKE_CXX_FLAGS MATCHES ".*-std=c\\+\\+11.*"))
|
2017-07-04 08:22:34 +00:00
|
|
|
#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)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(GEN_MACRO_INDEX GREATER -1)
|
2017-07-04 08:22:34 +00:00
|
|
|
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()
|
|
|
|
|
2006-10-26 15:36:50 +00:00
|
|
|
include_directories(
|
2009-09-02 16:33:01 +00:00
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}
|
2006-10-26 15:36:50 +00:00
|
|
|
)
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2014-01-19 00:48:22 +00:00
|
|
|
if( DUMPCAP_INSTALL_OPTION STREQUAL "suid" )
|
|
|
|
set( DUMPCAP_SETUID "SETUID" )
|
|
|
|
else()
|
|
|
|
set( DUMPCAP_SETUID )
|
|
|
|
endif()
|
|
|
|
if( NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
|
|
|
DUMPCAP_INSTALL_OPTION STREQUAL "capabilities" )
|
|
|
|
message( WARNING "Capabilities are only supported on Linux" )
|
|
|
|
set( DUMPCAP_INSTALL_OPTION )
|
|
|
|
endif()
|
2017-08-27 13:39:50 +00:00
|
|
|
|
2018-10-16 22:47:20 +00:00
|
|
|
set(OSS_FUZZ OFF CACHE BOOL "Whether building for oss-fuzz")
|
|
|
|
mark_as_advanced(OSS_FUZZ)
|
|
|
|
if(OSS_FUZZ)
|
|
|
|
if(ENABLE_FUZZER)
|
|
|
|
# In oss-fuzz mode, the fuzzing engine can be afl or libFuzzer.
|
|
|
|
message(FATAL_ERROR "Cannot force libFuzzer when using oss-fuzz")
|
|
|
|
endif()
|
|
|
|
# Must not depend on external dependencies so statically link all libs.
|
2019-04-22 16:39:52 +00:00
|
|
|
set(USE_STATIC ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(USE_STATIC)
|
2018-10-16 22:47:20 +00:00
|
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
#
|
|
|
|
# Linking can consume a lot of memory, especially when built with ASAN and
|
|
|
|
# static libraries (like oss-fuzz) or Debug mode. With Ninja, the number of
|
|
|
|
# parallel linker processes is constrained by job parallelism (-j), but this can
|
|
|
|
# be reduced further by setting "job pools" to a lower number.
|
|
|
|
#
|
|
|
|
if(CMAKE_MAKE_PROGRAM MATCHES "ninja" AND OSS_FUZZ)
|
|
|
|
# Assume oss-fuzz linker jobs do not require more than 1.2G per task
|
|
|
|
set(per_job_memory_mb 1200)
|
|
|
|
cmake_host_system_information(RESULT total_memory_mb QUERY TOTAL_PHYSICAL_MEMORY)
|
|
|
|
math(EXPR parallel_link_jobs "${total_memory_mb} / ${per_job_memory_mb}")
|
|
|
|
if(parallel_link_jobs LESS 1)
|
|
|
|
set(parallel_link_jobs 1)
|
|
|
|
endif()
|
|
|
|
set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${parallel_link_jobs})
|
|
|
|
set(CMAKE_JOB_POOL_LINK link_job_pool)
|
|
|
|
message(STATUS "Ninja job pool size: ${parallel_link_jobs}")
|
|
|
|
endif()
|
|
|
|
|
2015-11-15 20:21:41 +00:00
|
|
|
# Always enable position-independent code when compiling, even for
|
|
|
|
# executables, so you can build position-independent executables.
|
2019-01-17 18:34:37 +00:00
|
|
|
# -pie is added below for non-MSVC, but requires objects to be built with
|
|
|
|
# -fPIC/-fPIE (so set CMAKE_POSITION_INDEPENDENT_CODE to enable that).
|
2015-10-09 21:43:02 +00:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2018-09-04 20:03:48 +00:00
|
|
|
# Path to our generated executables (or wrapper scripts)
|
|
|
|
if(WIN32)
|
|
|
|
set(WS_PROGRAM_PATH ./run/$<CONFIG>)
|
|
|
|
else()
|
|
|
|
set(WS_PROGRAM_PATH ./run)
|
|
|
|
endif()
|
|
|
|
|
2013-09-23 21:45:55 +00:00
|
|
|
if( CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
2018-03-03 17:55:36 +00:00
|
|
|
if ((MSVC_VERSION LESS "1900") OR (MSVC_VERSION GREATER_EQUAL "2000"))
|
2013-11-29 21:07:23 +00:00
|
|
|
message(FATAL_ERROR "You are using an unsupported version of MSVC")
|
|
|
|
endif()
|
2015-06-15 12:14:01 +00:00
|
|
|
|
|
|
|
add_definitions(
|
2013-11-17 14:03:58 +00:00
|
|
|
/DWIN32_LEAN_AND_MEAN
|
|
|
|
/D_CRT_SECURE_NO_DEPRECATE
|
|
|
|
# NOMINMAX keeps windows.h from defining "min" and "max" via windef.h.
|
|
|
|
# This avoids conflicts with the C++ standard library.
|
|
|
|
/DNOMINMAX
|
2014-06-20 21:59:29 +00:00
|
|
|
# -DPSAPI_VERSION=1 Programs that must run on earlier versions of Windows as well as Windows 7 and later
|
|
|
|
# versions should always call this function as GetProcessMemoryInfo. To ensure correct
|
|
|
|
# resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program
|
|
|
|
# with -DPSAPI_VERSION=1.To use run-time dynamic linking, load Psapi.dll.
|
2019-07-27 07:54:44 +00:00
|
|
|
# https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo
|
2014-06-20 21:59:29 +00:00
|
|
|
# -D_ALLOW_KEYWORD_MACROS For VS2012 onwards the, C++ STL does not permit macro redefinitions of keywords
|
2019-07-27 07:54:44 +00:00
|
|
|
# (see https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/bb531344(v=vs.110))
|
2014-06-20 21:59:29 +00:00
|
|
|
# This definition prevents the complaint about the redefinition of inline by WinPCap
|
2016-02-10 12:52:58 +00:00
|
|
|
# in pcap-stdinc.h when compiling C++ files, e.g. the Qt UI
|
2014-06-20 21:59:29 +00:00
|
|
|
/DPSAPI_VERSION=1
|
|
|
|
/D_ALLOW_KEYWORD_MACROS
|
2013-11-17 14:03:58 +00:00
|
|
|
)
|
|
|
|
|
2018-05-10 12:54:31 +00:00
|
|
|
if(NOT WIRESHARK_TARGET_PLATFORM STREQUAL "win64")
|
2015-06-15 12:14:01 +00:00
|
|
|
add_definitions("/D_BIND_TO_CURRENT_CRT_VERSION=1")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(LOCAL_CFLAGS
|
|
|
|
/MP
|
|
|
|
)
|
|
|
|
|
2018-01-16 21:56:58 +00:00
|
|
|
set(WS_LINK_FLAGS "/LARGEADDRESSAWARE /MANIFEST:NO /INCREMENTAL:NO /RELEASE")
|
|
|
|
|
2019-07-27 07:54:44 +00:00
|
|
|
# To do: Add /external:... See https://devblogs.microsoft.com/cppblog/broken-warnings-theory/
|
2018-05-16 23:35:12 +00:00
|
|
|
#
|
|
|
|
# /Zo Enhanced debugging of optimised code
|
|
|
|
# /utf-8 Set Source and Executable character sets to UTF-8
|
|
|
|
# VS2015(MSVC14): On by default when /Zi or /Z7 used.
|
|
|
|
# /guard:cf Control Flow Guard (compile and link).
|
2019-07-27 07:54:44 +00:00
|
|
|
# See https://docs.microsoft.com/en-us/windows/win32/secbp/control-flow-guard
|
2018-05-16 23:35:12 +00:00
|
|
|
# Note: This requires CMake 3.9.0 or newer.
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/commit/f973d49ab9d4c59b93f6dac812a94bb130200836
|
|
|
|
# /Qspectre Speculative execution attack mitigation
|
2019-07-27 07:54:44 +00:00
|
|
|
# See https://devblogs.microsoft.com/cppblog/spectre-mitigations-in-msvc/
|
2018-05-16 23:35:12 +00:00
|
|
|
list(APPEND LOCAL_CFLAGS /Zo /utf-8 /guard:cf)
|
|
|
|
set(WS_LINK_FLAGS "${WS_LINK_FLAGS} /guard:cf")
|
|
|
|
# /Qspectre is not available for VS2015 or older VS2017. Test for its availability.
|
|
|
|
set(WIRESHARK_COMMON_FLAGS /Qspectre)
|
2014-09-27 08:37:11 +00:00
|
|
|
|
2015-01-06 18:44:37 +00:00
|
|
|
if(ENABLE_CODE_ANALYSIS)
|
2018-03-14 16:20:16 +00:00
|
|
|
list(APPEND LOCAL_CFLAGS /analyze:WX-)
|
2015-01-06 18:44:37 +00:00
|
|
|
endif()
|
|
|
|
|
2013-11-17 14:03:58 +00:00
|
|
|
# Additional compiler warnings to be treated as "Level 3"
|
2018-03-14 16:20:16 +00:00
|
|
|
# when compiling Wireshark sources. (Selected from "level 4" warnings).
|
2013-11-17 14:03:58 +00:00
|
|
|
## 4295: array is too small to include a terminating null character
|
2019-09-15 09:25:18 +00:00
|
|
|
## 4100: unreferenced formal parameter
|
2014-08-20 12:31:19 +00:00
|
|
|
## 4189: local variable is initialized but not referenced
|
2016-08-31 13:58:20 +00:00
|
|
|
# Disable warnings about about use of flexible array members:
|
|
|
|
## 4200: nonstandard extension used : zero-sized array in struct/union
|
2019-09-15 09:25:18 +00:00
|
|
|
list(APPEND LOCAL_CFLAGS /w34295 /w34100 /w34189 /wd4200)
|
2018-03-14 16:20:16 +00:00
|
|
|
|
|
|
|
# We've matched these to specific compiler versions using the
|
|
|
|
# checks above. There's no need to pass them to check_c_compiler_flag
|
|
|
|
# or check_cxx_compiler_flag, which can be slow.
|
|
|
|
string(REPLACE ";" " " _flags "${LOCAL_CFLAGS}")
|
|
|
|
set(CMAKE_C_FLAGS "${_flags} ${CMAKE_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "${_flags} ${CMAKE_CXX_FLAGS}")
|
2014-11-18 15:59:44 +00:00
|
|
|
|
2018-01-16 21:56:58 +00:00
|
|
|
else() # ! MSVC
|
2018-12-14 19:30:39 +00:00
|
|
|
if(APPLE)
|
|
|
|
set(MIN_MACOS_VERSION 10.6) # Arbitrary.
|
|
|
|
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS MIN_MACOS_VERSION)
|
|
|
|
message(FATAL_ERROR "We don't support building for macOS < ${MIN_MACOS_VERSION}")
|
2014-08-03 20:07:46 +00:00
|
|
|
endif()
|
2018-12-14 19:30:39 +00:00
|
|
|
set(MIN_MACOS_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET})
|
2017-04-05 19:15:27 +00:00
|
|
|
message(STATUS "Building for Mac OS X/OS X/macOS ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
2014-08-03 20:07:46 +00:00
|
|
|
endif()
|
2018-12-15 22:44:10 +00:00
|
|
|
elseif(CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET only applies when building for macOS")
|
2014-08-03 20:07:46 +00:00
|
|
|
endif()
|
|
|
|
|
2018-03-26 09:57:13 +00:00
|
|
|
#
|
|
|
|
# Do whatever is necessary to enable as much C99 support as
|
|
|
|
# possible in the C compiler. Newer versions of compilers
|
|
|
|
# might default to supporting C99, but older versions may
|
|
|
|
# require a special flag.
|
|
|
|
#
|
|
|
|
# We do not want strict C99 support, as we may also want to
|
|
|
|
# use compiler extensions.
|
|
|
|
#
|
|
|
|
# Prior to CMake 3.1, setting CMAKE_C_STANDARD will not have
|
|
|
|
# any effect, so, unless and until we require CMake 3.1 or
|
|
|
|
# later, we have to do it ourselves on pre-3.1 CMake, so we
|
|
|
|
# just do it ourselves on all versions of CMake.
|
|
|
|
#
|
|
|
|
# Note: with CMake 3.1 through 3.5, the only compilers for
|
|
|
|
# which CMake handles CMAKE_C_STANDARD are GCC and Clang.
|
|
|
|
# 3.6 adds support only for Intel C; 3.9 adds support for
|
|
|
|
# PGI C, Sun C, and IBM XL C, and 3.10 adds support for
|
|
|
|
# Cray C and IAR C, but no version of CMake has support for
|
|
|
|
# HP C. Therefore, even if we use CMAKE_C_STANDARD with
|
|
|
|
# compilers for which CMake supports it, we may still have
|
|
|
|
# to do it ourselves on other compilers.
|
|
|
|
#
|
2018-05-16 17:15:43 +00:00
|
|
|
# In addition, CMake 3.5.2 seems to think that GCC versions
|
|
|
|
# less than 4.4 don't support -std=gnu99, which we need in
|
|
|
|
# order to get support for "for (int i = 0; i < n; i++) ;",
|
|
|
|
# which is another reason not to rely on CMake's CMAKE_C_STANDARD
|
|
|
|
# support.
|
|
|
|
#
|
2018-03-26 09:57:13 +00:00
|
|
|
# See the CMake documentation for the CMAKE_<LANG>_COMPILER_ID
|
|
|
|
# variables for a list of compiler IDs.
|
|
|
|
#
|
|
|
|
# We don't worry about MSVC; it doesn't have such a flag -
|
|
|
|
# either it doesn't support the C99 features we need at all,
|
|
|
|
# or it supports them regardless of the compiler flag.
|
|
|
|
#
|
|
|
|
# XXX - we add the flag for a given compiler to CMAKE_C_FLAGS,
|
|
|
|
# so we test whether it works and add it if we do. We don't
|
|
|
|
# test whether it's necessary in order to get the C99 features
|
|
|
|
# that we use; if we ever have a user who tries to compile with
|
|
|
|
# a compiler that can't be made to support those features, we
|
|
|
|
# can add a test to make sure we actually *have* C99 support.
|
|
|
|
#
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR
|
|
|
|
CMAKE_C_COMPILER_ID MATCHES "Clang")
|
2016-09-07 03:51:23 +00:00
|
|
|
#
|
2018-03-26 09:57:13 +00:00
|
|
|
# We use -std=gnu99 rather than -std=c99 because, for
|
|
|
|
# some older compilers such as GCC 4.4.7, -std=gnu99
|
|
|
|
# is required to avoid errors about C99 constructs
|
|
|
|
# such as "for (int i = 0; i < n; i++) ;".
|
2016-09-07 03:51:23 +00:00
|
|
|
#
|
2018-03-26 09:57:13 +00:00
|
|
|
set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
|
|
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES "XL")
|
2016-09-07 03:51:23 +00:00
|
|
|
#
|
2018-03-26 09:57:13 +00:00
|
|
|
# We want support for extensions picked up for
|
|
|
|
# GNU C compatibility, so we use -qlanglvl=extc99.
|
2016-09-07 03:51:23 +00:00
|
|
|
#
|
2018-03-26 09:57:13 +00:00
|
|
|
set(CMAKE_C_FLAGS "-qlanglvl=extc99 ${CMAKE_C_FLAGS}")
|
|
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES "HP")
|
2018-04-02 20:21:39 +00:00
|
|
|
#
|
|
|
|
# We also need to add -Wp,-H200000 to handle some large
|
|
|
|
# #defines we have; that flag is not necessary for the
|
|
|
|
# C++ compiler unless the "legacy" C++ preprocessor is
|
|
|
|
# being used (+legacy_cpp). We don't want the legacy
|
|
|
|
# preprocessor if it's not the default, so we just add
|
|
|
|
# -Wp,-H200000 to the C flags. (If there are older
|
|
|
|
# versions of aC++ that only support the legacy
|
|
|
|
# preprocessor, and require that we boost the table
|
|
|
|
# size, we'd have to check whether -Wp,-H200000 is
|
|
|
|
# supported by the C++ compiler and add it only if it is.)
|
|
|
|
#
|
|
|
|
set(CMAKE_C_FLAGS "-AC99 -Wp,-H200000 $WS_CFLAGS ${CMAKE_C_FLAGS}")
|
2018-03-26 09:57:13 +00:00
|
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Sun")
|
2018-04-02 20:21:39 +00:00
|
|
|
#
|
|
|
|
# We also crank up the warning level.
|
|
|
|
#
|
|
|
|
set(CMAKE_C_FLAGS "-xc99 -v ${CMAKE_C_FLAGS}")
|
2018-03-26 09:57:13 +00:00
|
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
|
|
|
set(CMAKE_C_FLAGS "-c99 ${CMAKE_C_FLAGS}")
|
2016-08-31 13:58:20 +00:00
|
|
|
endif()
|
|
|
|
|
2016-08-16 21:21:59 +00:00
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
|
|
|
|
# avoid "argument unused during compilation" warnings
|
|
|
|
# (for example, when getting the -gsplit-dwarf option or
|
|
|
|
# when combining -fwrapv with -fno-strict-overflow)
|
|
|
|
-Qunused-arguments
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
|
|
|
|
-fexcess-precision=fast
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-09-10 00:13:56 +00:00
|
|
|
list(APPEND WIRESHARK_COMMON_FLAGS
|
2014-08-02 23:26:50 +00:00
|
|
|
# The following are for C and C++
|
2013-11-17 14:03:58 +00:00
|
|
|
# -O<X> and -g get set by the CMAKE_BUILD_TYPE
|
|
|
|
-Wall
|
|
|
|
-Wextra
|
|
|
|
-Wendif-labels
|
|
|
|
-Wpointer-arith
|
|
|
|
-Wformat-security
|
2014-08-03 00:46:32 +00:00
|
|
|
-fwrapv
|
|
|
|
-fno-strict-overflow
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wvla
|
|
|
|
-Waddress
|
|
|
|
-Wattributes
|
|
|
|
-Wdiv-by-zero
|
|
|
|
-Wignored-qualifiers
|
2014-04-20 22:44:53 +00:00
|
|
|
-Wpragmas
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wno-overlength-strings
|
|
|
|
-Wno-long-long
|
2014-04-20 22:44:53 +00:00
|
|
|
-Wheader-guard
|
2018-09-11 19:42:34 +00:00
|
|
|
-Wcomma
|
Don't use -Werror with Apple's llvm-gcc.
Its handling of warnings, and of warnings-treated-as-errors, is horribly
broken; once you've asked for a warning, and have specified -Werror,
there appears to be nothing whatsoever that you can do to keep that
warning from being an error *everywhere* in the code.
Prior to change Ib591a1d6beaa13337d927a446b4d8d5e687ff610, the tests for
warnings were all failing on the macOS buildbot, so *no* warnings were
being requested.
With this change, a warning won't be reported as an error, but at least
it'll be reported.
(We should probably switch to using Clang on the macOS buildbot at some
point; I don't know whether the version of Clang currently on the
buildbot is safe to use, but if we ever run a newer version of Xcode,
which doesn't come with llvm-gcc - which may involve running a newer
version of macOS on the buildbot as well - it's presumably safe, given
that it's the only compiler Apple shipped.)
Change-Id: I677967cb87b91f68f08de546e59abff1dbd6788b
Reviewed-on: https://code.wireshark.org/review/29623
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-12 04:02:56 +00:00
|
|
|
-Wshorten-64-to-32
|
2017-07-31 08:43:58 +00:00
|
|
|
)
|
2017-08-06 22:49:13 +00:00
|
|
|
|
2017-08-07 00:34:52 +00:00
|
|
|
#
|
|
|
|
# Code that may be worth looking into (coding practices)
|
|
|
|
#
|
2017-11-20 20:44:17 +00:00
|
|
|
if((NOT ENABLE_ASAN) AND (NOT ENABLE_TSAN) AND (NOT ENABLE_UBSAN) AND (NOT DISABLE_FRAME_LARGER_THAN_WARNING))
|
2017-08-06 22:49:13 +00:00
|
|
|
#
|
2017-11-20 20:44:17 +00:00
|
|
|
# Only do this if none of ASan, TSan, and UBSan are
|
2017-08-07 00:34:52 +00:00
|
|
|
# enabled; the instrumentation they add increases
|
|
|
|
# the stack usage - we only care about stack
|
|
|
|
# usage in normal operation.
|
2017-08-06 22:49:13 +00:00
|
|
|
#
|
2018-09-10 00:13:56 +00:00
|
|
|
set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
|
2018-05-29 23:44:09 +00:00
|
|
|
-Wframe-larger-than=32768
|
2017-08-06 22:49:13 +00:00
|
|
|
)
|
|
|
|
endif()
|
2013-11-17 14:03:58 +00:00
|
|
|
|
2018-09-10 00:13:56 +00:00
|
|
|
list(APPEND WIRESHARK_C_ONLY_FLAGS
|
2013-11-17 14:03:58 +00:00
|
|
|
# The following are C only, not C++
|
|
|
|
-Wc++-compat
|
2017-08-07 00:58:00 +00:00
|
|
|
-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
|
2018-04-25 16:54:00 +00:00
|
|
|
# variables. The autoconf script checked for that; we
|
2017-08-07 00:58:00 +00:00
|
|
|
# don't.
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wshadow
|
|
|
|
-Wold-style-definition
|
|
|
|
-Wstrict-prototypes
|
2017-08-07 00:58:00 +00:00
|
|
|
#
|
|
|
|
# Some versions of GCC, such as 4.3.2 and 4.4.5,
|
|
|
|
# generate logical-op warnings when strchr() is given a
|
2018-04-25 16:54:00 +00:00
|
|
|
# constant string. The autoconf script checked for that;
|
2017-08-07 00:58:00 +00:00
|
|
|
# we don't.
|
|
|
|
#
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wlogical-op
|
|
|
|
-Wjump-misses-init
|
2017-08-07 00:58:00 +00:00
|
|
|
#
|
2016-12-17 22:12:11 +00:00
|
|
|
# Implicit function declarations are an error in C++ and most
|
|
|
|
# likely a programming error in C. Turn -Wimplicit-int and
|
|
|
|
# -Wimplicit-function-declaration into an error by default.
|
|
|
|
#
|
|
|
|
-Werror=implicit
|
2013-11-17 14:03:58 +00:00
|
|
|
)
|
|
|
|
|
2018-11-18 00:44:16 +00:00
|
|
|
#
|
|
|
|
# The universal zero initializer (in C: struct s x = { 0 };) for
|
|
|
|
# structures with multiple members is perfectly legal, but some older
|
|
|
|
# compilers warn about it. Silence those older compilers.
|
|
|
|
#
|
2018-12-08 11:11:23 +00:00
|
|
|
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "5.1") OR
|
2018-11-18 00:44:16 +00:00
|
|
|
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0") OR
|
|
|
|
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "10.0"))
|
2018-12-08 11:11:23 +00:00
|
|
|
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_VERSION VERSION_LESS "4.7")
|
|
|
|
list(APPEND WIRESHARK_C_ONLY_FLAGS -Wno-missing-field-initializers)
|
|
|
|
endif()
|
|
|
|
# Silence warnings for initialization of nested structs like
|
|
|
|
# struct { struct { int a, b; } s; int c; } v = { 0 };
|
|
|
|
list(APPEND WIRESHARK_C_ONLY_FLAGS -Wno-missing-braces)
|
2018-11-18 00:44:16 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2018-09-10 00:13:56 +00:00
|
|
|
list(APPEND WIRESHARK_CXX_ONLY_FLAGS
|
2018-12-06 20:31:01 +00:00
|
|
|
-Wextra-semi
|
2014-01-07 23:08:42 +00:00
|
|
|
)
|
|
|
|
|
2017-08-07 00:58:00 +00:00
|
|
|
#
|
|
|
|
# These are not enabled by default, because the warnings they
|
|
|
|
# produce are very hard or impossible to eliminate.
|
|
|
|
#
|
2018-09-10 00:13:56 +00:00
|
|
|
if(ENABLE_EXTRA_COMPILER_WARNINGS) # This overrides -Werror
|
|
|
|
list(APPEND WIRESHARK_COMMON_FLAGS
|
|
|
|
# The following are for C and C++
|
|
|
|
-Wpedantic
|
|
|
|
#
|
|
|
|
# As we use variadic macros, we don't want warnings
|
|
|
|
# about them, even with -Wpedantic.
|
|
|
|
#
|
|
|
|
-Wno-variadic-macros
|
|
|
|
#
|
|
|
|
# Various code blocks this one.
|
|
|
|
#
|
|
|
|
-Woverflow
|
|
|
|
-fstrict-overflow -Wstrict-overflow=4
|
|
|
|
#
|
|
|
|
# Due to various places where APIs we don't control
|
|
|
|
# require us to cast away constness, we can probably
|
|
|
|
# never enable this one with -Werror.
|
|
|
|
#
|
|
|
|
-Wcast-qual
|
|
|
|
#
|
|
|
|
# Some generated ASN.1 dissectors block this one;
|
|
|
|
# multiple function declarations for the same
|
|
|
|
# function are being generated.
|
|
|
|
#
|
|
|
|
-Wredundant-decls
|
|
|
|
#
|
|
|
|
# All the registration functions block these for now.
|
|
|
|
#
|
|
|
|
-Wmissing-prototypes
|
|
|
|
-Wmissing-declarations
|
|
|
|
#
|
|
|
|
# A bunch of "that might not work on SPARC" code blocks
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
# Works only with Clang
|
|
|
|
#
|
|
|
|
-Wunreachable-code
|
|
|
|
#
|
|
|
|
# Works only with Clang but generates a lot of warnings
|
|
|
|
# (about glib library not using Doxygen)
|
|
|
|
#
|
|
|
|
-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
|
|
|
|
)
|
2013-11-17 14:03:58 +00:00
|
|
|
|
2019-04-19 19:50:34 +00:00
|
|
|
#
|
|
|
|
# Some loops are safe, but it's hard to convince the compiler of
|
|
|
|
# that. Always disable the warning on GCC 7 due to a bug that
|
|
|
|
# cause lots of false positives.
|
|
|
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81408
|
|
|
|
#
|
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION MATCHES "^7\\.")
|
|
|
|
list(APPEND WIRESHARK_COMMON_FLAGS -Wunsafe-loop-optimizations)
|
|
|
|
endif()
|
|
|
|
|
2018-09-10 00:13:56 +00:00
|
|
|
list(APPEND WIRESHARK_C_ONLY_FLAGS
|
|
|
|
# The following are C only, not C++
|
|
|
|
#
|
|
|
|
# Due to various places where APIs we don't control
|
|
|
|
# require us to cast away constness, we can probably
|
|
|
|
# never enable this one with -Werror.
|
|
|
|
#
|
|
|
|
-Wbad-function-cast
|
|
|
|
)
|
2014-01-07 23:08:42 +00:00
|
|
|
|
2018-09-10 00:13:56 +00:00
|
|
|
list(APPEND WIRESHARK_CXX_ONLY_FLAGS
|
|
|
|
)
|
2019-05-16 20:46:07 +00:00
|
|
|
else()
|
|
|
|
#
|
|
|
|
# -Wpointer-sign is a default test we get with -Wall and
|
|
|
|
# -W, but for some reason we were suppressing it -
|
|
|
|
# unconditionally. Suppress it only without the extra
|
|
|
|
# warnings, so we can at least see how much we get.
|
|
|
|
# (This would have caught at least one error - the one
|
|
|
|
# in change https://code.wireshark.org/review/33234,
|
|
|
|
# which would have suggested that the wrong
|
|
|
|
# proto_tree_add_ret_ call was being used.)
|
|
|
|
#
|
|
|
|
list(APPEND WIRESHARK_C_ONLY_FLAGS
|
|
|
|
-Wno-pointer-sign
|
|
|
|
)
|
2014-03-15 11:52:29 +00:00
|
|
|
endif()
|
|
|
|
|
2013-11-17 14:03:58 +00:00
|
|
|
add_definitions(
|
|
|
|
-DG_DISABLE_DEPRECATED
|
|
|
|
-DG_DISABLE_SINGLE_INCLUDES
|
|
|
|
)
|
2018-01-16 21:56:58 +00:00
|
|
|
|
|
|
|
set(WIRESHARK_LD_FLAGS
|
2018-09-09 17:09:47 +00:00
|
|
|
# See also CheckCLinkerFlag.cmake
|
2018-01-16 21:56:58 +00:00
|
|
|
-Wl,--as-needed
|
|
|
|
# -flto
|
|
|
|
# -fwhopr
|
|
|
|
# -fwhole-program
|
|
|
|
)
|
|
|
|
endif() # ! MSVC
|
2006-10-26 15:36:50 +00:00
|
|
|
|
2009-09-24 20:42:08 +00:00
|
|
|
# Counterhack to work around some cache magic in CHECK_C_SOURCE_COMPILES
|
2009-09-14 06:51:22 +00:00
|
|
|
include(CheckCCompilerFlag)
|
2014-01-03 00:40:21 +00:00
|
|
|
include(CheckCXXCompilerFlag)
|
2013-07-21 18:12:20 +00:00
|
|
|
|
2015-10-17 10:00:27 +00:00
|
|
|
if(ENABLE_STATIC)
|
|
|
|
set(BUILD_SHARED_LIBS 0)
|
|
|
|
else()
|
|
|
|
set(BUILD_SHARED_LIBS 1)
|
|
|
|
endif()
|
|
|
|
|
2018-09-07 23:05:40 +00:00
|
|
|
function(test_compiler_flag _lang _this_flag _valid_flags_var)
|
|
|
|
string(MAKE_C_IDENTIFIER "${_lang}${_this_flag}_VALID" _flag_var)
|
|
|
|
set(_test_flags "${${_valid_flags_var}} ${_this_flag}")
|
|
|
|
if(_lang STREQUAL "C")
|
|
|
|
check_c_compiler_flag("${_test_flags}" ${_flag_var})
|
|
|
|
elseif(_lang STREQUAL "CXX")
|
|
|
|
check_cxx_compiler_flag("${_test_flags}" ${_flag_var})
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Language must be C or CXX")
|
2014-01-03 00:40:21 +00:00
|
|
|
endif()
|
2018-09-07 23:05:40 +00:00
|
|
|
if (${_flag_var})
|
|
|
|
set(${_valid_flags_var} "${_test_flags}" PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
2018-09-10 00:13:56 +00:00
|
|
|
foreach(THIS_FLAG ${WIRESHARK_COMMON_FLAGS} ${WIRESHARK_C_ONLY_FLAGS})
|
2018-09-07 23:05:40 +00:00
|
|
|
test_compiler_flag(C ${THIS_FLAG} ADDED_CMAKE_C_FLAGS)
|
2014-01-03 00:40:21 +00:00
|
|
|
endforeach()
|
2014-06-30 15:56:28 +00:00
|
|
|
set(CMAKE_C_FLAGS "${ADDED_CMAKE_C_FLAGS} ${CMAKE_C_FLAGS}")
|
|
|
|
|
2018-09-10 00:13:56 +00:00
|
|
|
foreach(THIS_FLAG ${WIRESHARK_COMMON_FLAGS} ${WIRESHARK_CXX_ONLY_FLAGS})
|
2018-09-07 23:05:40 +00:00
|
|
|
test_compiler_flag(CXX ${THIS_FLAG} ADDED_CMAKE_CXX_FLAGS)
|
2009-09-14 06:51:22 +00:00
|
|
|
endforeach()
|
2014-06-30 15:56:28 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${ADDED_CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
|
2016-08-16 21:21:59 +00:00
|
|
|
|
2019-01-21 11:08:34 +00:00
|
|
|
# Strips the source and build directory prefix from the __FILE__ macro to ensure
|
|
|
|
# reproducible builds. Supported since GCC 8, Clang support is pending.
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
# If the build dir is within the source dir, CMake will use something
|
|
|
|
# like ../epan/dfilter/semcheck.c. Map these relative paths in addition
|
|
|
|
# to CMAKE_BINARY_DIR since compile_commands.json uses absolute paths.
|
|
|
|
file(RELATIVE_PATH _relative_source_dir "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}")
|
|
|
|
string(REGEX REPLACE "/$" "" _relative_source_dir "${_relative_source_dir}")
|
|
|
|
|
|
|
|
check_c_compiler_flag(-fmacro-prefix-map=old=new C_fmacro_prefix_map_old_new_VALID)
|
|
|
|
check_cxx_compiler_flag(-fmacro-prefix-map=old=new CXX_fmacro_prefix_map_old_new_VALID)
|
|
|
|
foreach(_lang C CXX)
|
|
|
|
if(${_lang}_fmacro_prefix_map_old_new_VALID)
|
|
|
|
set(_flags CMAKE_${_lang}_FLAGS)
|
|
|
|
set(${_flags} "${${_flags}} -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=")
|
|
|
|
set(${_flags} "${${_flags}} -fmacro-prefix-map=${CMAKE_BINARY_DIR}/=")
|
|
|
|
if(_relative_source_dir MATCHES "\\.\\.$")
|
|
|
|
set(${_flags} "${${_flags}} -fmacro-prefix-map=${_relative_source_dir}/=")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2017-09-08 11:32:04 +00:00
|
|
|
include(CMakePushCheckState)
|
|
|
|
|
2016-06-14 21:52:01 +00:00
|
|
|
if(ENABLE_ASAN)
|
2017-09-08 11:32:04 +00:00
|
|
|
cmake_push_check_state()
|
2016-06-14 21:52:01 +00:00
|
|
|
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)
|
2017-09-08 11:32:04 +00:00
|
|
|
cmake_pop_check_state()
|
2016-06-14 21:52:01 +00:00
|
|
|
if(NOT C__fsanitize_address_VALID OR NOT CXX__fsanitize_address_VALID)
|
|
|
|
message(FATAL_ERROR "ENABLE_ASAN was requested, but not supported!")
|
|
|
|
endif()
|
|
|
|
set(CMAKE_C_FLAGS "-fsanitize=address ${CMAKE_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "-fsanitize=address ${CMAKE_CXX_FLAGS}")
|
2016-10-06 17:38:39 +00:00
|
|
|
# Disable ASAN for build-time tools, e.g. lemon
|
|
|
|
check_c_compiler_flag(-fno-sanitize=all C__fno_sanitize_all_VALID)
|
|
|
|
if(C__fno_sanitize_all_VALID)
|
|
|
|
set(NO_SANITIZE_CFLAGS "-fno-sanitize=all")
|
|
|
|
set(NO_SANITIZE_LDFLAGS "-fno-sanitize=all")
|
|
|
|
endif()
|
2016-06-14 21:52:01 +00:00
|
|
|
endif()
|
|
|
|
|
2017-11-20 20:44:17 +00:00
|
|
|
if(ENABLE_TSAN)
|
|
|
|
# Available since Clang >= 3.2 and GCC >= 4.8
|
|
|
|
cmake_push_check_state()
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES "-fsanitize=thread")
|
|
|
|
check_c_compiler_flag(-fsanitize=thread C__fsanitize_thread_VALID)
|
|
|
|
check_cxx_compiler_flag(-fsanitize=thread CXX__fsanitize_thread_VALID)
|
|
|
|
cmake_pop_check_state()
|
|
|
|
if(NOT C__fsanitize_thread_VALID OR NOT CXX__fsanitize_thread_VALID)
|
|
|
|
message(FATAL_ERROR "ENABLE_TSAN was requested, but not supported!")
|
|
|
|
endif()
|
|
|
|
set(CMAKE_C_FLAGS "-fsanitize=thread ${CMAKE_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "-fsanitize=thread ${CMAKE_CXX_FLAGS}")
|
|
|
|
set(WS_LINK_FLAGS "-fsanitize=thread ${WS_LINK_FLAGS}")
|
|
|
|
endif()
|
|
|
|
|
2017-05-15 22:09:43 +00:00
|
|
|
if(ENABLE_UBSAN)
|
2017-11-20 20:44:17 +00:00
|
|
|
# Available since Clang >= 3.3 and GCC >= 4.9
|
2017-09-08 11:32:04 +00:00
|
|
|
cmake_push_check_state()
|
2017-05-15 22:09:43 +00:00
|
|
|
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)
|
2017-09-08 11:32:04 +00:00
|
|
|
cmake_pop_check_state()
|
2017-05-15 22:09:43 +00:00
|
|
|
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()
|
|
|
|
|
2018-10-16 22:47:20 +00:00
|
|
|
if(ENABLE_FUZZER)
|
|
|
|
# Available since Clang >= 6
|
|
|
|
# Will enable coverage flags which can be used by the fuzzshark target.
|
|
|
|
cmake_push_check_state()
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES "-fsanitize=fuzzer-no-link")
|
|
|
|
check_c_compiler_flag(-fsanitize=fuzzer C__fsanitize_fuzzer_no_link_VALID)
|
|
|
|
check_cxx_compiler_flag(-fsanitize=fuzzer CXX__fsanitize_fuzzer_no_link_VALID)
|
|
|
|
cmake_pop_check_state()
|
|
|
|
if(NOT C__fsanitize_fuzzer_no_link_VALID OR NOT CXX__fsanitize_fuzzer_no_link_VALID)
|
|
|
|
message(FATAL_ERROR "ENABLE_FUZZER was requested, but not supported!")
|
|
|
|
endif()
|
|
|
|
set(CMAKE_C_FLAGS "-fsanitize=fuzzer-no-link ${CMAKE_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "-fsanitize=fuzzer-no-link ${CMAKE_CXX_FLAGS}")
|
|
|
|
endif()
|
|
|
|
|
2016-09-30 14:06:15 +00:00
|
|
|
set(WERROR_COMMON_FLAGS "")
|
CMake: Add /WX
Add "/WX" to the Visual C++ compiler flags if DISABLE_WERROR is off,
similar to config.nmake.
We haven't compiled C++ code with -Wshorten-64-to-32 for quite
some time so there's no need to add -Wno-shorten-64-to-32 in
ui/qt/CMakeLists.txt.
Additionally, squelch
----
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3050) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3065) : see reference to function template instantiation 'void std::_Median<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3127) : see reference to function template instantiation 'std::pair<_RanIt,_RanIt> std::_Unguarded_partition<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3157) : see reference to function template instantiation 'void std::_Sort<_Iter,int,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Diff,_Pr)' being compiled
with
[
_Iter=QList<QString>::iterator
, _RanIt=QList<QString>::iterator
, _Diff=int
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
.\rpc_service_response_time_dialog.cpp(130) : see reference to function template instantiation 'void std::sort<QList<QString>::iterator,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3051) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3052) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3053) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
----
in both rpc_service_response_time_dialog.cpp and wireshark_application.cpp
so that we'll compile successfully.
Change-Id: I457bcede99dcb1f3c1001f1f559c4901bb000357
Reviewed-on: https://code.wireshark.org/review/10533
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-15 00:19:02 +00:00
|
|
|
if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|
|
|
set(WERROR_COMMON_FLAGS "/WX")
|
|
|
|
else()
|
Don't use -Werror with Apple's llvm-gcc.
Its handling of warnings, and of warnings-treated-as-errors, is horribly
broken; once you've asked for a warning, and have specified -Werror,
there appears to be nothing whatsoever that you can do to keep that
warning from being an error *everywhere* in the code.
Prior to change Ib591a1d6beaa13337d927a446b4d8d5e687ff610, the tests for
warnings were all failing on the macOS buildbot, so *no* warnings were
being requested.
With this change, a warning won't be reported as an error, but at least
it'll be reported.
(We should probably switch to using Clang on the macOS buildbot at some
point; I don't know whether the version of Clang currently on the
buildbot is safe to use, but if we ever run a newer version of Xcode,
which doesn't come with llvm-gcc - which may involve running a newer
version of macOS on the buildbot as well - it's presumably safe, given
that it's the only compiler Apple shipped.)
Change-Id: I677967cb87b91f68f08de546e59abff1dbd6788b
Reviewed-on: https://code.wireshark.org/review/29623
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-12 04:02:56 +00:00
|
|
|
#
|
|
|
|
# If a warning has been enabled by -Wall or -W,
|
|
|
|
# and have specified -Werror, there appears to be
|
|
|
|
# no way, in Apple's llvm-gcc, to prevent that
|
|
|
|
# particular warning from giving an error - not
|
|
|
|
# with a pragma, not with -Wno-{warning}, and not
|
|
|
|
# with -Wno-error={warning}.
|
|
|
|
#
|
|
|
|
# Therefore, with that compiler, we just disable
|
|
|
|
# -Werror.
|
|
|
|
#
|
|
|
|
if ((NOT APPLE) OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
check_c_compiler_flag(-Werror WERROR)
|
|
|
|
if (WERROR)
|
|
|
|
set(WERROR_COMMON_FLAGS "-Werror")
|
|
|
|
endif()
|
CMake: Add /WX
Add "/WX" to the Visual C++ compiler flags if DISABLE_WERROR is off,
similar to config.nmake.
We haven't compiled C++ code with -Wshorten-64-to-32 for quite
some time so there's no need to add -Wno-shorten-64-to-32 in
ui/qt/CMakeLists.txt.
Additionally, squelch
----
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3050) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3065) : see reference to function template instantiation 'void std::_Median<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3127) : see reference to function template instantiation 'std::pair<_RanIt,_RanIt> std::_Unguarded_partition<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3157) : see reference to function template instantiation 'void std::_Sort<_Iter,int,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Diff,_Pr)' being compiled
with
[
_Iter=QList<QString>::iterator
, _RanIt=QList<QString>::iterator
, _Diff=int
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
.\rpc_service_response_time_dialog.cpp(130) : see reference to function template instantiation 'void std::sort<QList<QString>::iterator,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3051) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3052) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3053) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
----
in both rpc_service_response_time_dialog.cpp and wireshark_application.cpp
so that we'll compile successfully.
Change-Id: I457bcede99dcb1f3c1001f1f559c4901bb000357
Reviewed-on: https://code.wireshark.org/review/10533
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-15 00:19:02 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2015-01-21 09:00:43 +00:00
|
|
|
#
|
|
|
|
# Try to have the compiler default to hiding symbols, so that only
|
|
|
|
# symbols explicitly exported with WS_DLL_PUBLIC will be visible
|
|
|
|
# outside (shared) libraries; that way, more UN*X builds will catch
|
|
|
|
# failures to export symbols, rather than having that fail only on
|
|
|
|
# Windows.
|
|
|
|
#
|
|
|
|
# We don't need that with MSVC, as that's the default.
|
|
|
|
#
|
|
|
|
if( NOT CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|
|
|
#
|
2015-12-23 03:49:01 +00:00
|
|
|
# Try the GCC-and-compatible -fvisibility-hidden first.
|
2015-01-21 09:00:43 +00:00
|
|
|
#
|
|
|
|
check_c_compiler_flag(-fvisibility=hidden FVHIDDEN)
|
|
|
|
if(FVHIDDEN)
|
2017-09-24 01:30:08 +00:00
|
|
|
set(CMAKE_C_FLAGS "-fvisibility=hidden ${CMAKE_C_FLAGS}")
|
2015-01-21 09:00:43 +00:00
|
|
|
else()
|
|
|
|
#
|
|
|
|
# OK, try the Sun^WOracle C -xldscope=hidden
|
|
|
|
#
|
|
|
|
check_c_compiler_flag(-xldscope=hidden XLDSCOPEHIDDEN)
|
|
|
|
if(XLDSCOPEHIDDEN)
|
2017-09-24 01:30:08 +00:00
|
|
|
set(CMAKE_C_FLAGS "-xldscope=hidden ${CMAKE_C_FLAGS}")
|
2015-01-21 09:00:43 +00:00
|
|
|
else()
|
|
|
|
#
|
|
|
|
# Anything else?
|
|
|
|
# If there is anything else, we might want to
|
|
|
|
# make a list of options to try, and try them
|
|
|
|
# in a loop.
|
|
|
|
#
|
|
|
|
message(WARNING "Hiding shared library symbols is not supported by the compiler."
|
|
|
|
" All shared library symbols will be exported.")
|
|
|
|
endif()
|
2014-06-16 19:12:30 +00:00
|
|
|
endif()
|
2013-02-28 14:09:46 +00:00
|
|
|
endif()
|
|
|
|
|
2010-03-18 10:27:17 +00:00
|
|
|
include(CheckCLinkerFlag)
|
2018-09-09 22:11:15 +00:00
|
|
|
|
2018-10-30 13:31:39 +00:00
|
|
|
if(NOT CMAKE_C_COMPILER_ID MATCHES "MSVC" AND NOT OSS_FUZZ)
|
2018-10-17 20:47:34 +00:00
|
|
|
#
|
|
|
|
# The -pie linker option produces a position-independent executable.
|
|
|
|
# Some Linux distributions have this enabled by default in the compiler,
|
|
|
|
# so setting it here will be superfluous though.
|
|
|
|
#
|
|
|
|
# Note that linking with static libraries that are not position
|
|
|
|
# independent may fail, the user can set CMAKE_EXE_LINKER_FLAGS=-no-pie
|
|
|
|
# as a workaround.
|
|
|
|
#
|
2019-09-15 12:33:40 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS "3.14")
|
2019-01-17 18:34:37 +00:00
|
|
|
check_c_linker_flag(-pie LINK_pie_VALID)
|
|
|
|
if(LINK_pie_VALID)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "-pie ${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
endif()
|
2019-09-15 12:33:40 +00:00
|
|
|
else()
|
|
|
|
include(CheckPIESupported)
|
|
|
|
check_pie_supported()
|
2018-10-17 20:47:34 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2010-03-18 10:27:17 +00:00
|
|
|
foreach(THIS_FLAG ${WIRESHARK_LD_FLAGS})
|
2018-09-09 22:11:15 +00:00
|
|
|
string(MAKE_C_IDENTIFIER "LINK${THIS_FLAG}_VALID" _flag_var)
|
|
|
|
check_c_linker_flag(${THIS_FLAG} ${_flag_var})
|
|
|
|
if (${_flag_var})
|
|
|
|
set(WS_LINK_FLAGS "${WS_LINK_FLAGS} ${THIS_FLAG}")
|
2010-03-18 10:27:17 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2018-09-09 22:11:15 +00:00
|
|
|
message(STATUS "Linker flags: ${WS_LINK_FLAGS}")
|
2009-11-07 10:08:36 +00:00
|
|
|
|
2013-09-10 21:24:52 +00:00
|
|
|
if(APPLE AND EXISTS /usr/local/opt/gettext)
|
2017-04-05 19:15:27 +00:00
|
|
|
# GLib on macOS requires libintl. Homebrew installs gettext (and
|
2013-09-10 21:24:52 +00:00
|
|
|
# libintl) in /usr/local/opt/gettext
|
|
|
|
include_directories(/usr/local/opt/gettext/include)
|
|
|
|
link_directories(/usr/local/opt/gettext/lib)
|
|
|
|
endif()
|
|
|
|
|
2019-02-10 19:14:58 +00:00
|
|
|
# Resets cache variables if the <PackageName>_LIBRARY has become invalid.
|
|
|
|
# Call it before a find_package(<PackageName> ...) invocation that uses
|
|
|
|
# find_library(<PackageName>_LIBRARY ...).
|
|
|
|
#
|
|
|
|
# Usage: reset_find_package(<PackageName> [<extra variables to clear>])
|
|
|
|
function(reset_find_package _package_name)
|
|
|
|
set(variables
|
|
|
|
# find_library / find_package
|
|
|
|
${_package_name}_LIBRARY
|
|
|
|
${_package_name}_INCLUDE_DIR
|
|
|
|
# mark_as_advanced
|
|
|
|
${_package_name}_LIBRARIES
|
|
|
|
${_package_name}_INCLUDE_DIRS
|
|
|
|
# Others
|
|
|
|
${_package_name}_DLL_DIR
|
|
|
|
${_package_name}_DLLS
|
|
|
|
${_package_name}_DLL
|
|
|
|
${_package_name}_PDB
|
|
|
|
${ARGN}
|
|
|
|
)
|
|
|
|
if(NOT ${_package_name}_LIBRARY OR EXISTS ${${_package_name}_LIBRARY})
|
|
|
|
# Cache variable is already missing or cache entry is valid.
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
message(STATUS "Package ${_package_name} has changed, clearing cache.")
|
|
|
|
foreach(_var IN LISTS variables)
|
|
|
|
unset(${_var} CACHE)
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
# ws_find_package(<PackageName>
|
|
|
|
# <CMakeOptions.txt boolean variable>
|
|
|
|
# <cmakeconfig.h.in macro definition>
|
|
|
|
# [remaining find_package() arguments])
|
|
|
|
macro(ws_find_package _package_name _enable_package _package_cmakedefine)
|
|
|
|
if(${_enable_package})
|
2019-02-10 19:14:58 +00:00
|
|
|
# Clear outdated cache variables if not already.
|
|
|
|
reset_find_package(${_package_name})
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(${_package_name} ${ARGN})
|
|
|
|
if(${_package_name}_FOUND)
|
|
|
|
set(${_package_cmakedefine} 1)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endmacro()
|
2010-05-24 21:59:29 +00:00
|
|
|
|
2017-08-25 17:20:59 +00:00
|
|
|
# The minimum package list
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(Git)
|
2019-02-10 19:14:58 +00:00
|
|
|
reset_find_package(GLIB2 GLIB2_MAIN_INCLUDE_DIR GLIB2_INTERNAL_INCLUDE_DIR)
|
2019-04-19 10:50:08 +00:00
|
|
|
find_package(GLIB2 "2.32.0" REQUIRED)
|
2019-01-10 01:45:00 +00:00
|
|
|
include_directories(SYSTEM ${GLIB2_INCLUDE_DIRS})
|
2019-02-10 19:14:58 +00:00
|
|
|
reset_find_package(GMODULE2)
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(GMODULE2)
|
2019-02-10 19:14:58 +00:00
|
|
|
reset_find_package(GTHREAD2)
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(GTHREAD2 REQUIRED)
|
2019-02-10 19:14:58 +00:00
|
|
|
reset_find_package(GCRYPT GCRYPT_ERROR_LIBRARY)
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(GCRYPT "1.4.2" REQUIRED)
|
2019-11-22 19:16:36 +00:00
|
|
|
# C Asynchronous resolver
|
|
|
|
reset_find_package(CARES)
|
|
|
|
find_package(CARES "1.5.0" REQUIRED)
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(LEX REQUIRED)
|
|
|
|
find_package(YACC REQUIRED)
|
|
|
|
find_package(Perl REQUIRED)
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2019-01-09 18:34:57 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS "3.12")
|
|
|
|
# Locate the Python interpreter. Finds the wrong (Python 2) version if:
|
|
|
|
# - PATH contains python3.6, but not python3 (3.4). Affects RHEL7+EPEL.
|
|
|
|
# - Path contains C:\Python27 but not C:\Python37 (which is installed,
|
|
|
|
# but not present in PATH).
|
|
|
|
find_package(PythonInterp 3.4 REQUIRED)
|
|
|
|
else()
|
|
|
|
find_package(Python3 3.4 REQUIRED)
|
|
|
|
# Several files (including LocatePythonModule) still use the old name
|
|
|
|
# from FindPythonInterp, let's stick to it for now.
|
|
|
|
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
|
|
|
endif()
|
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
if (NOT WIN32)
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(Gettext)
|
|
|
|
find_package(M REQUIRED)
|
2011-08-30 11:44:21 +00:00
|
|
|
endif()
|
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
if(BUILD_sshdump OR BUILD_ciscodump)
|
|
|
|
set(ENABLE_LIBSSH ON)
|
|
|
|
else()
|
|
|
|
set(ENABLE_LIBSSH OFF)
|
2013-10-10 20:35:32 +00:00
|
|
|
endif()
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(LIBSSH ENABLE_LIBSSH HAVE_LIBSSH "0.6")
|
2013-10-10 20:35:32 +00:00
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(PCAP ENABLE_PCAP HAVE_LIBPCAP)
|
|
|
|
ws_find_package(AIRPCAP ENABLE_AIRPCAP HAVE_AIRPCAP)
|
|
|
|
ws_find_package(Systemd BUILD_sdjournal HAVE_SYSTEMD)
|
2018-09-05 23:29:34 +00:00
|
|
|
|
2012-02-02 00:46:02 +00:00
|
|
|
# Build the Qt GUI?
|
2014-08-28 23:48:53 +00:00
|
|
|
if(BUILD_wireshark)
|
2018-04-07 10:58:17 +00:00
|
|
|
# Untested, may not work if CMAKE_PREFIX_PATH gets overwritten
|
|
|
|
# somewhere. The if WIN32 in this place is annoying as well.
|
2019-01-10 01:45:00 +00:00
|
|
|
if(WIN32)
|
|
|
|
set(QT5_BASE_PATH "$ENV{QT5_BASE_DIR}")
|
|
|
|
set(CMAKE_PREFIX_PATH "${QT5_BASE_PATH}")
|
|
|
|
endif()
|
|
|
|
if(APPLE AND EXISTS /usr/local/opt/qt5)
|
|
|
|
# Homebrew installs Qt5 (up to at least 5.11.0) in
|
|
|
|
# /usr/local/qt5. Ensure that it can be found by CMake
|
|
|
|
# since it is not in the default /usr/local prefix.
|
|
|
|
# Add it to PATHS so that it doesn't override the
|
|
|
|
# CMAKE_PREFIX_PATH environment variable.
|
|
|
|
# QT_FIND_PACKAGE_OPTIONS should be passed to find_package,
|
|
|
|
# e.g. find_package(Qt5Core ${QT_FIND_PACKAGE_OPTIONS})
|
|
|
|
list(APPEND QT_FIND_PACKAGE_OPTIONS PATHS /usr/local/opt/qt5)
|
2018-04-07 10:58:17 +00:00
|
|
|
endif()
|
2019-01-10 01:45:00 +00:00
|
|
|
set(QT_PACKAGELIST
|
2018-04-07 10:58:17 +00:00
|
|
|
Qt5Core
|
|
|
|
Qt5LinguistTools
|
|
|
|
Qt5Multimedia
|
|
|
|
Qt5PrintSupport
|
|
|
|
Qt5Widgets
|
|
|
|
)
|
2019-01-10 01:45:00 +00:00
|
|
|
if(APPLE)
|
|
|
|
list(APPEND QT_PACKAGELIST Qt5MacExtras)
|
2019-11-14 16:08:28 +00:00
|
|
|
ws_find_package(Sparkle ENABLE_SPARKLE HAVE_SOFTWARE_UPDATE)
|
2019-01-10 01:45:00 +00:00
|
|
|
endif()
|
|
|
|
if(WIN32)
|
|
|
|
list(APPEND QT_PACKAGELIST Qt5WinExtras)
|
2018-04-07 10:58:17 +00:00
|
|
|
endif()
|
2019-01-10 01:45:00 +00:00
|
|
|
foreach(_qt_package IN LISTS QT_PACKAGELIST)
|
|
|
|
find_package(${_qt_package} REQUIRED ${QT_FIND_PACKAGE_OPTIONS})
|
|
|
|
list(APPEND QT_LIBRARIES ${${_qt_package}_LIBRARIES})
|
|
|
|
list(APPEND QT_INCLUDE_DIRS ${${_qt_package}_INCLUDE_DIRS})
|
|
|
|
list(APPEND QT_COMPILE_DEFINITIONS ${${_qt_package}_COMPILE_DEFINITIONS})
|
|
|
|
endforeach()
|
|
|
|
set(QT_FOUND ON)
|
|
|
|
if(Qt5MacExtras_FOUND)
|
|
|
|
set(QT_MACEXTRAS_LIB 1)
|
2013-04-25 23:04:19 +00:00
|
|
|
endif()
|
2012-02-02 00:46:02 +00:00
|
|
|
endif()
|
|
|
|
|
2018-02-09 01:20:26 +00:00
|
|
|
# MaxMind DB address resolution
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(MaxMindDB BUILD_mmdbresolve HAVE_MAXMINDDB)
|
2018-02-09 01:20:26 +00:00
|
|
|
|
2009-09-09 13:20:33 +00:00
|
|
|
# SMI SNMP
|
2019-02-10 19:14:58 +00:00
|
|
|
reset_find_package(SMI SMI_SHARE_DIR)
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(SMI ENABLE_SMI HAVE_LIBSMI)
|
2009-09-09 13:20:33 +00:00
|
|
|
|
2018-12-12 13:34:00 +00:00
|
|
|
# Support for TLS decryption using RSA private keys.
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(GNUTLS ENABLE_GNUTLS HAVE_LIBGNUTLS "3.2.0")
|
2009-09-09 13:20:33 +00:00
|
|
|
|
2009-09-10 07:04:54 +00:00
|
|
|
# Kerberos
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(KERBEROS ENABLE_KERBEROS HAVE_KERBEROS)
|
2009-09-10 07:04:54 +00:00
|
|
|
|
2009-09-09 13:20:33 +00:00
|
|
|
# Zlib compression
|
2019-01-04 23:37:46 +00:00
|
|
|
ws_find_package(ZLIB ENABLE_ZLIB HAVE_ZLIB)
|
2009-09-09 13:20:33 +00:00
|
|
|
|
2019-07-10 22:25:45 +00:00
|
|
|
# Minizip compression
|
|
|
|
ws_find_package(Minizip ENABLE_MINIZIP HAVE_MINIZIP)
|
|
|
|
|
2019-04-10 10:52:52 +00:00
|
|
|
# Brotli compression
|
|
|
|
ws_find_package(BROTLI ENABLE_BROTLI HAVE_BROTLI)
|
|
|
|
|
2016-09-26 14:25:11 +00:00
|
|
|
# LZ4 compression
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(LZ4 ENABLE_LZ4 HAVE_LZ4)
|
2016-09-26 14:25:11 +00:00
|
|
|
|
|
|
|
# Snappy compression
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(SNAPPY ENABLE_SNAPPY HAVE_SNAPPY)
|
2016-09-26 14:25:11 +00:00
|
|
|
|
2019-08-12 21:57:45 +00:00
|
|
|
# zstd compression
|
2019-08-27 13:49:13 +00:00
|
|
|
ws_find_package(ZSTD ENABLE_ZSTD HAVE_ZSTD "1.0.0")
|
2019-08-12 21:57:45 +00:00
|
|
|
|
2017-08-27 21:07:55 +00:00
|
|
|
# Enhanced HTTP/2 dissection
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(NGHTTP2 ENABLE_NGHTTP2 HAVE_NGHTTP2)
|
2017-08-27 21:07:55 +00:00
|
|
|
|
2014-07-31 21:00:33 +00:00
|
|
|
# Embedded Lua interpreter
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(LUA ENABLE_LUA HAVE_LUA "5.1")
|
2009-09-09 13:20:33 +00:00
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(NL ENABLE_NETLINK HAVE_LIBNL)
|
2012-06-20 20:59:43 +00:00
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(SBC ENABLE_SBC HAVE_SBC)
|
2014-02-16 10:12:35 +00:00
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(SPANDSP ENABLE_SPANDSP HAVE_SPANDSP)
|
2016-11-23 23:27:14 +00:00
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(BCG729 ENABLE_BCG729 HAVE_BCG729)
|
2017-07-26 21:23:12 +00:00
|
|
|
|
2019-11-18 22:55:25 +00:00
|
|
|
ws_find_package(ILBC ENABLE_ILBC HAVE_ILBC)
|
|
|
|
|
2019-02-10 19:14:58 +00:00
|
|
|
# CMake 3.9 and below used 'LIBXML2_LIBRARIES' as the name of the cache entry
|
|
|
|
# storing the find_library result. Transfer it to the new cache variable such
|
|
|
|
# that reset_find_package can detect and clear outdated cache variables.
|
|
|
|
if(DEFINED LIBXML2_LIBRARIES AND NOT DEFINED LIBXML2_LIBRARY)
|
|
|
|
set(LIBXML2_LIBRARY ${LIBXML2_LIBRARIES} CACHE FILEPATH "")
|
|
|
|
endif()
|
|
|
|
# Call reset_find_package explicitly since variables are in upper case.
|
|
|
|
reset_find_package(LIBXML2)
|
2019-01-10 01:45:00 +00:00
|
|
|
ws_find_package(LibXml2 ENABLE_LIBXML2 HAVE_LIBXML2)
|
2019-02-05 12:21:51 +00:00
|
|
|
if(NOT LIBXML2_FOUND)
|
|
|
|
# CMake 3.9 and below used LIBXML2_LIBRARIES as the name of
|
|
|
|
# the cache entry storing the find_library result.
|
|
|
|
# Current CMake (3.13) and below sets LIBXML2_LIBRARIES and LIBXML2_INCLUDE_DIRS
|
|
|
|
# to a non-empty value, be sure to clear it when not found.
|
|
|
|
set(LIBXML2_LIBRARIES "")
|
|
|
|
set(LIBXML2_INCLUDE_DIRS "")
|
|
|
|
endif()
|
2017-04-04 21:23:59 +00:00
|
|
|
|
2020-01-29 22:29:05 +00:00
|
|
|
# Capabilities to run dumpcap as non-root user.
|
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
ws_find_package(CAP ENABLE_CAP HAVE_LIBCAP)
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(SETCAP)
|
2009-09-10 07:04:54 +00:00
|
|
|
endif()
|
|
|
|
|
2019-07-10 22:25:45 +00:00
|
|
|
# Include minizip include directories
|
|
|
|
if(MINIZIP_FOUND)
|
|
|
|
include_directories(
|
|
|
|
${MINIZIP_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(MINIZIP_LIBRARY "")
|
|
|
|
endif()
|
|
|
|
|
2014-08-20 21:29:33 +00:00
|
|
|
# Windows version updates
|
2019-12-19 14:10:23 +00:00
|
|
|
ws_find_package(WinSparkle ENABLE_WINSPARKLE HAVE_SOFTWARE_UPDATE)
|
2009-09-12 17:20:08 +00:00
|
|
|
|
2018-12-12 00:26:51 +00:00
|
|
|
find_package( Asciidoctor 1.5 )
|
|
|
|
|
2019-04-02 16:13:01 +00:00
|
|
|
find_package(POD REQUIRED)
|
2013-12-22 01:21:56 +00:00
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
find_package(DOXYGEN)
|
2006-09-06 22:28:19 +00:00
|
|
|
|
2019-02-02 14:52:07 +00:00
|
|
|
# The SpeexDSP resampler is required iff building wireshark or sharkd.
|
|
|
|
if(BUILD_wireshark OR BUILD_sharkd)
|
|
|
|
find_package(SpeexDSP)
|
|
|
|
if(SpeexDSP_FOUND)
|
|
|
|
set(HAVE_SPEEXDSP 1)
|
|
|
|
else()
|
|
|
|
add_subdirectory(speexdsp)
|
|
|
|
set(SPEEXDSP_INCLUDE_DIRS "")
|
|
|
|
set(SPEEXDSP_LIBRARIES "speexresampler")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-06-19 14:37:29 +00:00
|
|
|
# dist target that prepares source dir
|
2018-04-16 18:39:27 +00:00
|
|
|
# XXX Duplicated in the RPM section below.
|
2017-06-19 14:37:29 +00:00
|
|
|
add_custom_target(dist
|
2019-01-11 22:34:03 +00:00
|
|
|
COMMAND ${CMAKE_BINARY_DIR}/packaging/source/git-export-release.sh -d "${CMAKE_BINARY_DIR}"
|
2018-04-16 18:39:27 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
2017-06-19 14:37:29 +00:00
|
|
|
)
|
|
|
|
|
2018-12-12 13:34:00 +00:00
|
|
|
if(GNUTLS_FOUND AND NOT GNUTLS_VERSION VERSION_LESS "3.4.0")
|
|
|
|
# While all Linux and Windows builds have PKCS #11 support enabled,
|
|
|
|
# macos-setup.sh explicitly disables it using --without-p11-kit.
|
|
|
|
#
|
|
|
|
# Require at least GnuTLS 3.4.0 such that public keys can be calculated
|
|
|
|
# from PKCS #11 private keys.
|
|
|
|
include(CheckSymbolExists)
|
|
|
|
cmake_push_check_state()
|
|
|
|
if(WIN32)
|
|
|
|
set(CMAKE_REQUIRED_DEFINITIONS -Dssize_t=int)
|
|
|
|
endif()
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${GNUTLS_INCLUDE_DIRS})
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${GNUTLS_LIBRARIES})
|
|
|
|
check_symbol_exists(gnutls_pkcs11_obj_list_import_url4 gnutls/pkcs11.h HAVE_GNUTLS_PKCS11)
|
|
|
|
cmake_pop_check_state()
|
|
|
|
endif()
|
2018-12-14 19:30:39 +00:00
|
|
|
|
2019-01-10 01:45:00 +00:00
|
|
|
if (QT_FOUND)
|
2019-12-10 00:38:33 +00:00
|
|
|
if (Qt5Widgets_VERSION VERSION_LESS 5.3)
|
|
|
|
message(FATAL_ERROR "Qt 5.3 or later is required.")
|
2018-05-10 15:53:42 +00:00
|
|
|
endif()
|
2016-06-25 16:44:28 +00:00
|
|
|
if (Qt5Widgets_VERSION VERSION_GREATER 5.6
|
|
|
|
AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
2018-05-10 12:54:31 +00:00
|
|
|
# Qt 5.7 and later require C++ 11.
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2016-06-25 16:44:28 +00:00
|
|
|
endif()
|
2016-02-02 19:00:37 +00:00
|
|
|
if(NOT DEFINED MOC_OPTIONS)
|
2016-03-28 08:07:12 +00:00
|
|
|
# Squelch moc verbose "nothing to do" output
|
|
|
|
set(MOC_OPTIONS -nn)
|
2016-02-02 19:00:37 +00:00
|
|
|
endif()
|
2018-06-20 22:59:41 +00:00
|
|
|
|
|
|
|
# CMake uses qmake to find Qt4. It relies on Qt's CMake modules
|
|
|
|
# to find Qt5. This means that we can't assume that the qmake
|
|
|
|
# in our PATH is the correct one. We can fetch qmake's location
|
|
|
|
# from Qt5::qmake, which is is defined in Qt5CoreConfigExtras.cmake.
|
|
|
|
get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
|
|
|
|
get_filename_component(_qt_bin_path "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
|
|
|
|
set(QT_BIN_PATH "${_qt_bin_path}" CACHE INTERNAL
|
|
|
|
"Path to qmake, macdeployqt, windeployqt, and other Qt utilities."
|
|
|
|
)
|
|
|
|
# Use qmake to find windeployqt and macdeployqt. Ideally one of
|
|
|
|
# the modules in ${QTDIR}/lib/cmake would do this for us.
|
|
|
|
if(WIN32)
|
|
|
|
find_program(QT_WINDEPLOYQT_EXECUTABLE windeployqt
|
|
|
|
HINTS "${QT_BIN_PATH}"
|
|
|
|
DOC "Path to the windeployqt utility."
|
|
|
|
)
|
2019-02-06 22:11:07 +00:00
|
|
|
if(Qt5Widgets_VERSION VERSION_GREATER "5.5.999")
|
|
|
|
set(QT_WINDEPLOYQT_EXTRA_OPTS --pdb)
|
|
|
|
endif()
|
|
|
|
|
2018-06-20 22:59:41 +00:00
|
|
|
elseif(APPLE)
|
|
|
|
find_program(QT_MACDEPLOYQT_EXECUTABLE macdeployqt
|
|
|
|
HINTS "${QT_BIN_PATH}"
|
|
|
|
DOC "Path to the macdeployqt utility."
|
|
|
|
)
|
2019-09-25 20:17:31 +00:00
|
|
|
find_program(DMGBUILD_EXECUTABLE dmgbuild
|
|
|
|
DOC "Path to the dmgbuild utility"
|
|
|
|
)
|
2020-05-27 22:00:46 +00:00
|
|
|
# https://doc.qt.io/qt-5/supported-platforms.html
|
2018-12-14 19:30:39 +00:00
|
|
|
# https://doc.qt.io/qt-5.11/supported-platforms-and-configurations.html
|
2018-12-16 02:19:16 +00:00
|
|
|
# CMake < 3.7 doesn't support VERSION_GREATER_EQUAL.
|
2020-05-27 22:00:46 +00:00
|
|
|
if(Qt5Widgets_VERSION VERSION_GREATER "5.14.999")
|
|
|
|
set(MIN_MACOS_VERSION 10.13)
|
|
|
|
elseif(Qt5Widgets_VERSION VERSION_GREATER "5.11.999")
|
2018-12-14 19:30:39 +00:00
|
|
|
set(MIN_MACOS_VERSION 10.12)
|
2018-12-16 02:19:16 +00:00
|
|
|
elseif(Qt5Widgets_VERSION VERSION_GREATER "5.9.999")
|
2018-12-14 19:30:39 +00:00
|
|
|
set(MIN_MACOS_VERSION 10.11)
|
2018-12-16 02:19:16 +00:00
|
|
|
elseif(Qt5Widgets_VERSION VERSION_GREATER "5.8.999")
|
2018-12-14 19:30:39 +00:00
|
|
|
set(MIN_MACOS_VERSION 10.10)
|
2018-12-16 17:11:56 +00:00
|
|
|
elseif(Qt5Widgets_VERSION VERSION_GREATER "5.7.999")
|
2018-12-14 19:30:39 +00:00
|
|
|
set(MIN_MACOS_VERSION 10.9)
|
2018-12-16 17:11:56 +00:00
|
|
|
elseif(Qt5Widgets_VERSION VERSION_GREATER "5.4.999")
|
2018-12-14 19:30:39 +00:00
|
|
|
set(MIN_MACOS_VERSION 10.8)
|
|
|
|
endif()
|
|
|
|
if(CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS MIN_MACOS_VERSION)
|
|
|
|
message(FATAL_ERROR "Qt version ${Qt5Widgets_VERSION} requires CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) >= ${MIN_MACOS_VERSION}")
|
|
|
|
endif()
|
2018-06-20 22:59:41 +00:00
|
|
|
endif()
|
|
|
|
|
2012-02-02 12:04:22 +00:00
|
|
|
endif()
|
2014-08-02 20:53:44 +00:00
|
|
|
|
2016-02-01 20:33:33 +00:00
|
|
|
if(ENABLE_CHECKHF_CONFLICT)
|
|
|
|
set(ENABLE_CHECK_FILTER 1)
|
|
|
|
endif()
|
|
|
|
|
2018-10-08 03:38:51 +00:00
|
|
|
#
|
|
|
|
# Platform-specific additional libraries.
|
|
|
|
#
|
|
|
|
if(WIN32)
|
|
|
|
set(WIN_PSAPI_LIBRARY psapi.lib)
|
2019-04-30 22:48:06 +00:00
|
|
|
set(WIN_WS2_32_LIBRARY ws2_32.lib)
|
2018-10-08 03:38:51 +00:00
|
|
|
set(WIN_COMCTL32_LIBRARY comctl32.lib )
|
|
|
|
set(WIN_VERSION_LIBRARY version.lib)
|
|
|
|
endif()
|
|
|
|
|
2014-11-10 20:24:18 +00:00
|
|
|
if(APPLE)
|
|
|
|
#
|
2017-04-05 19:15:27 +00:00
|
|
|
# We assume that APPLE means macOS so that we have the macOS
|
2014-11-10 20:24:18 +00:00
|
|
|
# frameworks.
|
|
|
|
#
|
2017-06-16 08:49:44 +00:00
|
|
|
set(HAVE_MACOS_FRAMEWORKS 1)
|
2014-11-10 20:24:18 +00:00
|
|
|
FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices)
|
2018-04-09 09:39:49 +00:00
|
|
|
FIND_LIBRARY (APPLE_APPKIT_LIBRARY AppKit)
|
2014-11-10 20:24:18 +00:00
|
|
|
FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation)
|
|
|
|
FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration)
|
|
|
|
endif()
|
|
|
|
|
2009-08-27 15:32:57 +00:00
|
|
|
include(ConfigureChecks.cmake)
|
2006-10-24 17:39:32 +00:00
|
|
|
|
2016-11-08 19:11:14 +00:00
|
|
|
# Global properties
|
2013-12-01 21:55:21 +00:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
2013-10-13 09:21:55 +00:00
|
|
|
|
2016-11-08 19:11:14 +00:00
|
|
|
if(ENABLE_CCACHE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
2019-07-27 07:54:44 +00:00
|
|
|
# https://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmake/24305849#24305849
|
2016-11-08 19:11:14 +00:00
|
|
|
find_program(CCACHE_EXECUTABLE ccache)
|
|
|
|
if(CCACHE_EXECUTABLE)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_EXECUTABLE}")
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_EXECUTABLE}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-03-11 19:51:39 +00:00
|
|
|
# The top level checkAPIs target, add before subdirectory calls so it's avaiable to all
|
|
|
|
add_custom_target(checkAPI)
|
|
|
|
set_target_properties(checkAPI
|
|
|
|
PROPERTIES
|
|
|
|
FOLDER "Auxiliary"
|
|
|
|
EXCLUDE_FROM_ALL True
|
|
|
|
EXCLUDE_FROM_DEFAULT_BUILD True
|
|
|
|
)
|
|
|
|
|
2018-04-21 11:35:08 +00:00
|
|
|
include( UseCheckAPI )
|
|
|
|
|
2018-05-24 13:08:48 +00:00
|
|
|
# Target platform locations
|
|
|
|
# UN*X in general, including macOS if not building an app bundle:
|
|
|
|
# $DESTDIR/lib/wireshark/extcap
|
|
|
|
# Windows: $DESTDIR/extcap
|
|
|
|
# macOS app bundle: Wireshark.app/Contents/Resources/share/wireshark/extcap
|
2018-12-03 05:32:17 +00:00
|
|
|
# If you change the nesting level be sure to check also the INSTALL_RPATH
|
|
|
|
# target property.
|
2018-05-24 13:08:48 +00:00
|
|
|
if (WIN32)
|
2018-08-21 21:23:46 +00:00
|
|
|
set(EXTCAP_INSTALL_LIBDIR "extcap" CACHE INTERNAL "The extcap dir")
|
2018-05-24 13:08:48 +00:00
|
|
|
else ()
|
2019-02-01 16:25:24 +00:00
|
|
|
set(EXTCAP_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/extcap" CACHE INTERNAL "The extcap dir")
|
2018-05-24 13:08:48 +00:00
|
|
|
endif()
|
|
|
|
|
2019-02-14 00:12:24 +00:00
|
|
|
if(APPLE)
|
|
|
|
#
|
|
|
|
# As https://developer.apple.com/library/archive/technotes/tn2206/_index.html
|
|
|
|
# says,
|
|
|
|
#
|
|
|
|
# "Note that a location where code is expected to reside cannot generally
|
|
|
|
# contain directories full of nested code, because those directories tend
|
|
|
|
# to be interpreted as bundles. So this occasional practice is not
|
|
|
|
# recommended and not officially supported. If you do do this, do not use
|
|
|
|
# periods in the directory names. The code signing machinery interprets
|
|
|
|
# directories with periods in their names as code bundles and will reject
|
|
|
|
# them if they don't conform to the expected code bundle layout."
|
|
|
|
#
|
|
|
|
set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}-${PROJECT_MINOR_VERSION}")
|
|
|
|
else()
|
|
|
|
set(PLUGIN_PATH_ID "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}")
|
|
|
|
endif()
|
|
|
|
|
2018-08-21 21:23:46 +00:00
|
|
|
# Directory where plugins and Lua dissectors can be found.
|
|
|
|
if(WIN32)
|
|
|
|
set(PLUGIN_INSTALL_LIBDIR "plugins" CACHE INTERNAL "The plugin dir")
|
|
|
|
else()
|
2019-02-01 16:25:24 +00:00
|
|
|
set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/plugins" CACHE INTERNAL "The plugin dir")
|
2018-08-21 21:23:46 +00:00
|
|
|
endif()
|
2019-02-13 19:08:19 +00:00
|
|
|
set(PLUGIN_INSTALL_VERSION_LIBDIR "${PLUGIN_INSTALL_LIBDIR}/${PLUGIN_PATH_ID}")
|
|
|
|
set(PLUGIN_VERSION_DIR "plugins/${PLUGIN_PATH_ID}")
|
2018-08-21 21:23:46 +00:00
|
|
|
|
2014-06-23 23:48:41 +00:00
|
|
|
add_subdirectory( capchild )
|
2014-07-04 07:24:02 +00:00
|
|
|
add_subdirectory( caputils )
|
2016-02-29 14:48:57 +00:00
|
|
|
add_subdirectory( doc )
|
Switch from AsciiDoc to Asciidoctor.
Switch the markup text processor for files in the docbook directory from
AsciiDoc to Asciidoctor. Asciidoctor has several useful features (such
as direct PDF output) and is actively developed. It's written in Ruby
but that dependency can be sidestepped with AsciidoctorJ, a
self-contained bundle that only depends on the JRE.
The current toolchain targets require Python, AsciiDoc, DocBook XML,
DocBook XSL, Java, FOP, xsltproc, lynx, and the HTMLHelp compiler:
HTML: AsciiDoc → DocBook XML → xsltproc + DocBook XSL
Chunked HTML: AsciiDoc → DocBook XML → xsltproc + DocBook XSL
PDF: AsciiDoc → DocBook XML → xsltproc + DocBook XSL → FOP
HTMLHelp: AsciiDoc → DocBook XML → xsltproc + DocBook XSL → HHC
This change removes the AsciiDoc and FOP requirements and adds either
AsciidoctorJ or Asciidoctor + Ruby:
HTML: Asciidoctor → DocBook XML → xsltproc + DocBook XSL
Chunked HTML: Asciidoctor → DocBook XML → xsltproc + DocBook XSL
PDF: Asciidoctor
HTMLHelp: Asciidoctor → DocBook XML → xsltproc + DocBook XSL → HHC
Ideally we could generate all of these using AsciidoctorJ, Java, and
lynx. Unfortunately we're not there yet.
The release notes depend on several macros (ws-buglink, ws-salink,
cve-idlink, sort-and-group). Add Asciidoctor (Ruby) equivalents.
Remove the BUILD_xxx_GUIDES CMake options and add various output targets
automatically. This means that you have to build the various documentation
targets explicitly.
Change-Id: I31930677a656b99b1c6839bb6c33a13db951eb9a
Reviewed-on: https://code.wireshark.org/review/25668
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-10-19 22:03:55 +00:00
|
|
|
add_subdirectory( docbook EXCLUDE_FROM_ALL )
|
2009-10-10 05:57:25 +00:00
|
|
|
add_subdirectory( epan )
|
2018-05-17 12:41:15 +00:00
|
|
|
add_subdirectory( extcap )
|
2016-02-15 01:00:38 +00:00
|
|
|
add_subdirectory( randpkt_core )
|
2018-06-08 17:09:11 +00:00
|
|
|
add_subdirectory( tools/lemon )
|
2013-08-01 23:40:06 +00:00
|
|
|
add_subdirectory( ui )
|
2009-10-10 05:57:25 +00:00
|
|
|
add_subdirectory( wiretap )
|
2016-03-24 20:00:07 +00:00
|
|
|
add_subdirectory( writecap )
|
2018-12-07 01:01:28 +00:00
|
|
|
|
|
|
|
# Location of our data files. This should be set to a value that allows
|
|
|
|
# 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)
|
|
|
|
if(CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
set(_datafile_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/share/wireshark")
|
|
|
|
else()
|
|
|
|
# Xcode
|
|
|
|
set(_datafile_dir "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}/Wireshark.app/Contents/Resources/share/wireshark")
|
|
|
|
endif()
|
|
|
|
elseif(NOT CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
# Visual Studio, Xcode, etc.
|
|
|
|
set(_datafile_dir "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}")
|
|
|
|
else()
|
|
|
|
# Makefile, Ninja, etc.
|
|
|
|
set(_datafile_dir "${CMAKE_BINARY_DIR}/run")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(DATAFILE_DIR ${_datafile_dir} CACHE INTERNAL "Build time data file location.")
|
|
|
|
|
|
|
|
# wsutil must be added after DATAFILE_DIR is set such that filesystem.c can
|
|
|
|
# learn about the directory location.
|
2009-10-10 05:57:25 +00:00
|
|
|
add_subdirectory( wsutil )
|
|
|
|
|
2014-08-28 23:48:53 +00:00
|
|
|
if(BUILD_wireshark AND QT_FOUND)
|
2012-02-02 00:46:02 +00:00
|
|
|
add_subdirectory( ui/qt )
|
|
|
|
endif()
|
|
|
|
|
2016-11-28 23:44:56 +00:00
|
|
|
# Location of our plugins. PLUGIN_DIR should allow running
|
2015-01-18 21:27:13 +00:00
|
|
|
# from the build directory similar to DATAFILE_DIR above.
|
|
|
|
if(ENABLE_PLUGINS)
|
2015-12-04 19:12:45 +00:00
|
|
|
# Target platform locations
|
2017-04-05 19:15:27 +00:00
|
|
|
# UN*X in general, including macOS if not building an app bundle:
|
|
|
|
# $DESTDIR/lib/wireshark/plugins/$VERSION
|
2018-06-15 10:44:47 +00:00
|
|
|
# Windows: $DESTDIR/wireshark/plugins/$VERSION
|
2017-04-05 19:15:27 +00:00
|
|
|
# macOS app bundle: Wireshark.app/Contents/PlugIns/wireshark
|
2015-01-18 21:27:13 +00:00
|
|
|
set(HAVE_PLUGINS 1)
|
2015-01-06 23:07:50 +00:00
|
|
|
add_custom_target(plugins)
|
|
|
|
set_target_properties(plugins PROPERTIES FOLDER "Plugins")
|
2015-01-18 21:27:13 +00:00
|
|
|
set(PLUGIN_SRC_DIRS
|
2018-01-15 12:40:55 +00:00
|
|
|
plugins/epan/ethercat
|
|
|
|
plugins/epan/gryphon
|
|
|
|
plugins/epan/irda
|
|
|
|
plugins/epan/mate
|
|
|
|
plugins/epan/opcua
|
|
|
|
plugins/epan/profinet
|
|
|
|
plugins/epan/stats_tree
|
|
|
|
plugins/epan/transum
|
|
|
|
plugins/epan/unistim
|
|
|
|
plugins/epan/wimax
|
|
|
|
plugins/epan/wimaxasncp
|
|
|
|
plugins/epan/wimaxmacphy
|
2018-01-26 23:46:32 +00:00
|
|
|
plugins/wiretap/usbdump
|
2019-02-03 01:07:26 +00:00
|
|
|
plugins/codecs/G711
|
2018-02-27 07:22:25 +00:00
|
|
|
plugins/codecs/l16_mono
|
2015-01-18 21:27:13 +00:00
|
|
|
${CUSTOM_PLUGIN_SRC_DIR}
|
|
|
|
)
|
2019-02-03 01:07:26 +00:00
|
|
|
if(SPANDSP_FOUND)
|
|
|
|
list(APPEND PLUGIN_SRC_DIRS
|
|
|
|
plugins/codecs/G722
|
|
|
|
plugins/codecs/G726
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(BCG729_FOUND)
|
|
|
|
list(APPEND PLUGIN_SRC_DIRS
|
|
|
|
plugins/codecs/G729
|
|
|
|
)
|
|
|
|
endif()
|
2019-11-18 22:55:25 +00:00
|
|
|
if(ILBC_FOUND)
|
|
|
|
list(APPEND PLUGIN_SRC_DIRS
|
|
|
|
plugins/codecs/iLBC
|
|
|
|
)
|
|
|
|
endif()
|
2019-02-03 01:07:26 +00:00
|
|
|
if(SBC_FOUND)
|
|
|
|
list(APPEND PLUGIN_SRC_DIRS
|
|
|
|
plugins/codecs/sbc
|
|
|
|
)
|
|
|
|
endif()
|
2017-01-24 16:34:07 +00:00
|
|
|
|
|
|
|
# Build demo plugin, only if asked explicitly
|
|
|
|
if(ENABLE_PLUGIN_IFDEMO)
|
|
|
|
set(PLUGIN_SRC_DIRS
|
|
|
|
${PLUGIN_SRC_DIRS}
|
2018-01-16 15:59:28 +00:00
|
|
|
plugins/epan/pluginifdemo
|
2017-01-24 16:34:07 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2015-01-18 21:27:13 +00:00
|
|
|
else()
|
|
|
|
set(PLUGIN_SRC_DIRS )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2018-06-15 10:44:47 +00:00
|
|
|
if(CMAKE_CFG_INTDIR STREQUAL ".")
|
2019-02-13 19:08:19 +00:00
|
|
|
set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}")
|
2018-06-15 10:44:47 +00:00
|
|
|
else()
|
2019-02-13 03:02:07 +00:00
|
|
|
# Xcode
|
2019-02-13 19:08:19 +00:00
|
|
|
set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Wireshark.app/Contents/PlugIns/wireshark/${PLUGIN_PATH_ID}")
|
2018-06-15 10:44:47 +00:00
|
|
|
endif()
|
|
|
|
elseif(WIN32 AND NOT CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
set(_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/${PLUGIN_VERSION_DIR}")
|
2015-01-18 21:27:13 +00:00
|
|
|
else()
|
2017-10-14 19:13:52 +00:00
|
|
|
set(_plugin_dir "${DATAFILE_DIR}/${PLUGIN_VERSION_DIR}")
|
2015-01-18 21:27:13 +00:00
|
|
|
endif()
|
|
|
|
set (PLUGIN_DIR ${_plugin_dir} CACHE INTERNAL "Build time plugin location.")
|
|
|
|
|
|
|
|
foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS})
|
|
|
|
add_subdirectory( ${_plugin_src_dir} )
|
|
|
|
endforeach()
|
|
|
|
|
2013-07-23 09:41:35 +00:00
|
|
|
# Large file support (e.g. make off_t 64 bit if supported)
|
|
|
|
include(gmxTestLargeFiles)
|
|
|
|
gmx_test_large_files(GMX_LARGEFILES)
|
|
|
|
|
2014-06-20 23:05:27 +00:00
|
|
|
set( VERSION ${PROJECT_VERSION} )
|
2019-07-27 16:10:39 +00:00
|
|
|
if(VCSVERSION_OVERRIDE)
|
|
|
|
# Allow distributors to override detection of the Git tag and version.
|
|
|
|
string(CONFIGURE "#define VCSVERSION \"@VCSVERSION_OVERRIDE@\"\n"
|
|
|
|
_version_h_contents ESCAPE_QUOTES)
|
|
|
|
file(WRITE "${CMAKE_BINARY_DIR}/version.h" "${_version_h_contents}")
|
|
|
|
message(STATUS "VCSVERSION_OVERRIDE: ${VCSVERSION_OVERRIDE}")
|
|
|
|
else()
|
|
|
|
add_custom_target(version
|
|
|
|
BYPRODUCTS version.h
|
|
|
|
COMMAND ${PERL_EXECUTABLE}
|
|
|
|
${CMAKE_SOURCE_DIR}/tools/make-version.pl
|
|
|
|
${CMAKE_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
set_target_properties(version PROPERTIES FOLDER "Auxiliary")
|
|
|
|
endif()
|
2016-04-20 22:51:12 +00:00
|
|
|
|
2014-06-20 23:05:27 +00:00
|
|
|
set( configure_input "Built with CMake ${CMAKE_VERSION}" )
|
2006-09-06 22:28:19 +00:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h)
|
2015-08-26 04:50:09 +00:00
|
|
|
|
2018-08-21 14:18:56 +00:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/ws_version.h.in ${CMAKE_BINARY_DIR}/ws_version.h)
|
|
|
|
|
2015-12-26 16:13:00 +00:00
|
|
|
set( prefix "${CMAKE_INSTALL_PREFIX}" )
|
|
|
|
set( exec_prefix "\${prefix}" )
|
|
|
|
set( libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}" )
|
|
|
|
set( includedir "\${prefix}/include" )
|
2017-09-06 10:55:40 +00:00
|
|
|
set( plugindir "\${libdir}/wireshark/${PLUGIN_VERSION_DIR}" )
|
2015-12-26 16:13:00 +00:00
|
|
|
|
2018-04-16 21:49:55 +00:00
|
|
|
# Doxygen variables
|
|
|
|
file(GLOB TOP_LEVEL_SOURCE_LIST *.c *.cpp *.h)
|
|
|
|
string (REPLACE ";" " " DOXYGEN_TOP_LEVEL_SOURCES "${TOP_LEVEL_SOURCE_LIST}")
|
|
|
|
set(DOXYGEN_INPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
|
|
|
|
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
|
2018-10-08 23:34:39 +00:00
|
|
|
set(CFG_OUT_FILES
|
|
|
|
doxygen.cfg
|
|
|
|
image/libwireshark.rc
|
|
|
|
image/wireshark.rc
|
|
|
|
image/dumpcap.rc
|
|
|
|
image/libwsutil.rc
|
|
|
|
image/wiretap.rc
|
|
|
|
image/wireshark.exe.manifest
|
|
|
|
packaging/macosx/Info.plist
|
2019-09-25 20:17:31 +00:00
|
|
|
packaging/macosx/dmgbuild-settings.py
|
2018-10-08 23:34:39 +00:00
|
|
|
packaging/macosx/osx-app.sh
|
2019-09-26 17:43:13 +00:00
|
|
|
packaging/macosx/osx-dmg.sh
|
2019-01-11 22:34:03 +00:00
|
|
|
packaging/source/git-export-release.sh
|
2018-10-08 23:34:39 +00:00
|
|
|
wireshark.pc
|
2014-06-20 22:38:07 +00:00
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
foreach( _cfg_file ${CFG_OUT_FILES} )
|
|
|
|
configure_file( ${CMAKE_SOURCE_DIR}/${_cfg_file}.in ${CMAKE_BINARY_DIR}/${_cfg_file} @ONLY )
|
2014-06-20 22:38:07 +00:00
|
|
|
endforeach()
|
|
|
|
|
2009-09-24 20:42:08 +00:00
|
|
|
include(FeatureSummary)
|
2020-01-26 14:46:58 +00:00
|
|
|
set_package_properties(CAP PROPERTIES
|
|
|
|
DESCRIPTION "The Libcap package implements the user-space interfaces to the POSIX 1003.1e capabilities available in Linux kernels"
|
|
|
|
URL "https://sites.google.com/site/fullycapable/"
|
|
|
|
PURPOSE "Allow packet captures without running as root"
|
|
|
|
)
|
2017-06-25 22:34:41 +00:00
|
|
|
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"
|
2019-07-27 07:54:44 +00:00
|
|
|
URL "https://www.soft-switch.org"
|
2017-06-25 22:34:41 +00:00
|
|
|
PURPOSE "Support for G.722 and G.726 codecs in RTP player"
|
|
|
|
)
|
2017-07-26 21:23:12 +00:00
|
|
|
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"
|
|
|
|
)
|
2019-11-18 22:55:25 +00:00
|
|
|
set_package_properties(ILBC PROPERTIES
|
|
|
|
DESCRIPTION "iLBC decoder"
|
|
|
|
URL "https://github.com/TimothyGu/libilbc"
|
|
|
|
PURPOSE "Support for iLBC codec in RTP player"
|
|
|
|
)
|
2017-06-25 22:34:41 +00:00
|
|
|
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"
|
2019-07-27 07:54:44 +00:00
|
|
|
URL "https://google.github.io/snappy/"
|
2017-06-25 22:34:41 +00:00
|
|
|
PURPOSE "Snappy decompression in CQL and Kafka dissectors"
|
|
|
|
)
|
2019-08-12 21:57:45 +00:00
|
|
|
set_package_properties(ZSTD PROPERTIES
|
|
|
|
DESCRIPTION "A compressor/decompressor from Facebook providing better compression than Snappy at a cost of speed"
|
|
|
|
URL "https://facebook.github.io/zstd/"
|
|
|
|
PURPOSE "Zstd decompression in Kafka dissector"
|
|
|
|
)
|
2017-06-25 22:34:41 +00:00
|
|
|
set_package_properties(NGHTTP2 PROPERTIES
|
|
|
|
DESCRIPTION "HTTP/2 C library and tools"
|
|
|
|
URL "https://nghttp2.org"
|
|
|
|
PURPOSE "Header decompression in HTTP2"
|
|
|
|
)
|
2019-01-28 20:02:34 +00:00
|
|
|
set_package_properties(CARES PROPERTIES
|
|
|
|
DESCRIPTION "Library for asynchronous DNS requests"
|
|
|
|
URL "https://c-ares.haxx.se/"
|
|
|
|
PURPOSE "DNS name resolution for captures"
|
|
|
|
)
|
2019-01-31 10:34:47 +00:00
|
|
|
set_package_properties(Systemd PROPERTIES
|
|
|
|
URL "https://freedesktop.org/wiki/Software/systemd/"
|
|
|
|
DESCRIPTION "System and Service Manager (libraries)"
|
|
|
|
PURPOSE "Support for systemd journal extcap interface (sdjournal)"
|
|
|
|
)
|
2019-01-31 10:43:04 +00:00
|
|
|
set_package_properties(NL PROPERTIES
|
|
|
|
URL "https://www.infradead.org/~tgr/libnl/"
|
|
|
|
DESCRIPTION "Libraries for using the Netlink protocol on Linux"
|
|
|
|
PURPOSE "Support for managing wireless 802.11 interfaces"
|
|
|
|
)
|
2019-01-31 10:47:26 +00:00
|
|
|
set_package_properties(MaxMindDB PROPERTIES
|
|
|
|
URL "https://github.com/maxmind/libmaxminddb"
|
|
|
|
DESCRIPTION "C library for the MaxMind DB file format"
|
|
|
|
PURPOSE "Support for GeoIP lookup"
|
|
|
|
)
|
2019-02-02 14:52:07 +00:00
|
|
|
set_package_properties(SpeexDSP PROPERTIES
|
|
|
|
URL "https://www.speex.org/"
|
|
|
|
DESCRIPTION "SpeexDSP is a patent-free, Open Source/Free Software DSP library"
|
|
|
|
PURPOSE "RTP audio resampling"
|
|
|
|
)
|
2019-07-10 22:25:45 +00:00
|
|
|
set_package_properties(Minizip PROPERTIES
|
|
|
|
URL "https://www.winimage.com/zLibDll/minizip.html"
|
|
|
|
DESCRIPTION "C library for supporting zip/unzip functionality"
|
|
|
|
PURPOSE "Support for profiles import/export"
|
|
|
|
)
|
2017-09-24 08:19:54 +00:00
|
|
|
|
2019-01-28 20:02:34 +00:00
|
|
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type)
|
|
|
|
message(STATUS "C-Flags: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${_build_type}}")
|
|
|
|
message(STATUS "CXX-Flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_build_type}}")
|
|
|
|
if(WERROR_COMMON_FLAGS)
|
|
|
|
message(STATUS "Warnings as errors enabled: ${WERROR_COMMON_FLAGS}")
|
|
|
|
else()
|
|
|
|
message(STATUS "Warnings as errors disabled")
|
|
|
|
endif()
|
2017-09-24 08:19:54 +00:00
|
|
|
|
2017-06-25 22:34:41 +00:00
|
|
|
feature_summary(WHAT ALL)
|
2009-09-24 20:42:08 +00:00
|
|
|
|
2020-06-23 20:30:40 +00:00
|
|
|
# Newer Libgcrypt versions may be required for certain functionality:
|
|
|
|
# 1.6
|
|
|
|
# - IEEE 802.11 TDLS, AES-GCMP-128 and AES-GCMP-256 decryption
|
|
|
|
# - IEEE 802.11 WPA3-Personal / SAE decryption
|
|
|
|
# - BT Mesh decryption
|
|
|
|
# - Distributed Object Framework (DOF) decryption
|
|
|
|
# - IKEv2 integrity check
|
|
|
|
# - LoRaWAN integrity check
|
2020-06-24 07:08:40 +00:00
|
|
|
# - LTE PDCP EIA2 integrity check
|
2020-06-23 20:30:40 +00:00
|
|
|
# - QUIC decryption support
|
|
|
|
# - SMB3 AES-128-CCM/GCM decryption
|
|
|
|
# - TLS 1.3 0-RTT decryption
|
|
|
|
# - TLS GCM/CCM ciphers integrity check
|
|
|
|
# 1.7
|
|
|
|
# - QUIC ChaCha20-Poly1305 decryption
|
|
|
|
# - TLS 1.3 ChaCha20-Poly1305 decryption
|
|
|
|
# 1.8
|
|
|
|
# - dcerpc-netlogon NETLOGON_FLAG_AES decryption
|
|
|
|
# - WireGuard decryption
|
|
|
|
if(GCRYPT_VERSION VERSION_LESS 1.6.0)
|
|
|
|
message(WARNING "Libgcrypt version 1.6.0 or newer is strongly recommended for improved decryption support, found ${GCRYPT_VERSION}")
|
|
|
|
elseif(GCRYPT_VERSION VERSION_LESS 1.8.0)
|
|
|
|
message(WARNING "Libgcrypt version 1.8.0 or newer is recommended for full decryption functionality, found ${GCRYPT_VERSION}")
|
|
|
|
endif()
|
|
|
|
|
2019-11-14 16:08:28 +00:00
|
|
|
# Should this be part of libui?
|
2009-08-30 06:24:44 +00:00
|
|
|
if(WIN32)
|
2013-10-11 10:32:11 +00:00
|
|
|
set(PLATFORM_UI_SRC
|
2013-10-10 20:35:32 +00:00
|
|
|
ui/win32/console_win32.c
|
|
|
|
ui/win32/file_dlg_win32.c
|
2015-01-07 10:17:14 +00:00
|
|
|
)
|
|
|
|
set(PLATFORM_UI_RC_FILES
|
2014-06-20 23:33:57 +00:00
|
|
|
image/file_dlg_win32.rc
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
2018-04-09 09:39:49 +00:00
|
|
|
elseif(APPLE)
|
|
|
|
set(PLATFORM_UI_SRC
|
|
|
|
ui/macosx/cocoa_bridge.mm
|
|
|
|
)
|
2019-11-14 16:08:28 +00:00
|
|
|
if (SPARKLE_FOUND)
|
|
|
|
list(APPEND PLATFORM_UI_SRC ui/macosx/sparkle_bridge.m)
|
|
|
|
endif()
|
2009-08-30 06:24:44 +00:00
|
|
|
endif()
|
2009-06-16 04:12:30 +00:00
|
|
|
|
2009-09-08 07:03:57 +00:00
|
|
|
set(TSHARK_TAP_SRC
|
2019-05-29 14:06:38 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-credentials.c
|
2017-12-10 17:29:40 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-camelsrt.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-diameter-avp.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-expert.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-exportobject.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-endpoints.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-flow.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-follow.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-funnel.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-gsm_astat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-hosts.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-httpstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-icmpstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-icmpv6stat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-iostat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-iousers.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-macltestat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-protocolinfo.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-protohierstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rlcltestat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rpcprogs.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rtd.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rtp.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rtspstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-sctpchunkstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-simple_stattable.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-sipstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-smbsids.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-srt.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-stats_tree.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-sv.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-wspstat.c
|
2019-10-18 07:32:25 +00:00
|
|
|
${CUSTOM_TSHARK_TAP_SRC}
|
|
|
|
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
|
2009-09-21 00:19:07 +00:00
|
|
|
set(INSTALL_DIRS
|
|
|
|
diameter
|
|
|
|
dtds
|
2016-11-08 17:04:59 +00:00
|
|
|
profiles
|
2009-09-21 00:19:07 +00:00
|
|
|
radius
|
|
|
|
tpncp
|
|
|
|
wimaxasncp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(INSTALL_FILES
|
2009-09-25 02:50:48 +00:00
|
|
|
cfilters
|
|
|
|
colorfilters
|
|
|
|
dfilters
|
2019-01-19 21:22:02 +00:00
|
|
|
dfilter_macros
|
2017-07-13 20:03:13 +00:00
|
|
|
enterprises.tsv
|
Re-implement "Map" feature for Endpoints
This feature was removed in v2.5.1rc0-427-gf529ab5d0a, anticipating that
MaxMind would remove support for it in 2019. They have however changed
their mind and maintained latitude and longitude information.
They recommend displaying an accuracy radius, but the reported values
are 50, 100, 200 and 1000km. When implemented literally, a marker in
Ireland would cover the whole island plus mainland, so I have instead
opted to use a fixed radius of 1km at deeper zoom levels.
The old ipmap.html file was outdated and had broken tiles, I rewrote a
new one from scratch using the light-weight Leaflet library combined
with tiles from OpenStreetMap. This is more mobile-friendly and secure
(https, SRI). To improve handling of nearby or overlapping nodes,
clustering is used (individual nodes can still be inspected).
Browser compatibility results: IE8 is unusable, IE9 partially works
(tooltips sometimes disappear and the cluster radius control is gone),
IE11 works. Of course Firefox 65 and Chromium 72 have no issues.
The map popup description in the generated GeoJSON structure is now
split in several properties, allowing presentation to be handled by the
HTML page instead of the C code.
Bug: 14693
Change-Id: If2ec9c518f7723ac0ab27b6272463356875a0ff2
Reviewed-on: https://code.wireshark.org/review/31952
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-09 23:19:54 +00:00
|
|
|
ipmap.html
|
2009-09-25 02:50:48 +00:00
|
|
|
manuf
|
2011-05-19 18:10:21 +00:00
|
|
|
pdml2html.xsl
|
2009-09-25 02:50:48 +00:00
|
|
|
services
|
|
|
|
smi_modules
|
2017-07-20 01:32:40 +00:00
|
|
|
wka
|
2009-11-11 16:20:37 +00:00
|
|
|
docbook/ws.css
|
2019-10-10 15:34:46 +00:00
|
|
|
${CMAKE_BINARY_DIR}/doc/AUTHORS-SHORT
|
|
|
|
${CMAKE_BINARY_DIR}/doc/androiddump.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/udpdump.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/capinfos.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/captype.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/ciscodump.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/dftest.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/dumpcap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/editcap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/extcap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/mergecap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/randpkt.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/randpktdump.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/rawshark.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/reordercap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/sshdump.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/text2pcap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/tshark.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/wireshark.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/wireshark-filter.html
|
2009-09-21 00:19:07 +00:00
|
|
|
)
|
|
|
|
|
2019-10-10 15:34:46 +00:00
|
|
|
if(MAXMINDDB_FOUND)
|
|
|
|
list(APPEND INSTALL_FILES ${CMAKE_BINARY_DIR}/doc/mmdbresolve.html)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
2019-12-17 00:42:13 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
# We do this for Windows further down in the copy_data_files target.
|
|
|
|
list(APPEND INSTALL_FILES COPYING)
|
2015-01-15 21:07:48 +00:00
|
|
|
endif()
|
|
|
|
|
2018-11-27 19:37:33 +00:00
|
|
|
set(VERSION_INFO_LIBS
|
2019-01-10 01:45:00 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
)
|
|
|
|
set(VERSION_INFO_INCLUDE_DIRS
|
|
|
|
${ZLIB_INCLUDE_DIRS}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
|
2015-01-12 22:44:42 +00:00
|
|
|
if(WIN32)
|
2017-10-14 19:13:52 +00:00
|
|
|
set(_dll_output_dir "${DATAFILE_DIR}")
|
2015-01-12 22:44:42 +00:00
|
|
|
add_custom_target(copy_cli_dlls)
|
2015-01-15 21:07:48 +00:00
|
|
|
set_target_properties(copy_cli_dlls PROPERTIES FOLDER "Copy Tasks")
|
2015-01-12 22:44:42 +00:00
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${_dll_output_dir}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# XXX Can (and should) we iterate over these similar to the way
|
|
|
|
# the top-level CMakeLists.txt iterates over the package list?
|
|
|
|
|
2019-01-04 23:37:46 +00:00
|
|
|
# Required DLLs and their corresponding PDBs.
|
2018-01-20 00:02:20 +00:00
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2019-09-03 18:28:52 +00:00
|
|
|
"$<IF:$<CONFIG:Debug>,${GLIB2_DLLS_DEBUG},${GLIB2_DLLS_RELEASE}>"
|
|
|
|
"$<IF:$<CONFIG:Debug>,${GLIB2_PDBS_DEBUG},${GLIB2_PDBS_RELEASE}>"
|
2018-01-20 00:02:20 +00:00
|
|
|
"${_dll_output_dir}"
|
2019-09-03 18:28:52 +00:00
|
|
|
WORKING_DIRECTORY $<IF:$<CONFIG:Debug>,${GLIB2_DLL_DIR_DEBUG},${GLIB2_DLL_DIR_RELEASE}>
|
|
|
|
COMMAND_EXPAND_LISTS
|
2018-01-20 00:02:20 +00:00
|
|
|
)
|
2015-04-13 20:44:23 +00:00
|
|
|
|
2019-01-04 18:14:13 +00:00
|
|
|
# Optional DLLs and PDBs.
|
2018-01-20 00:02:20 +00:00
|
|
|
set (OPTIONAL_DLLS)
|
2019-01-04 18:14:13 +00:00
|
|
|
set (OPTIONAL_PDBS)
|
2015-01-12 22:44:42 +00:00
|
|
|
if (AIRPCAP_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${AIRPCAP_DLL_DIR}/${AIRPCAP_DLL}")
|
2015-01-12 22:44:42 +00:00
|
|
|
endif(AIRPCAP_FOUND)
|
|
|
|
if (CARES_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${CARES_DLL_DIR}/${CARES_DLL}")
|
2019-01-04 18:14:13 +00:00
|
|
|
list (APPEND OPTIONAL_PDBS "${CARES_DLL_DIR}/${CARES_PDB}")
|
2015-01-12 22:44:42 +00:00
|
|
|
endif(CARES_FOUND)
|
2018-03-07 21:10:31 +00:00
|
|
|
if (MAXMINDDB_FOUND)
|
|
|
|
list (APPEND OPTIONAL_DLLS "${MAXMINDDB_DLL_DIR}/${MAXMINDDB_DLL}")
|
|
|
|
endif(MAXMINDDB_FOUND)
|
2015-11-19 10:30:44 +00:00
|
|
|
if (LIBSSH_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${LIBSSH_DLL_DIR}/${LIBSSH_DLL}")
|
2015-11-19 10:30:44 +00:00
|
|
|
endif(LIBSSH_FOUND)
|
2017-02-09 14:00:19 +00:00
|
|
|
foreach( _dll ${GCRYPT_DLLS} )
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${GCRYPT_DLL_DIR}/${_dll}")
|
|
|
|
endforeach(_dll)
|
|
|
|
foreach( _dll ${GNUTLS_DLLS} )
|
|
|
|
list (APPEND OPTIONAL_DLLS "${GNUTLS_DLL_DIR}/${_dll}")
|
|
|
|
endforeach(_dll)
|
|
|
|
foreach( _dll ${KERBEROS_DLLS} )
|
|
|
|
list (APPEND OPTIONAL_DLLS "${KERBEROS_DLL_DIR}/${_dll}")
|
2017-02-09 14:00:19 +00:00
|
|
|
endforeach(_dll)
|
2015-01-12 22:44:42 +00:00
|
|
|
if (LUA_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${LUA_DLL_DIR}/${LUA_DLL}")
|
2015-01-12 22:44:42 +00:00
|
|
|
endif(LUA_FOUND)
|
2016-10-17 19:04:49 +00:00
|
|
|
if (LZ4_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${LZ4_DLL_DIR}/${LZ4_DLL}")
|
2019-04-08 17:02:52 +00:00
|
|
|
list (APPEND OPTIONAL_PDBS "${LZ4_DLL_DIR}/${LZ4_PDB}")
|
2016-10-17 19:04:49 +00:00
|
|
|
endif(LZ4_FOUND)
|
2019-08-12 21:57:45 +00:00
|
|
|
if (ZSTD_FOUND)
|
|
|
|
list (APPEND OPTIONAL_DLLS "${ZSTD_DLL_DIR}/${ZSTD_DLL}")
|
|
|
|
endif(ZSTD_FOUND)
|
2016-08-26 13:18:29 +00:00
|
|
|
if (NGHTTP2_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${NGHTTP2_DLL_DIR}/${NGHTTP2_DLL}")
|
2019-08-16 19:45:43 +00:00
|
|
|
list (APPEND OPTIONAL_PDBS "${NGHTTP2_DLL_DIR}/${NGHTTP2_PDB}")
|
2016-08-26 13:18:29 +00:00
|
|
|
endif(NGHTTP2_FOUND)
|
2016-10-22 16:15:51 +00:00
|
|
|
if (SBC_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${SBC_DLL_DIR}/${SBC_DLL}")
|
2016-10-22 16:15:51 +00:00
|
|
|
endif(SBC_FOUND)
|
2016-11-23 23:27:14 +00:00
|
|
|
if (SPANDSP_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${SPANDSP_DLL_DIR}/${SPANDSP_DLL}")
|
2016-11-23 23:27:14 +00:00
|
|
|
endif(SPANDSP_FOUND)
|
2017-07-26 21:23:12 +00:00
|
|
|
if (BCG729_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${BCG729_DLL_DIR}/${BCG729_DLL}")
|
2017-07-26 21:23:12 +00:00
|
|
|
endif(BCG729_FOUND)
|
2019-11-18 22:55:25 +00:00
|
|
|
if (ILBC_FOUND)
|
|
|
|
list (APPEND OPTIONAL_DLLS "${ILBC_DLL_DIR}/${ILBC_DLL}")
|
|
|
|
endif(ILBC_FOUND)
|
2017-04-04 21:23:59 +00:00
|
|
|
if (LIBXML2_FOUND)
|
2019-01-04 23:37:46 +00:00
|
|
|
foreach( _dll ${LIBXML2_DLLS} )
|
|
|
|
list (APPEND OPTIONAL_DLLS "${LIBXML2_DLL_DIR}/${_dll}")
|
|
|
|
endforeach(_dll)
|
|
|
|
foreach( _pdb ${LIBXML2_PDBS} )
|
|
|
|
list (APPEND OPTIONAL_PDBS "${LIBXML2_DLL_DIR}/${_pdb}")
|
|
|
|
endforeach(_pdb)
|
2017-04-04 21:23:59 +00:00
|
|
|
endif(LIBXML2_FOUND)
|
2015-01-12 22:44:42 +00:00
|
|
|
if (SMI_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${SMI_DLL_DIR}/${SMI_DLL}")
|
2015-07-05 11:47:15 +00:00
|
|
|
# Wireshark.nsi wants SMI_DIR which is the base SMI directory
|
|
|
|
get_filename_component(SMI_DIR ${SMI_DLL_DIR} DIRECTORY)
|
2015-01-12 22:44:42 +00:00
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory
|
|
|
|
"${_dll_output_dir}/snmp"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/iana"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/ietf"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/irtf"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/site"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/tubs"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/pibs"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/yang"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
2016-04-07 23:03:51 +00:00
|
|
|
#remove the extra directories copied (shallow copying the above would remove the need for this)
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs/iana"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs/ietf"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs/site"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs/tubs"
|
2015-01-12 22:44:42 +00:00
|
|
|
)
|
|
|
|
endif(SMI_FOUND)
|
2016-10-17 19:04:49 +00:00
|
|
|
if (SNAPPY_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${SNAPPY_DLL_DIR}/${SNAPPY_DLL}")
|
2016-10-17 19:04:49 +00:00
|
|
|
endif(SNAPPY_FOUND)
|
2015-01-12 22:44:42 +00:00
|
|
|
if (WINSPARKLE_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${WINSPARKLE_DLL_DIR}/${WINSPARKLE_DLL}")
|
|
|
|
endif(WINSPARKLE_FOUND)
|
2019-01-04 23:37:46 +00:00
|
|
|
if (ZLIB_FOUND)
|
|
|
|
list (APPEND OPTIONAL_DLLS "${ZLIB_DLL_DIR}/${ZLIB_DLL}")
|
|
|
|
list (APPEND OPTIONAL_PDBS "${ZLIB_DLL_DIR}/${ZLIB_PDB}")
|
|
|
|
endif(ZLIB_FOUND)
|
2019-04-10 10:52:52 +00:00
|
|
|
if (BROTLI_FOUND)
|
|
|
|
foreach( _dll ${BROTLI_DLLS} )
|
|
|
|
list (APPEND OPTIONAL_DLLS "${BROTLI_DLL_DIR}/${_dll}")
|
|
|
|
endforeach(_dll)
|
|
|
|
endif(BROTLI_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
|
|
|
|
# With libs downloaded to c:/wireshark-win64-libs this currently
|
|
|
|
# (early 2018) expands to about 1900 characters.
|
|
|
|
if (OPTIONAL_DLLS)
|
2015-01-12 22:44:42 +00:00
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2018-01-20 00:02:20 +00:00
|
|
|
${OPTIONAL_DLLS}
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}"
|
2018-01-20 00:02:20 +00:00
|
|
|
VERBATIM
|
2015-01-12 22:44:42 +00:00
|
|
|
)
|
2018-11-23 20:39:42 +00:00
|
|
|
install(FILES ${OPTIONAL_DLLS} DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
2018-01-20 00:02:20 +00:00
|
|
|
endif(OPTIONAL_DLLS)
|
2015-01-12 22:44:42 +00:00
|
|
|
|
2019-01-04 18:14:13 +00:00
|
|
|
if (OPTIONAL_PDBS)
|
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
${OPTIONAL_PDBS}
|
|
|
|
"${_dll_output_dir}"
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
endif(OPTIONAL_PDBS)
|
|
|
|
|
2015-01-12 22:44:42 +00:00
|
|
|
add_dependencies(epan copy_cli_dlls)
|
2015-01-19 21:33:01 +00:00
|
|
|
|
|
|
|
# We have a lot of choices for creating zip archives:
|
|
|
|
# - 7z, WinZip, etc., which require a separate download+install.
|
|
|
|
# - "CMake -E tar cz", which creates a tar file.
|
|
|
|
# - CPack, which requires a CPack configuration.
|
|
|
|
# - PowerShell via PSCX or System.IO.Compression.FileSystem.
|
|
|
|
# - Python via zipfile.
|
|
|
|
# For now, just look for 7z. It's installed on the Windows builders,
|
|
|
|
# which might be the only systems that use this target.
|
|
|
|
find_program(ZIP_EXECUTABLE 7z
|
|
|
|
PATH "$ENV{PROGRAMFILES}/7-Zip" "$ENV{PROGRAMW6432}/7-Zip"
|
|
|
|
DOC "Path to the 7z utility."
|
|
|
|
)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(ZIP_EXECUTABLE)
|
2018-06-26 17:39:24 +00:00
|
|
|
add_custom_target(pdb_zip_package COMMENT "This packages .PDBs but will not create them.")
|
2015-01-19 21:33:01 +00:00
|
|
|
set_target_properties(pdb_zip_package PROPERTIES FOLDER "Packaging")
|
|
|
|
set(_pdb_zip "${CMAKE_BINARY_DIR}/Wireshark-pdb-${WIRESHARK_TARGET_PLATFORM}-${VERSION}.zip")
|
|
|
|
file(TO_NATIVE_PATH "${_pdb_zip}" _pdb_zip_win)
|
|
|
|
add_custom_command(TARGET pdb_zip_package POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove -f "${_pdb_zip}"
|
2018-02-27 18:10:54 +00:00
|
|
|
COMMAND ${ZIP_EXECUTABLE} a -tzip -mmt=on "${_pdb_zip_win}"
|
2020-01-06 17:58:38 +00:00
|
|
|
-bb2
|
|
|
|
-r *.pdb *.lib
|
2015-01-19 21:33:01 +00:00
|
|
|
WORKING_DIRECTORY "${_dll_output_dir}"
|
|
|
|
)
|
|
|
|
endif()
|
2015-01-15 21:07:48 +00:00
|
|
|
endif(WIN32)
|
|
|
|
|
2015-11-25 10:08:16 +00:00
|
|
|
# List of extra dependencies for the "copy_data_files" target
|
2015-11-21 23:16:08 +00:00
|
|
|
set(copy_data_files_depends)
|
2015-01-15 21:07:48 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
2019-12-17 00:42:13 +00:00
|
|
|
foreach(_install_as_txt_file COPYING NEWS README.md README.windows)
|
|
|
|
# On Windows, install some files with a .txt extension so that they're
|
|
|
|
# double-clickable.
|
|
|
|
string(REGEX REPLACE ".md$" "" _no_md_file ${_install_as_txt_file})
|
|
|
|
set(_output_file "${DATAFILE_DIR}/${_no_md_file}.txt")
|
|
|
|
add_custom_command(OUTPUT ${_output_file}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
${CMAKE_SOURCE_DIR}/${_install_as_txt_file}
|
|
|
|
${_output_file}
|
2017-08-16 19:26:42 +00:00
|
|
|
DEPENDS
|
2019-12-17 00:42:13 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/${_install_as_txt_file}
|
2017-08-16 19:26:42 +00:00
|
|
|
)
|
2019-12-17 00:42:13 +00:00
|
|
|
list(APPEND copy_data_files_depends "${_output_file}")
|
2017-08-16 19:26:42 +00:00
|
|
|
endforeach()
|
2015-01-12 22:44:42 +00:00
|
|
|
endif()
|
|
|
|
|
2015-01-15 21:07:48 +00:00
|
|
|
foreach(_install_file ${INSTALL_FILES})
|
2017-06-17 07:42:14 +00:00
|
|
|
get_filename_component(_install_file_src "${_install_file}" ABSOLUTE)
|
2015-01-15 21:07:48 +00:00
|
|
|
get_filename_component(_install_basename "${_install_file}" NAME)
|
2015-11-21 23:16:08 +00:00
|
|
|
set(_output_file "${DATAFILE_DIR}/${_install_basename}")
|
|
|
|
add_custom_command(OUTPUT "${_output_file}"
|
2018-01-20 00:02:20 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2017-06-17 07:42:14 +00:00
|
|
|
"${_install_file_src}"
|
2015-11-21 23:16:08 +00:00
|
|
|
"${_output_file}"
|
|
|
|
DEPENDS
|
2019-10-10 15:34:46 +00:00
|
|
|
docs
|
2015-11-21 23:16:08 +00:00
|
|
|
"${_install_file}"
|
2015-01-15 21:07:48 +00:00
|
|
|
)
|
2015-11-21 23:16:08 +00:00
|
|
|
list(APPEND copy_data_files_depends "${_output_file}")
|
2015-01-15 21:07:48 +00:00
|
|
|
endforeach()
|
|
|
|
|
2015-11-21 23:16:08 +00:00
|
|
|
# Install LUA files in staging directory such that LUA can used when Wireshark
|
|
|
|
# is ran from the build directory. For install targets, see
|
|
|
|
# epan/wslua/CMakeLists.txt
|
2015-12-30 18:26:59 +00:00
|
|
|
if(LUA_FOUND AND ENABLE_LUA)
|
2015-11-21 23:16:08 +00:00
|
|
|
set(_lua_files
|
|
|
|
"${CMAKE_BINARY_DIR}/epan/wslua/init.lua"
|
|
|
|
"${CMAKE_SOURCE_DIR}/epan/wslua/console.lua"
|
|
|
|
"${CMAKE_SOURCE_DIR}/epan/wslua/dtd_gen.lua"
|
2015-01-15 21:07:48 +00:00
|
|
|
)
|
2015-11-21 23:16:08 +00:00
|
|
|
foreach(_lua_file ${_lua_files})
|
|
|
|
get_filename_component(_lua_filename "${_lua_file}" NAME)
|
|
|
|
list(APPEND copy_data_files_depends
|
|
|
|
"${DATAFILE_DIR}/${_lua_filename}")
|
|
|
|
add_custom_command(OUTPUT "${DATAFILE_DIR}/${_lua_filename}"
|
2018-01-20 00:02:20 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2015-11-21 23:16:08 +00:00
|
|
|
"${_lua_file}"
|
|
|
|
"${DATAFILE_DIR}/${_lua_filename}"
|
|
|
|
DEPENDS
|
2015-11-25 10:08:16 +00:00
|
|
|
wsluaauxiliary
|
2015-11-21 23:16:08 +00:00
|
|
|
"${_lua_file}"
|
|
|
|
)
|
|
|
|
endforeach()
|
2016-01-18 21:50:42 +00:00
|
|
|
endif(LUA_FOUND AND ENABLE_LUA)
|
2019-10-10 15:34:46 +00:00
|
|
|
# doc/*.html handled elsewhere.
|
2015-11-21 23:16:08 +00:00
|
|
|
|
2019-02-11 22:24:18 +00:00
|
|
|
# Glob patterns relative to the source directory that should be copied to
|
|
|
|
# ${DATAFILE_DIR} (including directory prefixes)
|
2015-11-21 23:16:08 +00:00
|
|
|
# TODO shouldn't this use full (relative) paths instead of glob patterns?
|
2019-02-11 22:24:18 +00:00
|
|
|
set(DATA_FILES_SRC
|
2015-11-21 23:16:08 +00:00
|
|
|
"tpncp/tpncp.dat"
|
2015-11-24 09:16:48 +00:00
|
|
|
"wimaxasncp/*.dtd"
|
2015-11-21 23:16:08 +00:00
|
|
|
"wimaxasncp/*.xml"
|
2015-01-15 21:07:48 +00:00
|
|
|
)
|
2015-11-21 23:16:08 +00:00
|
|
|
|
|
|
|
# Copy all paths from the source tree to the data directory. Directories are
|
|
|
|
# automatically created if missing as the filename is given.
|
|
|
|
file(GLOB _data_files RELATIVE "${CMAKE_SOURCE_DIR}" ${DATA_FILES_SRC})
|
|
|
|
foreach(_data_file ${_data_files})
|
|
|
|
add_custom_command(OUTPUT "${DATAFILE_DIR}/${_data_file}"
|
2018-01-20 00:02:20 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2015-11-21 23:16:08 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/${_data_file}"
|
|
|
|
"${DATAFILE_DIR}/${_data_file}"
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/${_data_file}"
|
2015-01-15 21:07:48 +00:00
|
|
|
)
|
2015-11-21 23:16:08 +00:00
|
|
|
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/${_data_file}")
|
2015-01-15 21:07:48 +00:00
|
|
|
endforeach()
|
2015-11-21 23:16:08 +00:00
|
|
|
|
2018-01-23 20:05:10 +00:00
|
|
|
file(GLOB _dtds_src_files RELATIVE "${CMAKE_SOURCE_DIR}" "dtds/*.dtd")
|
|
|
|
|
|
|
|
set (_dtds_data_files)
|
|
|
|
foreach(_data_file ${_dtds_src_files})
|
|
|
|
list(APPEND _dtds_data_files "${DATAFILE_DIR}/${_data_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_dtds_data_files}
|
2018-06-06 10:39:07 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/dtds"
|
2018-05-10 12:54:31 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2018-01-23 20:05:10 +00:00
|
|
|
${_dtds_src_files}
|
|
|
|
"${DATAFILE_DIR}/dtds"
|
|
|
|
VERBATIM
|
2018-06-06 10:39:07 +00:00
|
|
|
DEPENDS ${_dtds_src_files}
|
2018-01-23 20:05:10 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB _diameter_src_files RELATIVE "${CMAKE_SOURCE_DIR}"
|
|
|
|
diameter/*.dtd
|
|
|
|
diameter/*.xml
|
|
|
|
)
|
|
|
|
|
|
|
|
set (_diameter_data_files)
|
|
|
|
foreach(_data_file ${_diameter_src_files})
|
|
|
|
list(APPEND _diameter_data_files "${DATAFILE_DIR}/${_data_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_diameter_data_files}
|
2018-06-06 10:39:07 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/diameter"
|
2018-05-10 12:54:31 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2018-01-23 20:05:10 +00:00
|
|
|
${_diameter_src_files}
|
|
|
|
"${DATAFILE_DIR}/diameter"
|
|
|
|
VERBATIM
|
2018-06-06 10:39:07 +00:00
|
|
|
DEPENDS ${_diameter_src_files}
|
2018-01-23 20:05:10 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB _radius_src_files RELATIVE "${CMAKE_SOURCE_DIR}"
|
|
|
|
radius/README.radius_dictionary
|
|
|
|
radius/custom.includes
|
|
|
|
radius/dictionary
|
|
|
|
radius/dictionary.*
|
|
|
|
)
|
|
|
|
|
|
|
|
set (_radius_data_files)
|
|
|
|
foreach(_data_file ${_radius_src_files})
|
|
|
|
list(APPEND _radius_data_files "${DATAFILE_DIR}/${_data_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_radius_data_files}
|
2018-06-06 10:39:07 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/radius"
|
2018-05-10 12:54:31 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2018-01-23 20:05:10 +00:00
|
|
|
${_radius_src_files}
|
|
|
|
"${DATAFILE_DIR}/radius"
|
|
|
|
VERBATIM
|
2018-06-06 10:39:07 +00:00
|
|
|
DEPENDS ${_radius_src_files}
|
2018-01-23 20:05:10 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB _profiles_src_files RELATIVE "${CMAKE_SOURCE_DIR}" profiles/*/*)
|
|
|
|
set (_profiles_data_files)
|
|
|
|
foreach(_data_file ${_profiles_src_files})
|
|
|
|
list(APPEND _profiles_data_files "${DATAFILE_DIR}/${_data_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_profiles_data_files}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
"${CMAKE_SOURCE_DIR}/profiles" "${DATAFILE_DIR}/profiles"
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND copy_data_files_depends
|
|
|
|
${_dtds_data_files}
|
|
|
|
${_diameter_data_files}
|
|
|
|
${_radius_data_files}
|
|
|
|
${_profiles_data_files}
|
|
|
|
)
|
|
|
|
|
2015-11-25 10:08:16 +00:00
|
|
|
# Copy files including ${INSTALL_FILES} and ${INSTALL_DIRS} to ${DATAFILE_DIR}
|
2018-01-23 20:05:10 +00:00
|
|
|
add_custom_target(copy_data_files ALL DEPENDS ${copy_data_files_depends} )
|
2015-11-25 10:08:16 +00:00
|
|
|
set_target_properties(copy_data_files PROPERTIES FOLDER "Copy Tasks")
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2019-01-12 11:43:18 +00:00
|
|
|
|
|
|
|
# Shared code, build object files once for all users.
|
|
|
|
add_library(version_info OBJECT version_info.c)
|
2019-01-10 01:45:00 +00:00
|
|
|
target_include_directories(version_info SYSTEM PRIVATE ${VERSION_INFO_INCLUDE_DIRS})
|
2019-07-27 16:10:39 +00:00
|
|
|
if(NOT VCSVERSION_OVERRIDE)
|
|
|
|
add_dependencies(version_info version)
|
|
|
|
endif()
|
2019-01-12 11:43:18 +00:00
|
|
|
# sources common for wireshark, tshark, rawshark and sharkd
|
|
|
|
add_library(shark_common OBJECT
|
|
|
|
cfile.c
|
|
|
|
extcap.c
|
|
|
|
extcap_parser.c
|
|
|
|
file_packet_provider.c
|
|
|
|
frame_tvbuff.c
|
|
|
|
sync_pipe_write.c
|
|
|
|
)
|
|
|
|
add_library(cli_main OBJECT cli_main.c)
|
|
|
|
add_library(capture_opts OBJECT capture_opts.c)
|
2019-01-10 01:45:00 +00:00
|
|
|
target_include_directories(capture_opts SYSTEM PRIVATE ${PCAP_INCLUDE_DIRS})
|
2019-01-12 11:43:18 +00:00
|
|
|
set_target_properties(version_info shark_common cli_main capture_opts
|
|
|
|
PROPERTIES
|
|
|
|
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2018-04-05 06:59:12 +00:00
|
|
|
if(BUILD_wireshark AND QT_FOUND)
|
2014-07-31 21:17:07 +00:00
|
|
|
set(WIRESHARK_SRC
|
2009-09-08 07:03:57 +00:00
|
|
|
file.c
|
|
|
|
fileset.c
|
2013-10-11 10:32:11 +00:00
|
|
|
${PLATFORM_UI_SRC}
|
2014-07-31 21:17:07 +00:00
|
|
|
)
|
|
|
|
set(wireshark_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:capture_opts>
|
2019-01-12 15:33:39 +00:00
|
|
|
$<TARGET_OBJECTS:qtui>
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:shark_common>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2014-07-31 21:17:07 +00:00
|
|
|
${WIRESHARK_SRC}
|
2015-01-07 10:17:14 +00:00
|
|
|
${PLATFORM_UI_RC_FILES}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(wireshark "Wireshark" UNIQUE_RC)
|
2012-02-02 00:46:02 +00:00
|
|
|
endif()
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2014-10-23 15:41:39 +00:00
|
|
|
#
|
|
|
|
# Add -Wl,-single_module to the LDFLAGS used with shared
|
|
|
|
# libraries, to fix some error that show up in some cases;
|
|
|
|
# some Apple documentation recommends it for most shared
|
|
|
|
# libraries.
|
|
|
|
#
|
|
|
|
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-single_module ${CMAKE_SHARED_LINKER_FLAGS}" )
|
|
|
|
#
|
|
|
|
# Add -Wl,-headerpad_max_install_names to the LDFLAGS, as
|
|
|
|
# code-signing issues is running out of padding space.
|
|
|
|
#
|
|
|
|
# Add -Wl,-search_paths_first to make sure that if we search
|
|
|
|
# directories A and B, in that order, for a given library, a
|
|
|
|
# non-shared version in directory A, rather than a shared
|
|
|
|
# version in directory B, is chosen (so we can use
|
|
|
|
# --with-pcap=/usr/local to force all programs to be linked
|
|
|
|
# with a static version installed in /usr/local/lib rather than
|
|
|
|
# the system version in /usr/lib).
|
|
|
|
#
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS
|
2015-07-13 02:54:15 +00:00
|
|
|
"-Wl,-headerpad_max_install_names -Wl,-search_paths_first ${CMAKE_EXE_LINKER_FLAGS}"
|
2014-10-23 15:41:39 +00:00
|
|
|
)
|
|
|
|
|
2018-12-20 00:46:40 +00:00
|
|
|
# Create our Frameworks directory
|
|
|
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}/Wireshark.app/Contents/Frameworks")
|
|
|
|
|
2014-10-23 15:41:39 +00:00
|
|
|
# Add files to the app bundle
|
2014-10-09 18:37:27 +00:00
|
|
|
# Wireshark.app/Contents
|
2015-02-01 21:56:39 +00:00
|
|
|
file(WRITE ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo "APPLWshk\n")
|
2014-10-09 18:37:27 +00:00
|
|
|
set(BUNDLE_CONTENTS_FILES
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo
|
|
|
|
)
|
|
|
|
set_source_files_properties(${BUNDLE_CONTENTS_FILES} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION .
|
|
|
|
)
|
|
|
|
|
|
|
|
# Wireshark.app/Contents/Resources
|
|
|
|
set(BUNDLE_RESOURCE_FILES
|
2016-03-11 21:45:54 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/Wireshark.icns
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/Wiresharkdoc.icns
|
2014-10-09 18:37:27 +00:00
|
|
|
)
|
|
|
|
set_source_files_properties(${BUNDLE_RESOURCE_FILES} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources
|
|
|
|
)
|
|
|
|
|
2014-10-10 15:32:51 +00:00
|
|
|
# Wireshark.app/Contents/Resources/share/man/man1
|
|
|
|
set_source_files_properties(${BUNDLE_RESOURCE_SHARE_MAN1_FILES} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources/share/man/man1
|
2016-10-12 19:55:54 +00:00
|
|
|
GENERATED 1
|
2014-10-10 15:32:51 +00:00
|
|
|
)
|
|
|
|
|
2016-10-27 15:54:41 +00:00
|
|
|
# Wireshark.app/Contents/Resources/share/man/man4
|
2014-10-10 15:32:51 +00:00
|
|
|
set_source_files_properties(${BUNDLE_RESOURCE_SHARE_MAN4_FILES} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources/share/man/man4
|
2016-10-12 19:55:54 +00:00
|
|
|
GENERATED 1
|
2014-10-10 15:32:51 +00:00
|
|
|
)
|
|
|
|
|
2015-01-15 21:07:48 +00:00
|
|
|
# INSTALL_FILES and INSTALL_DIRS are handled by copy_data_files
|
2014-10-10 15:32:51 +00:00
|
|
|
|
|
|
|
set(EXTRA_BUNDLE_FILES
|
|
|
|
${BUNDLE_CONTENTS_FILES}
|
|
|
|
${BUNDLE_RESOURCE_FILES}
|
|
|
|
${BUNDLE_RESOURCE_SHARE_MAN1_FILES}
|
|
|
|
${BUNDLE_RESOURCE_SHARE_MAN4_FILES}
|
|
|
|
)
|
2014-10-09 18:37:27 +00:00
|
|
|
else()
|
|
|
|
set(EXTRA_BUNDLE_FILES)
|
|
|
|
endif()
|
|
|
|
|
2014-08-28 23:48:53 +00:00
|
|
|
if(BUILD_wireshark AND QT_FOUND)
|
|
|
|
set(wireshark_LIBS
|
2012-09-15 02:52:29 +00:00
|
|
|
ui
|
2014-06-23 23:48:41 +00:00
|
|
|
capchild
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils
|
2018-08-23 21:03:28 +00:00
|
|
|
wiretap
|
2018-11-27 19:37:33 +00:00
|
|
|
epan
|
2019-01-10 01:45:00 +00:00
|
|
|
${QT_LIBRARIES}
|
2018-11-27 19:37:33 +00:00
|
|
|
${VERSION_INFO_LIBS}
|
2012-11-22 18:19:37 +00:00
|
|
|
${APPLE_APPLICATION_SERVICES_LIBRARY}
|
2018-04-09 09:39:49 +00:00
|
|
|
${APPLE_APPKIT_LIBRARY}
|
2012-11-22 16:49:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2019-11-15 21:30:19 +00:00
|
|
|
${SPARKLE_LIBRARIES}
|
2019-04-30 22:48:06 +00:00
|
|
|
${WIN_WS2_32_LIBRARY}
|
2016-08-03 19:14:23 +00:00
|
|
|
${WIN_VERSION_LIBRARY}
|
2018-11-27 19:37:33 +00:00
|
|
|
${WINSPARKLE_LIBRARIES}
|
2019-01-12 15:33:39 +00:00
|
|
|
$<$<BOOL:${WIN32}>:UxTheme.lib>
|
2019-02-02 14:52:07 +00:00
|
|
|
${SPEEXDSP_LIBRARIES}
|
2019-07-10 22:25:45 +00:00
|
|
|
${MINIZIP_LIBRARIES}
|
2012-02-02 00:46:02 +00:00
|
|
|
)
|
|
|
|
|
2018-06-07 20:04:38 +00:00
|
|
|
add_executable(wireshark WIN32 MACOSX_BUNDLE ${wireshark_FILES} ${EXTRA_BUNDLE_FILES})
|
2019-09-12 14:21:16 +00:00
|
|
|
if(WIN32)
|
|
|
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT wireshark)
|
|
|
|
endif()
|
2015-02-01 21:56:39 +00:00
|
|
|
set(PROGLIST ${PROGLIST} wireshark)
|
2017-09-24 01:30:08 +00:00
|
|
|
set_target_properties(wireshark PROPERTIES
|
Revert "Use CMAKE_EXE_LINKER_FLAGS to set link flags on executables."
This reverts commit 84447550efdad68acfc69281750ed016f7f96716.
Reason for revert: CMake's documentation for the flags variables is
close to content-free, giving no indication what the link flags used
in the link will be, given a combination of various CMAKE.*LINKER_FLAGS
variables and LINK_FLAGS properties. That makes it extremely difficult
to determine why this change happens to cause some executables to
be linked with "/INCREMENTAL" and others to be linked with
"/INCREMENTAL:YES", even though we add "/INCREMENTAL:NO" to
WS_LINK_FLAGS and add WS_LINK_FLAGS to CMAKE_EXE_LINKER_FLAGS - or
why *not* setting CMAKE_EXE_LINKER_FLAGS and instead using LINK_FLAGS
*doesn't* cause that to happen.
Maybe it's an issue of CMAKE_EXE_LINKER_FLAGS vs.
CMAKE_EXE_LINKER_FLAGS_<CONFIG>, but the documentation doesn't
clearly indicate whether, for example, the link flags for a particular
executable target are a combination of CMAKE_EXE_LINKER_FLAGS, the
CMAKE_EXE_LINKER_FLAGS_<CONFIG> flag for the configuration of this
build, and the LINK_FLAGS property of the target, if any. That's
the most *obvious* behavior to implement, but if that's the behavior
that's implemented, I'm not sure why the change being reverted had the
effect it did.
Change-Id: I6a73fe88be65378d506a89460f7362076233f319
Reviewed-on: https://code.wireshark.org/review/30023
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
2018-10-04 18:09:14 +00:00
|
|
|
LINK_FLAGS "${WS_LINK_FLAGS}"
|
2017-09-24 01:30:08 +00:00
|
|
|
FOLDER "Executables"
|
2019-01-21 10:56:57 +00:00
|
|
|
INSTALL_RPATH "${EXECUTABLE_INSTALL_RPATH}"
|
2017-09-24 01:30:08 +00:00
|
|
|
)
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE OR WIN32)
|
|
|
|
set_target_properties(wireshark PROPERTIES OUTPUT_NAME Wireshark)
|
|
|
|
endif()
|
2015-02-01 21:56:39 +00:00
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2016-10-19 13:54:32 +00:00
|
|
|
add_dependencies(wireshark manpages)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_target_properties(
|
|
|
|
wireshark PROPERTIES
|
|
|
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/packaging/macosx/Info.plist
|
|
|
|
)
|
2018-06-15 10:44:47 +00:00
|
|
|
if(CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
# Add a wrapper script which opens the bundle. This adds
|
|
|
|
# convenience but makes debugging more difficult.
|
|
|
|
# It is not created if using Xcode
|
2019-05-03 19:20:47 +00:00
|
|
|
# XXX Running run/Wireshark.app/Contents/MacOS/Wireshark works
|
|
|
|
# fine for me (Gerald) here on Mojave. Can we just make this a
|
|
|
|
# symlink?
|
2018-06-15 10:44:47 +00:00
|
|
|
file(REMOVE ${CMAKE_BINARY_DIR}/run/wireshark)
|
|
|
|
file(WRITE ${CMAKE_BINARY_DIR}/run/wireshark "#!/bin/sh\n")
|
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "# Generated by ${CMAKE_CURRENT_LIST_FILE}\n")
|
2019-05-03 19:20:47 +00:00
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "# Wrapper script which should work around the issue described at\n")
|
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "# https://stackoverflow.com/questions/25318524/what-exactly-should-i-pass-to-nsapp-activateignoringotherapps-to-get-my-appl\n")
|
2018-06-15 10:44:47 +00:00
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "exec ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/MacOS/Wireshark \"\$\@\"\n")
|
|
|
|
execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/wireshark)
|
|
|
|
endif()
|
2014-10-09 18:37:27 +00:00
|
|
|
endif()
|
|
|
|
|
2015-07-15 23:46:51 +00:00
|
|
|
target_link_libraries(wireshark ${wireshark_LIBS})
|
2019-11-15 21:30:19 +00:00
|
|
|
target_include_directories(wireshark SYSTEM PRIVATE ${SPARKLE_INCLUDE_DIRS})
|
2019-01-10 01:45:00 +00:00
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
install(
|
|
|
|
TARGETS wireshark
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
)
|
2014-09-05 18:17:17 +00:00
|
|
|
|
2018-06-20 22:59:41 +00:00
|
|
|
if(QT_WINDEPLOYQT_EXECUTABLE)
|
|
|
|
add_custom_target(copy_qt_dlls ALL)
|
|
|
|
set_target_properties(copy_qt_dlls PROPERTIES FOLDER "Copy Tasks")
|
|
|
|
# Will we ever need to use --debug? Windeployqt seems to
|
|
|
|
# be smart enough to copy debug DLLs when needed.
|
|
|
|
add_custom_command(TARGET copy_qt_dlls
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND set "PATH=${QT_BIN_PATH};%PATH%"
|
|
|
|
COMMAND "${QT_WINDEPLOYQT_EXECUTABLE}"
|
|
|
|
$<$<CONFIG:Debug>:--debug>
|
|
|
|
$<$<NOT:$<CONFIG:Debug>>:--release>
|
|
|
|
--no-compiler-runtime
|
|
|
|
--verbose 10
|
2019-02-06 22:11:07 +00:00
|
|
|
${QT_WINDEPLOYQT_EXTRA_OPTS}
|
2018-06-20 22:59:41 +00:00
|
|
|
"$<TARGET_FILE:wireshark>"
|
2015-01-15 16:34:52 +00:00
|
|
|
)
|
2018-06-20 22:59:41 +00:00
|
|
|
add_dependencies(copy_qt_dlls wireshark)
|
2018-11-23 20:39:42 +00:00
|
|
|
|
|
|
|
install(CODE "execute_process(COMMAND
|
|
|
|
\"${QT_WINDEPLOYQT_EXECUTABLE}\"
|
|
|
|
--no-compiler-runtime
|
|
|
|
\"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/Wireshark.exe\")"
|
|
|
|
)
|
|
|
|
|
2018-06-20 22:59:41 +00:00
|
|
|
endif(QT_WINDEPLOYQT_EXECUTABLE)
|
2014-09-05 18:17:17 +00:00
|
|
|
endif()
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
# Common properties for CLI executables
|
|
|
|
macro(set_extra_executable_properties _executable _folder)
|
|
|
|
set_target_properties(${_executable} PROPERTIES
|
Revert "Use CMAKE_EXE_LINKER_FLAGS to set link flags on executables."
This reverts commit 84447550efdad68acfc69281750ed016f7f96716.
Reason for revert: CMake's documentation for the flags variables is
close to content-free, giving no indication what the link flags used
in the link will be, given a combination of various CMAKE.*LINKER_FLAGS
variables and LINK_FLAGS properties. That makes it extremely difficult
to determine why this change happens to cause some executables to
be linked with "/INCREMENTAL" and others to be linked with
"/INCREMENTAL:YES", even though we add "/INCREMENTAL:NO" to
WS_LINK_FLAGS and add WS_LINK_FLAGS to CMAKE_EXE_LINKER_FLAGS - or
why *not* setting CMAKE_EXE_LINKER_FLAGS and instead using LINK_FLAGS
*doesn't* cause that to happen.
Maybe it's an issue of CMAKE_EXE_LINKER_FLAGS vs.
CMAKE_EXE_LINKER_FLAGS_<CONFIG>, but the documentation doesn't
clearly indicate whether, for example, the link flags for a particular
executable target are a combination of CMAKE_EXE_LINKER_FLAGS, the
CMAKE_EXE_LINKER_FLAGS_<CONFIG> flag for the configuration of this
build, and the LINK_FLAGS property of the target, if any. That's
the most *obvious* behavior to implement, but if that's the behavior
that's implemented, I'm not sure why the change being reverted had the
effect it did.
Change-Id: I6a73fe88be65378d506a89460f7362076233f319
Reviewed-on: https://code.wireshark.org/review/30023
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
2018-10-04 18:09:14 +00:00
|
|
|
LINK_FLAGS "${WILDCARD_OBJ} ${WS_LINK_FLAGS}"
|
2014-10-09 18:37:27 +00:00
|
|
|
FOLDER ${_folder}
|
2019-01-21 10:56:57 +00:00
|
|
|
INSTALL_RPATH "${EXECUTABLE_INSTALL_RPATH}"
|
2014-10-09 18:37:27 +00:00
|
|
|
)
|
|
|
|
|
2015-02-01 21:56:39 +00:00
|
|
|
set(PROGLIST ${PROGLIST} ${_executable})
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2018-06-15 10:44:47 +00:00
|
|
|
if(NOT CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
# Xcode
|
|
|
|
set_target_properties(${_executable} PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY run/$<CONFIG>/Wireshark.app/Contents/MacOS
|
|
|
|
)
|
|
|
|
else ()
|
|
|
|
set_target_properties(${_executable} PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY run/Wireshark.app/Contents/MacOS
|
|
|
|
)
|
2019-05-03 19:20:47 +00:00
|
|
|
# Create a convenience link from run/<name> to its respective
|
|
|
|
# target in the application bundle.
|
|
|
|
add_custom_target(${_executable}-symlink
|
|
|
|
COMMAND ln -s -f
|
|
|
|
Wireshark.app/Contents/MacOS/${_executable}
|
|
|
|
${CMAKE_BINARY_DIR}/run/${_executable}
|
|
|
|
)
|
|
|
|
add_dependencies(${_executable} ${_executable}-symlink)
|
2018-06-15 10:44:47 +00:00
|
|
|
endif()
|
2014-10-09 18:37:27 +00:00
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
2012-01-12 19:16:15 +00:00
|
|
|
register_tap_files(tshark-tap-register.c
|
|
|
|
${TSHARK_TAP_SRC}
|
|
|
|
)
|
|
|
|
|
2009-08-29 09:13:28 +00:00
|
|
|
if(BUILD_tshark)
|
2009-09-08 07:03:57 +00:00
|
|
|
set(tshark_LIBS
|
2013-06-26 02:12:12 +00:00
|
|
|
ui
|
2014-06-23 23:48:41 +00:00
|
|
|
capchild
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils
|
2018-08-23 21:03:28 +00:00
|
|
|
wiretap
|
2018-11-27 19:37:33 +00:00
|
|
|
epan
|
|
|
|
${VERSION_INFO_LIBS}
|
2012-11-22 16:49:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2019-04-30 22:48:06 +00:00
|
|
|
${WIN_WS2_32_LIBRARY}
|
2018-11-27 19:37:33 +00:00
|
|
|
${M_LIBRARIES}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
set(tshark_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:capture_opts>
|
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:shark_common>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2009-09-08 07:03:57 +00:00
|
|
|
tshark-tap-register.c
|
|
|
|
tshark.c
|
|
|
|
${TSHARK_TAP_SRC}
|
|
|
|
)
|
2018-04-09 10:31:38 +00:00
|
|
|
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(tshark "TShark" UNIQUE_RC)
|
2009-09-08 07:03:57 +00:00
|
|
|
add_executable(tshark ${tshark_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(tshark "Executables")
|
2009-09-08 07:03:57 +00:00
|
|
|
target_link_libraries(tshark ${tshark_LIBS})
|
|
|
|
install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2006-10-24 17:39:32 +00:00
|
|
|
|
2014-01-08 04:35:28 +00:00
|
|
|
if(BUILD_tfshark)
|
|
|
|
set(tfshark_LIBS
|
2020-01-17 14:06:51 +00:00
|
|
|
m
|
2014-01-08 04:35:28 +00:00
|
|
|
ui
|
2018-08-23 21:03:28 +00:00
|
|
|
wiretap
|
2018-11-27 19:37:33 +00:00
|
|
|
epan
|
|
|
|
${VERSION_INFO_LIBS}
|
2014-01-08 04:35:28 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
|
|
|
)
|
|
|
|
set(tfshark_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:shark_common>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2014-01-08 04:35:28 +00:00
|
|
|
tfshark.c
|
|
|
|
${TSHARK_TAP_SRC}
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(tfshark "TFShark")
|
2014-01-08 04:35:28 +00:00
|
|
|
add_executable(tfshark ${tfshark_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(tfshark "Executables")
|
2014-01-08 04:35:28 +00:00
|
|
|
target_link_libraries(tfshark ${tfshark_LIBS})
|
|
|
|
install(TARGETS tfshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2011-08-29 19:18:28 +00:00
|
|
|
if(BUILD_rawshark AND PCAP_FOUND)
|
2009-09-08 07:03:57 +00:00
|
|
|
set(rawshark_LIBS
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils
|
2017-04-08 21:44:00 +00:00
|
|
|
ui
|
2018-08-23 21:03:28 +00:00
|
|
|
wiretap
|
2018-11-27 19:37:33 +00:00
|
|
|
epan
|
|
|
|
${VERSION_INFO_LIBS}
|
2012-11-22 16:49:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2019-04-30 22:48:06 +00:00
|
|
|
${WIN_WS2_32_LIBRARY}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
set(rawshark_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:shark_common>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2009-09-08 07:03:57 +00:00
|
|
|
rawshark.c
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(rawshark "Rawshark")
|
2009-09-08 07:03:57 +00:00
|
|
|
add_executable(rawshark ${rawshark_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(rawshark "Executables")
|
2009-09-08 07:03:57 +00:00
|
|
|
target_link_libraries(rawshark ${rawshark_LIBS})
|
|
|
|
install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-29 09:13:28 +00:00
|
|
|
endif()
|
|
|
|
|
2016-10-15 18:48:17 +00:00
|
|
|
if(BUILD_sharkd)
|
|
|
|
set(sharkd_LIBS
|
|
|
|
ui
|
2018-08-23 21:03:28 +00:00
|
|
|
wiretap
|
2018-11-27 19:37:33 +00:00
|
|
|
epan
|
|
|
|
${VERSION_INFO_LIBS}
|
2016-10-15 18:48:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2019-04-30 22:48:06 +00:00
|
|
|
${WIN_WS2_32_LIBRARY}
|
2019-02-02 14:52:07 +00:00
|
|
|
${SPEEXDSP_LIBRARIES}
|
2019-06-13 04:33:55 +00:00
|
|
|
${M_LIBRARIES}
|
2016-10-15 18:48:17 +00:00
|
|
|
)
|
|
|
|
set(sharkd_FILES
|
2018-12-12 10:53:08 +00:00
|
|
|
#
|
|
|
|
# XXX - currently doesn't work on Windows if it uses
|
2019-01-12 11:43:18 +00:00
|
|
|
# $<TARGET_OBJECTS:cli_main> and has real_main().
|
2018-12-12 10:53:08 +00:00
|
|
|
#
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:shark_common>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2016-10-15 18:48:17 +00:00
|
|
|
sharkd.c
|
|
|
|
sharkd_daemon.c
|
|
|
|
sharkd_session.c
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(sharkd "SharkD")
|
2016-10-15 18:48:17 +00:00
|
|
|
add_executable(sharkd ${sharkd_FILES})
|
|
|
|
set_extra_executable_properties(sharkd "Executables")
|
|
|
|
target_link_libraries(sharkd ${sharkd_LIBS})
|
2019-02-02 14:52:07 +00:00
|
|
|
target_include_directories(sharkd SYSTEM
|
|
|
|
PUBLIC
|
|
|
|
${SPEEXDSP_INCLUDE_DIRS}
|
|
|
|
)
|
2018-11-27 19:37:33 +00:00
|
|
|
|
2016-10-15 18:48:17 +00:00
|
|
|
install(TARGETS sharkd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2009-09-08 07:03:57 +00:00
|
|
|
if(BUILD_dftest)
|
|
|
|
set(dftest_LIBS
|
2017-04-08 21:59:31 +00:00
|
|
|
ui
|
2018-08-23 21:03:28 +00:00
|
|
|
wiretap
|
2018-11-27 19:37:33 +00:00
|
|
|
epan
|
|
|
|
${VERSION_INFO_LIBS}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
set(dftest_FILES
|
2012-02-19 08:59:17 +00:00
|
|
|
dftest.c
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
add_executable(dftest ${dftest_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(dftest "Tests")
|
2009-09-08 07:03:57 +00:00
|
|
|
target_link_libraries(dftest ${dftest_LIBS})
|
2009-08-29 09:13:28 +00:00
|
|
|
endif()
|
|
|
|
|
2009-09-08 07:03:57 +00:00
|
|
|
if(BUILD_randpkt)
|
|
|
|
set(randpkt_LIBS
|
2016-02-15 01:00:38 +00:00
|
|
|
randpkt_core
|
2017-04-20 21:07:06 +00:00
|
|
|
ui
|
2009-09-08 07:03:57 +00:00
|
|
|
wiretap
|
2013-10-13 09:21:55 +00:00
|
|
|
wsutil
|
2009-09-10 07:04:54 +00:00
|
|
|
${M_LIBRARIES}
|
2009-09-09 13:20:33 +00:00
|
|
|
${CARES_LIBRARIES}
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
set(randpkt_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2009-09-08 07:03:57 +00:00
|
|
|
randpkt.c
|
|
|
|
)
|
|
|
|
add_executable(randpkt ${randpkt_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(randpkt "Executables")
|
2009-09-08 07:03:57 +00:00
|
|
|
target_link_libraries(randpkt ${randpkt_LIBS})
|
|
|
|
install(TARGETS randpkt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2018-10-16 22:47:20 +00:00
|
|
|
if(BUILD_fuzzshark OR ENABLE_FUZZER OR OSS_FUZZ)
|
|
|
|
add_subdirectory(fuzz)
|
2017-12-06 20:10:29 +00:00
|
|
|
endif()
|
|
|
|
|
2009-06-16 05:52:16 +00:00
|
|
|
if(BUILD_text2pcap)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(text2pcap_LIBS
|
2016-03-24 20:00:07 +00:00
|
|
|
writecap
|
2012-12-18 22:56:06 +00:00
|
|
|
wsutil
|
2009-09-10 07:04:54 +00:00
|
|
|
${M_LIBRARIES}
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
2018-02-16 22:51:51 +00:00
|
|
|
set(text2pcap_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2009-09-02 16:33:01 +00:00
|
|
|
text2pcap.c
|
|
|
|
)
|
2018-02-16 22:51:51 +00:00
|
|
|
add_lex_files(text2pcap_LEX_FILES text2pcap_FILES
|
2009-09-02 16:33:01 +00:00
|
|
|
text2pcap-scanner.l
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(text2pcap "Text2pcap"
|
|
|
|
COPYRIGHT_INFO "2001 Ashok Narayanan <ashokn@cisco.com>")
|
|
|
|
add_executable(text2pcap ${text2pcap_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(text2pcap "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(text2pcap ${text2pcap_LIBS})
|
|
|
|
install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2009-06-16 05:52:16 +00:00
|
|
|
if(BUILD_mergecap)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(mergecap_LIBS
|
2017-04-20 20:25:21 +00:00
|
|
|
ui
|
2009-09-02 16:33:01 +00:00
|
|
|
wiretap
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2013-08-13 09:58:09 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
set(mergecap_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2009-09-02 16:33:01 +00:00
|
|
|
mergecap.c
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(mergecap "Mergecap")
|
2009-09-02 16:33:01 +00:00
|
|
|
add_executable(mergecap ${mergecap_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(mergecap "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(mergecap ${mergecap_LIBS})
|
|
|
|
install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2012-09-24 10:23:20 +00:00
|
|
|
if(BUILD_reordercap)
|
|
|
|
set(reordercap_LIBS
|
2017-04-20 07:19:01 +00:00
|
|
|
ui
|
2012-09-24 10:23:20 +00:00
|
|
|
wiretap
|
|
|
|
${ZLIB_LIBRARIES}
|
2013-08-13 09:58:09 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2012-09-24 10:23:20 +00:00
|
|
|
)
|
|
|
|
set(reordercap_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2012-09-24 10:23:20 +00:00
|
|
|
reordercap.c
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(reordercap "Reordercap")
|
2012-09-24 10:23:20 +00:00
|
|
|
add_executable(reordercap ${reordercap_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(reordercap "Executables")
|
2012-09-24 10:23:20 +00:00
|
|
|
target_link_libraries(reordercap ${reordercap_LIBS})
|
|
|
|
install(TARGETS reordercap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2009-06-16 05:52:16 +00:00
|
|
|
if(BUILD_capinfos)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(capinfos_LIBS
|
2017-04-20 07:19:01 +00:00
|
|
|
ui
|
2009-09-02 16:33:01 +00:00
|
|
|
wiretap
|
2012-10-03 17:31:23 +00:00
|
|
|
wsutil
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2009-12-08 11:04:52 +00:00
|
|
|
${GCRYPT_LIBRARIES}
|
2013-08-13 09:58:09 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
set(capinfos_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2009-09-02 16:33:01 +00:00
|
|
|
capinfos.c
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(capinfos "Capinfos")
|
2009-09-02 16:33:01 +00:00
|
|
|
add_executable(capinfos ${capinfos_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(capinfos "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(capinfos ${capinfos_LIBS})
|
|
|
|
install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2013-12-13 02:59:16 +00:00
|
|
|
if(BUILD_captype)
|
|
|
|
set(captype_LIBS
|
2017-04-20 07:19:01 +00:00
|
|
|
ui
|
2013-12-13 02:59:16 +00:00
|
|
|
wiretap
|
|
|
|
wsutil
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
)
|
|
|
|
set(captype_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2013-12-13 02:59:16 +00:00
|
|
|
captype.c
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(captype "Captype")
|
2013-12-13 02:59:16 +00:00
|
|
|
add_executable(captype ${captype_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(captype "Executables")
|
2013-12-13 02:59:16 +00:00
|
|
|
target_link_libraries(captype ${captype_LIBS})
|
|
|
|
install(TARGETS captype RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2009-06-16 05:52:16 +00:00
|
|
|
if(BUILD_editcap)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(editcap_LIBS
|
2017-04-20 03:25:59 +00:00
|
|
|
ui
|
2009-09-02 16:33:01 +00:00
|
|
|
wiretap
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2017-02-13 18:31:26 +00:00
|
|
|
${GCRYPT_LIBRARIES}
|
2013-08-13 09:58:09 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
set(editcap_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2009-09-02 16:33:01 +00:00
|
|
|
editcap.c
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(editcap "Editcap")
|
2009-09-02 16:33:01 +00:00
|
|
|
add_executable(editcap ${editcap_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(editcap "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(editcap ${editcap_LIBS})
|
|
|
|
install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2011-08-29 19:18:28 +00:00
|
|
|
if(BUILD_dumpcap AND PCAP_FOUND)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(dumpcap_LIBS
|
2016-03-24 20:00:07 +00:00
|
|
|
writecap
|
2011-01-18 17:49:41 +00:00
|
|
|
wsutil
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils
|
2017-04-09 04:24:45 +00:00
|
|
|
ui
|
2019-09-22 12:35:27 +00:00
|
|
|
pcap::pcap
|
2009-09-12 17:20:08 +00:00
|
|
|
${CAP_LIBRARIES}
|
2011-01-18 17:49:41 +00:00
|
|
|
${GLIB2_LIBRARIES}
|
2011-05-12 21:13:00 +00:00
|
|
|
${GTHREAD2_LIBRARIES}
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2012-11-22 16:49:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2019-04-30 22:48:06 +00:00
|
|
|
${WIN_WS2_32_LIBRARY}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
set(dumpcap_FILES
|
2019-01-12 11:43:18 +00:00
|
|
|
$<TARGET_OBJECTS:capture_opts>
|
|
|
|
$<TARGET_OBJECTS:cli_main>
|
|
|
|
$<TARGET_OBJECTS:version_info>
|
2009-09-02 16:33:01 +00:00
|
|
|
dumpcap.c
|
|
|
|
ringbuffer.c
|
|
|
|
sync_pipe_write.c
|
|
|
|
)
|
2018-10-08 23:34:39 +00:00
|
|
|
set_executable_resources(dumpcap "Dumpcap" UNIQUE_RC)
|
2009-09-02 16:33:01 +00:00
|
|
|
add_executable(dumpcap ${dumpcap_FILES})
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(dumpcap "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(dumpcap ${dumpcap_LIBS})
|
2014-01-19 00:48:22 +00:00
|
|
|
install(TARGETS dumpcap
|
2014-10-09 18:37:27 +00:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
2014-01-19 00:48:22 +00:00
|
|
|
PERMISSIONS ${DUMPCAP_SETUID}
|
|
|
|
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
|
|
|
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
|
)
|
2018-08-25 16:27:23 +00:00
|
|
|
if(ENABLE_DUMPCAP_GROUP)
|
|
|
|
install(CODE "execute_process(COMMAND chgrp ${DUMPCAP_INSTALL_GROUP} ${CMAKE_INSTALL_FULL_BINDIR}/dumpcap)")
|
|
|
|
install(CODE "execute_process(COMMAND chmod o-x ${CMAKE_INSTALL_FULL_BINDIR}/dumpcap)")
|
|
|
|
endif()
|
2014-01-19 00:48:22 +00:00
|
|
|
if(DUMPCAP_INSTALL_OPTION STREQUAL "capabilities")
|
|
|
|
install( CODE "execute_process(
|
|
|
|
COMMAND
|
|
|
|
${SETCAP_EXECUTABLE}
|
|
|
|
cap_net_raw,cap_net_admin+ep
|
|
|
|
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/dumpcap${CMAKE_EXECUTABLE_SUFFIX}
|
|
|
|
RESULT_VARIABLE
|
|
|
|
_SETCAP_RESULT
|
|
|
|
)
|
|
|
|
if( _SETCAP_RESULT )
|
2014-01-19 01:08:52 +00:00
|
|
|
message( WARNING \"setcap failed (${_SETCAP_RESULT}).\")
|
2014-01-19 00:48:22 +00:00
|
|
|
endif()"
|
|
|
|
)
|
|
|
|
endif()
|
2019-09-22 12:35:27 +00:00
|
|
|
elseif(BUILD_dumpcap AND ENABLE_PCAP)
|
|
|
|
message(WARNING "Dumpcap was requested but libpcap dependency is not available. "
|
|
|
|
"Wireshark will be built without packet capture capability.")
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-09-21 00:19:07 +00:00
|
|
|
|
2017-08-10 17:20:30 +00:00
|
|
|
# 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()
|
|
|
|
|
2015-01-06 23:07:50 +00:00
|
|
|
if (WIN32)
|
2015-12-04 17:02:35 +00:00
|
|
|
find_package( MSVC_REDIST )
|
|
|
|
|
2015-01-06 23:07:50 +00:00
|
|
|
# Must come after executable targets are defined.
|
|
|
|
find_package( NSIS )
|
|
|
|
|
2018-05-10 12:54:31 +00:00
|
|
|
if(MAKENSIS_EXECUTABLE)
|
2015-01-06 23:07:50 +00:00
|
|
|
add_subdirectory( packaging/nsis EXCLUDE_FROM_ALL )
|
|
|
|
ADD_NSIS_UNINSTALLER_TARGET()
|
|
|
|
ADD_NSIS_PACKAGE_TARGET()
|
|
|
|
endif()
|
2015-04-07 19:55:42 +00:00
|
|
|
|
2016-04-07 23:03:51 +00:00
|
|
|
find_package( WiX )
|
|
|
|
|
2018-05-10 12:54:31 +00:00
|
|
|
if(WIX_CANDLE_EXECUTABLE)
|
2016-04-07 23:03:51 +00:00
|
|
|
add_subdirectory( packaging/wix EXCLUDE_FROM_ALL )
|
|
|
|
ADD_WIX_PACKAGE_TARGET()
|
|
|
|
endif()
|
|
|
|
|
2015-04-07 19:55:42 +00:00
|
|
|
find_package( PortableApps )
|
2018-05-10 12:54:31 +00:00
|
|
|
if(PORTABLEAPPS_LAUNCHER_GENERATOR_EXECUTABLE AND PORTABLEAPPS_INSTALLER_EXECUTABLE)
|
2015-04-07 19:55:42 +00:00
|
|
|
add_subdirectory( packaging/portableapps EXCLUDE_FROM_ALL )
|
|
|
|
ADD_PORTABLEAPPS_PACKAGE_TARGET()
|
|
|
|
endif()
|
2015-01-06 23:07:50 +00:00
|
|
|
endif()
|
|
|
|
|
2018-02-09 01:20:26 +00:00
|
|
|
if (MAXMINDDB_FOUND)
|
|
|
|
set(mmdbresolve_LIBS
|
|
|
|
# Note: libmaxminddb is not GPL-2 compatible.
|
|
|
|
${MAXMINDDB_LIBRARY}
|
|
|
|
)
|
|
|
|
set(mmdbresolve_FILES
|
|
|
|
mmdbresolve.c
|
|
|
|
)
|
|
|
|
add_executable(mmdbresolve ${mmdbresolve_FILES})
|
|
|
|
set_extra_executable_properties(mmdbresolve "Executables")
|
|
|
|
target_link_libraries(mmdbresolve ${mmdbresolve_LIBS})
|
2019-01-10 01:45:00 +00:00
|
|
|
target_include_directories(mmdbresolve PUBLIC ${MAXMINDDB_INCLUDE_DIRS})
|
|
|
|
target_compile_definitions(mmdbresolve PUBLIC ${MAXMINDDB_DEFINITIONS})
|
2018-02-09 01:20:26 +00:00
|
|
|
install(TARGETS mmdbresolve RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2019-12-18 00:25:10 +00:00
|
|
|
# --preserve-xattr is undocumented but ensures that we install
|
|
|
|
# a signed ChmodBPF script.
|
2018-12-12 00:26:51 +00:00
|
|
|
set (install_chmodbpf_component_pkg "${CMAKE_BINARY_DIR}/install.ChmodBPF.pkg")
|
|
|
|
add_custom_command(OUTPUT "${install_chmodbpf_component_pkg}"
|
2019-12-19 16:58:35 +00:00
|
|
|
COMMAND find
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root"
|
|
|
|
-type d
|
|
|
|
-exec chmod 755 "{}" +
|
|
|
|
COMMAND chmod 644
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist"
|
|
|
|
COMMAND chmod 755
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF"
|
2019-12-18 17:33:23 +00:00
|
|
|
COMMAND "${CMAKE_SOURCE_DIR}/packaging/macosx/osx-extras.sh"
|
2018-12-12 00:26:51 +00:00
|
|
|
COMMAND pkgbuild
|
|
|
|
--identifier org.wireshark.ChmodBPF.pkg
|
|
|
|
--version 1.1
|
2019-12-18 00:25:10 +00:00
|
|
|
--preserve-xattr
|
2018-12-12 00:26:51 +00:00
|
|
|
--root "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root"
|
|
|
|
--scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-scripts"
|
|
|
|
${install_chmodbpf_component_pkg}
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF"
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/root/Library/LaunchDaemons/org.wireshark.ChmodBPF.plist"
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-scripts/postinstall"
|
|
|
|
)
|
|
|
|
set (install_chmodbpf_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Install ChmodBPF.pkg")
|
|
|
|
add_custom_command(OUTPUT "${install_chmodbpf_pkg}"
|
|
|
|
COMMAND productbuild
|
|
|
|
--identifier org.wireshark.install.ChmodBPF.product
|
|
|
|
--version 1.1
|
|
|
|
--distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-distribution.xml"
|
|
|
|
--package-path "${CMAKE_BINARY_DIR}"
|
|
|
|
${install_chmodbpf_pkg}
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/install-distribution.xml"
|
|
|
|
${install_chmodbpf_component_pkg}
|
|
|
|
)
|
|
|
|
|
|
|
|
set (uninstall_chmodbpf_component_pkg "${CMAKE_BINARY_DIR}/uninstall.ChmodBPF.pkg")
|
|
|
|
add_custom_command(OUTPUT "${uninstall_chmodbpf_component_pkg}"
|
|
|
|
COMMAND pkgbuild
|
|
|
|
--identifier org.wireshark.uninstall.ChmodBPF.pkg
|
|
|
|
--version 1.1
|
|
|
|
--nopayload
|
|
|
|
--scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-scripts"
|
|
|
|
${uninstall_chmodbpf_component_pkg}
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-scripts/postinstall"
|
|
|
|
)
|
|
|
|
set (uninstall_chmodbpf_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Uninstall ChmodBPF.pkg")
|
|
|
|
add_custom_command(OUTPUT "${uninstall_chmodbpf_pkg}"
|
|
|
|
COMMAND productbuild
|
|
|
|
--identifier org.wireshark.uninstall.ChmodBPF.product
|
|
|
|
--version 1.1
|
|
|
|
--distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-distribution.xml"
|
|
|
|
--package-path "${CMAKE_BINARY_DIR}"
|
|
|
|
${uninstall_chmodbpf_pkg}
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF/uninstall-distribution.xml"
|
|
|
|
${uninstall_chmodbpf_component_pkg}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(chmodbpf DEPENDS ${install_chmodbpf_pkg} ${uninstall_chmodbpf_pkg})
|
|
|
|
|
|
|
|
set (install_path_helper_component_pkg "${CMAKE_BINARY_DIR}/install.path_helper.pkg")
|
|
|
|
add_custom_command(OUTPUT "${install_path_helper_component_pkg}"
|
2019-12-19 16:58:35 +00:00
|
|
|
COMMAND find
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root"
|
|
|
|
-type d
|
|
|
|
-exec chmod 755 "{}" +
|
|
|
|
COMMAND find
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root"
|
|
|
|
-type f
|
|
|
|
-exec chmod 644 "{}" +
|
2018-12-12 00:26:51 +00:00
|
|
|
COMMAND pkgbuild
|
|
|
|
--identifier org.wireshark.path_helper.pkg
|
|
|
|
--version 1.0
|
|
|
|
--root "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc"
|
|
|
|
--install-location /private/etc
|
|
|
|
${install_path_helper_component_pkg}
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc/paths.d/Wireshark"
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/root/etc/manpaths.d/Wireshark"
|
|
|
|
)
|
|
|
|
set (install_path_helper_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Add Wireshark to the system path.pkg")
|
|
|
|
add_custom_command(OUTPUT "${install_path_helper_pkg}"
|
|
|
|
COMMAND productbuild
|
|
|
|
--identifier org.wireshark.install.path_helper.product
|
|
|
|
--version 1.0
|
|
|
|
--distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/install-distribution.xml"
|
|
|
|
--package-path "${CMAKE_BINARY_DIR}"
|
|
|
|
${install_path_helper_pkg}
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/install-distribution.xml"
|
|
|
|
${install_path_helper_component_pkg}
|
|
|
|
)
|
|
|
|
|
|
|
|
set (uninstall_path_helper_component_pkg "${CMAKE_BINARY_DIR}/uninstall.path_helper.pkg")
|
|
|
|
add_custom_command(OUTPUT "${uninstall_path_helper_component_pkg}"
|
|
|
|
COMMAND pkgbuild
|
|
|
|
--identifier org.wireshark.uninstall.path_helper.pkg
|
|
|
|
--version 1.0
|
|
|
|
--nopayload
|
|
|
|
--scripts "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-scripts"
|
|
|
|
${uninstall_path_helper_component_pkg}
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-scripts/postinstall"
|
|
|
|
)
|
|
|
|
set (uninstall_path_helper_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Remove Wireshark from the system path.pkg")
|
|
|
|
add_custom_command(OUTPUT "${uninstall_path_helper_pkg}"
|
|
|
|
COMMAND productbuild
|
|
|
|
--identifier org.wireshark.uninstall.path_helper.product
|
|
|
|
--version 1.0
|
|
|
|
--distribution "${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-distribution.xml"
|
|
|
|
--package-path "${CMAKE_BINARY_DIR}"
|
|
|
|
${uninstall_path_helper_pkg}
|
|
|
|
DEPENDS
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/path_helper/uninstall-distribution.xml
|
|
|
|
${uninstall_path_helper_component_pkg}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(path_helper DEPENDS ${install_path_helper_pkg} ${uninstall_path_helper_pkg})
|
|
|
|
|
2015-02-04 00:02:52 +00:00
|
|
|
add_custom_target(app_bundle)
|
2015-02-01 21:56:39 +00:00
|
|
|
set_target_properties(app_bundle PROPERTIES FOLDER "Copy Tasks")
|
|
|
|
add_custom_command(TARGET app_bundle
|
|
|
|
POST_BUILD
|
2017-10-04 23:27:08 +00:00
|
|
|
COMMAND "${CMAKE_BINARY_DIR}/packaging/macosx/osx-app.sh"
|
2015-02-01 21:56:39 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/run"
|
|
|
|
)
|
2018-12-12 00:26:51 +00:00
|
|
|
add_dependencies(app_bundle ${PROGLIST} chmodbpf path_helper)
|
2014-10-23 17:57:45 +00:00
|
|
|
|
2020-03-03 16:28:39 +00:00
|
|
|
add_custom_target(dmg_package_prep DEPENDS app_bundle)
|
|
|
|
|
|
|
|
set(_read_me_first "packaging/macosx/Read me first.html")
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT
|
|
|
|
${_read_me_first}
|
|
|
|
COMMAND ${ASCIIDOCTOR_EXECUTABLE}
|
|
|
|
--backend html
|
|
|
|
--out-file ${_read_me_first}
|
|
|
|
--attribute include-dir=${CMAKE_SOURCE_DIR}/docbook
|
|
|
|
--attribute min-macos-version=${MIN_MACOS_VERSION}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc
|
|
|
|
DEPENDS
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/packaging/macosx/Read_me_first.adoc
|
|
|
|
)
|
|
|
|
add_custom_target(read_me_first_html DEPENDS ${_read_me_first} )
|
|
|
|
add_dependencies(dmg_package_prep read_me_first_html)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET( dmg_package
|
|
|
|
COMMAND bash -x ${CMAKE_BINARY_DIR}/packaging/macosx/osx-dmg.sh
|
|
|
|
# Unlike nsis_package_prep + nsis_package, we can add a direct
|
|
|
|
# dependency here.
|
|
|
|
DEPENDS dmg_package_prep
|
|
|
|
# We create Wireshark.app in "run". Do our work there.
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run
|
|
|
|
)
|
2014-10-23 17:57:45 +00:00
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
endif()
|
|
|
|
|
2018-03-20 23:15:33 +00:00
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
find_program(RPMBUILD_EXECUTABLE rpmbuild)
|
2018-08-30 21:46:57 +00:00
|
|
|
find_program(DPKG_BUILDPACKAGE_EXECUTABLE dpkg-buildpackage)
|
2018-03-20 23:15:33 +00:00
|
|
|
find_program(GIT_EXECUTABLE git)
|
2018-12-07 01:23:54 +00:00
|
|
|
# Should we add appimaged's monitored directories
|
|
|
|
# as HINTS?
|
|
|
|
# https://github.com/AppImage/appimaged
|
|
|
|
find_program(LINUXDEPLOYQT_EXECUTABLE linuxdeployqt)
|
|
|
|
find_program(APPIMAGETOOL_EXECUTABLE appimagetool)
|
2018-03-20 23:15:33 +00:00
|
|
|
endif()
|
|
|
|
|
2018-04-27 14:22:53 +00:00
|
|
|
|
2019-01-11 22:34:03 +00:00
|
|
|
string(REPLACE "-" "_" RPM_VERSION "${VERSION}")
|
|
|
|
configure_file(packaging/rpm/wireshark.spec.in ${CMAKE_BINARY_DIR}/packaging/rpm/SPECS/wireshark.spec)
|
2018-04-16 14:48:42 +00:00
|
|
|
if(RPMBUILD_EXECUTABLE)
|
2018-03-20 23:15:33 +00:00
|
|
|
foreach(_rpm_dir BUILD RPMS SOURCES SPECS SRPMS)
|
|
|
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/rpm/${_rpm_dir}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set(_rpmbuild_with_args)
|
|
|
|
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
|
|
|
list(APPEND _rpmbuild_with_args --with ninja)
|
|
|
|
endif()
|
2018-09-24 19:45:18 +00:00
|
|
|
if(CCACHE_EXECUTABLE)
|
|
|
|
list(APPEND _rpmbuild_with_args --with ccache)
|
|
|
|
endif()
|
2019-02-08 11:04:02 +00:00
|
|
|
if(NOT BUILD_wireshark)
|
|
|
|
list(APPEND _rpmbuild_with_args --without qt5)
|
2018-03-20 23:15:33 +00:00
|
|
|
endif()
|
2018-09-24 15:42:48 +00:00
|
|
|
if (MAXMINDDB_FOUND)
|
2018-03-20 23:15:33 +00:00
|
|
|
list(APPEND _rpmbuild_with_args --with mmdbresolve)
|
|
|
|
endif()
|
|
|
|
if (LUA_FOUND)
|
|
|
|
list(APPEND _rpmbuild_with_args --with lua)
|
|
|
|
endif()
|
|
|
|
if (LZ4_FOUND AND SNAPPY_FOUND)
|
2018-04-04 08:00:06 +00:00
|
|
|
list(APPEND _rpmbuild_with_args --with lz4_and_snappy)
|
2018-03-20 23:15:33 +00:00
|
|
|
endif()
|
|
|
|
if (CARES_FOUND)
|
2018-04-04 08:00:06 +00:00
|
|
|
list(APPEND _rpmbuild_with_args --with c_ares)
|
2018-03-20 23:15:33 +00:00
|
|
|
endif()
|
|
|
|
if (SPANDSP_FOUND)
|
2018-04-04 08:00:06 +00:00
|
|
|
list(APPEND _rpmbuild_with_args --with spandsp)
|
2018-03-20 23:15:33 +00:00
|
|
|
endif()
|
|
|
|
if (BCG729_FOUND)
|
2018-04-04 08:00:06 +00:00
|
|
|
list(APPEND _rpmbuild_with_args --with bcg729)
|
2018-03-20 23:15:33 +00:00
|
|
|
endif()
|
2019-11-18 22:55:25 +00:00
|
|
|
if (ILBC_FOUND)
|
|
|
|
list(APPEND _rpmbuild_with_args --with ilbc)
|
|
|
|
endif()
|
2018-03-20 23:15:33 +00:00
|
|
|
if (LIBXML2_FOUND)
|
2018-04-04 08:00:06 +00:00
|
|
|
list(APPEND _rpmbuild_with_args --with libxml2)
|
2018-03-20 23:15:33 +00:00
|
|
|
endif()
|
|
|
|
if (NGHTTP2_FOUND)
|
2018-04-04 08:00:06 +00:00
|
|
|
list(APPEND _rpmbuild_with_args --with nghttp2)
|
2018-03-20 23:15:33 +00:00
|
|
|
endif()
|
2018-10-01 23:28:03 +00:00
|
|
|
if (SYSTEMD_FOUND)
|
|
|
|
list(APPEND _rpmbuild_with_args --with sdjournal)
|
|
|
|
endif()
|
2019-04-10 10:52:52 +00:00
|
|
|
if (BROTLI_FOUND)
|
|
|
|
list(APPEND _rpmbuild_with_args --with brotli)
|
|
|
|
endif()
|
2018-03-20 23:15:33 +00:00
|
|
|
|
2018-04-27 14:22:53 +00:00
|
|
|
execute_process(
|
|
|
|
COMMAND ${PERL_EXECUTABLE}
|
2019-01-09 22:47:02 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/tools/make-version.pl
|
2018-04-27 14:22:53 +00:00
|
|
|
${CMAKE_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
|
2018-04-16 18:39:27 +00:00
|
|
|
# XXX Replace with the "dist" target?
|
2019-02-01 16:25:24 +00:00
|
|
|
set(_export_tarball "${PROJECT_NAME}-${VERSION}.tar.xz")
|
2018-03-20 23:15:33 +00:00
|
|
|
add_custom_command(
|
2018-04-16 18:39:27 +00:00
|
|
|
OUTPUT "${CMAKE_BINARY_DIR}/packaging/rpm/SOURCES/${_export_tarball}"
|
2019-01-11 22:34:03 +00:00
|
|
|
COMMAND ${CMAKE_BINARY_DIR}/packaging/source/git-export-release.sh
|
2018-04-16 18:39:27 +00:00
|
|
|
-d "${CMAKE_BINARY_DIR}/packaging/rpm/SOURCES"
|
2019-01-11 22:34:03 +00:00
|
|
|
"${VERSION}"
|
2018-03-20 23:15:33 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
add_custom_target(rpm-package
|
|
|
|
COMMAND ${RPMBUILD_EXECUTABLE}
|
|
|
|
--define "_topdir ${CMAKE_BINARY_DIR}/packaging/rpm"
|
|
|
|
--define "_prefix ${CMAKE_INSTALL_PREFIX}"
|
|
|
|
${_rpmbuild_with_args}
|
2019-11-06 13:35:06 +00:00
|
|
|
-v
|
2019-01-14 12:26:14 +00:00
|
|
|
-ba SPECS/wireshark.spec
|
2018-04-16 18:39:27 +00:00
|
|
|
DEPENDS "${CMAKE_BINARY_DIR}/packaging/rpm/SOURCES/${_export_tarball}"
|
2018-03-20 23:15:33 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/rpm"
|
|
|
|
COMMENT "Create a tarball from the current git commit."
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-08-30 21:46:57 +00:00
|
|
|
if(DPKG_BUILDPACKAGE_EXECUTABLE)
|
|
|
|
add_custom_target(deb-package
|
|
|
|
COMMAND ${DPKG_BUILDPACKAGE_EXECUTABLE} -us -uc
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-07-03 19:10:36 +00:00
|
|
|
if(LINUXDEPLOYQT_EXECUTABLE AND APPIMAGETOOL_EXECUTABLE)
|
2018-12-07 01:23:54 +00:00
|
|
|
# The documentation at https://github.com/probonopd/linuxdeployqt
|
|
|
|
# says that you need to set CMAKE_BUILD_TYPE=Release and
|
|
|
|
# CMAKE_INSTALL_PREFIX=/usr. I (gcc) also had to set
|
|
|
|
# CMAKE_INSTALL_LIBDIR=/usr/lib.
|
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Release" AND CMAKE_INSTALL_PREFIX STREQUAL "/usr" AND CMAKE_INSTALL_LIBDIR STREQUAL "/usr/lib" )
|
|
|
|
add_custom_target(appimage-prerequisites)
|
|
|
|
add_dependencies(appimage-prerequisites ${PROGLIST})
|
|
|
|
else()
|
|
|
|
add_custom_target(appimage-prerequisites
|
|
|
|
COMMAND echo "CMAKE_BUILD_TYPE isn't Release or CMAKE_INSTALL_PREFIX isn't /usr or CMAKE_INSTALL_LIBDIR isn't /usr/lib."
|
|
|
|
COMMAND false
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
set (_ai_appdir "${CMAKE_BINARY_DIR}/packaging/appimage/appdir")
|
|
|
|
add_custom_target(appimage-appdir
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${_ai_appdir}"
|
|
|
|
COMMAND env DESTDIR=${_ai_appdir}
|
|
|
|
${CMAKE_COMMAND} --build . --target install
|
|
|
|
DEPENDS appimage-prerequisites
|
|
|
|
)
|
|
|
|
set(_exe_args)
|
|
|
|
foreach(_prog ${PROGLIST})
|
|
|
|
# XXX Is this the correct path?
|
|
|
|
list(APPEND _exe_args "-executable=${_ai_appdir}/usr/bin/${_prog}")
|
|
|
|
endforeach()
|
|
|
|
# linuxdeployqt currently clobbers AppRun:
|
|
|
|
# https://github.com/probonopd/linuxdeployqt/issues/159
|
|
|
|
# When that's fixed we will no longer need appimagetool. Until
|
|
|
|
# then, we need to prep and package in two steps:
|
|
|
|
# https://github.com/probonopd/linuxdeployqt/wiki/Custom-wrapper-script-instead-of-AppRun
|
|
|
|
add_custom_target(appimage-prep
|
|
|
|
COMMAND ${LINUXDEPLOYQT_EXECUTABLE}
|
|
|
|
"${_ai_appdir}/usr/share/applications/wireshark.desktop"
|
|
|
|
${_exe_args}
|
|
|
|
COMMAND rm -f "${_ai_appdir}/AppRun"
|
|
|
|
COMMAND install
|
|
|
|
"${CMAKE_SOURCE_DIR}/packaging/appimage/AppRun"
|
|
|
|
"${_ai_appdir}/AppRun"
|
|
|
|
DEPENDS appimage-appdir
|
|
|
|
)
|
|
|
|
add_custom_target(appimage
|
|
|
|
COMMAND env VERSION=${PROJECT_VERSION} ${APPIMAGETOOL_EXECUTABLE} appdir
|
|
|
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/appimage"
|
|
|
|
DEPENDS appimage-prep
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-07-25 20:31:49 +00:00
|
|
|
set(CLEAN_C_FILES
|
2018-08-12 18:04:36 +00:00
|
|
|
${dumpcap_FILES}
|
2009-11-07 10:07:00 +00:00
|
|
|
${wireshark_FILES}
|
|
|
|
${tshark_FILES}
|
|
|
|
${rawshark_FILES}
|
|
|
|
${dftest_FILES}
|
|
|
|
${randpkt_FILES}
|
2015-11-05 17:31:11 +00:00
|
|
|
${randpktdump_FILES}
|
2016-02-10 14:45:45 +00:00
|
|
|
${udpdump_FILES}
|
2018-02-16 22:51:51 +00:00
|
|
|
${text2pcap_FILES}
|
2009-11-07 10:07:00 +00:00
|
|
|
${mergecap_FILES}
|
|
|
|
${capinfos_FILES}
|
2013-12-13 02:59:16 +00:00
|
|
|
${captype_FILES}
|
2009-11-07 10:07:00 +00:00
|
|
|
${editcap_FILES}
|
2017-08-10 17:20:30 +00:00
|
|
|
${idl2wrs_FILES}
|
2018-02-09 01:20:26 +00:00
|
|
|
${mmdbresolve_FILES}
|
2009-11-07 10:07:00 +00:00
|
|
|
)
|
|
|
|
|
2019-04-19 11:26:18 +00:00
|
|
|
if(CLEAN_C_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()
|
2017-07-25 20:31:49 +00:00
|
|
|
|
2019-04-19 11:26:18 +00:00
|
|
|
# XXX This also contains object files ($<TARGET_OBJECTS:...>), is that an issue?
|
|
|
|
set_source_files_properties(
|
|
|
|
${CLEAN_C_FILES}
|
|
|
|
PROPERTIES
|
|
|
|
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
|
|
|
|
)
|
|
|
|
endif()
|
2009-11-07 10:07:00 +00:00
|
|
|
|
2009-09-21 00:19:07 +00:00
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${INSTALL_FILES}
|
2018-02-11 22:34:04 +00:00
|
|
|
PERMISSIONS
|
|
|
|
OWNER_WRITE OWNER_READ
|
|
|
|
GROUP_READ
|
|
|
|
WORLD_READ
|
2009-09-21 00:19:07 +00:00
|
|
|
DESTINATION
|
2018-12-03 19:23:35 +00:00
|
|
|
${CMAKE_INSTALL_DATADIR}
|
2009-09-21 00:19:07 +00:00
|
|
|
)
|
|
|
|
|
2017-09-02 23:42:00 +00:00
|
|
|
set(SHARK_PUBLIC_HEADERS
|
|
|
|
cfile.h
|
2018-12-12 10:53:08 +00:00
|
|
|
cli_main.h
|
2017-09-02 23:42:00 +00:00
|
|
|
file.h
|
|
|
|
globals.h
|
|
|
|
log.h
|
|
|
|
ws_attributes.h
|
2017-10-26 21:59:40 +00:00
|
|
|
ws_compiler_tests.h
|
2017-09-02 23:42:00 +00:00
|
|
|
ws_diag_control.h
|
2017-10-26 21:59:40 +00:00
|
|
|
ws_symbol_export.h
|
2018-04-22 14:29:04 +00:00
|
|
|
version_info.h
|
2018-08-21 14:18:56 +00:00
|
|
|
${CMAKE_BINARY_DIR}/ws_version.h
|
2017-09-02 23:42:00 +00:00
|
|
|
)
|
|
|
|
|
2018-11-23 20:39:48 +00:00
|
|
|
install(FILES ${SHARK_PUBLIC_HEADERS}
|
2019-02-01 16:25:24 +00:00
|
|
|
DESTINATION ${PROJECT_INSTALL_INCLUDEDIR}
|
2018-11-23 20:39:48 +00:00
|
|
|
)
|
2017-09-02 23:42:00 +00:00
|
|
|
|
2016-11-08 14:20:30 +00:00
|
|
|
# Install icons and other desktop files for Freedesktop.org-compliant desktops.
|
2018-04-05 06:59:12 +00:00
|
|
|
if((BUILD_wireshark AND QT_FOUND) AND NOT (WIN32 OR APPLE))
|
2016-11-08 14:20:30 +00:00
|
|
|
install(FILES wireshark-mime-package.xml
|
2018-12-03 19:23:35 +00:00
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages"
|
2016-11-08 14:20:30 +00:00
|
|
|
RENAME wireshark.xml
|
|
|
|
)
|
|
|
|
install(FILES wireshark.appdata.xml
|
2018-12-03 19:23:35 +00:00
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/appdata"
|
2016-11-08 14:20:30 +00:00
|
|
|
)
|
|
|
|
if(BUILD_wireshark AND QT_FOUND)
|
|
|
|
install(FILES wireshark.desktop
|
2018-12-03 19:23:35 +00:00
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
2016-11-08 14:20:30 +00:00
|
|
|
endif()
|
|
|
|
foreach(size 16 24 32 48 64 128 256)
|
|
|
|
install(FILES image/wsicon${size}.png
|
2018-12-03 19:23:35 +00:00
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${size}x${size}/apps"
|
2016-11-08 14:20:30 +00:00
|
|
|
RENAME wireshark.png)
|
|
|
|
install(FILES image/WiresharkDoc-${size}.png
|
2018-12-03 19:23:35 +00:00
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${size}x${size}/mimetypes"
|
2016-11-08 14:20:30 +00:00
|
|
|
RENAME application-wireshark-doc.png)
|
|
|
|
endforeach()
|
|
|
|
install(FILES image/wsicon.svg
|
2018-12-03 19:23:35 +00:00
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps"
|
2016-11-08 14:20:30 +00:00
|
|
|
RENAME wireshark.svg)
|
|
|
|
endif()
|
|
|
|
|
2014-03-04 13:59:39 +00:00
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
"${CMAKE_BINARY_DIR}/wireshark.pc"
|
|
|
|
DESTINATION
|
2014-05-29 12:07:44 +00:00
|
|
|
${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
2014-03-04 13:59:39 +00:00
|
|
|
)
|
|
|
|
|
2009-09-21 00:19:07 +00:00
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${INSTALL_DIRS}
|
2018-02-11 22:34:04 +00:00
|
|
|
DESTINATION
|
2018-12-03 19:23:35 +00:00
|
|
|
${CMAKE_INSTALL_DATADIR}
|
2018-02-11 22:34:04 +00:00
|
|
|
FILE_PERMISSIONS
|
|
|
|
OWNER_WRITE OWNER_READ
|
|
|
|
GROUP_READ
|
|
|
|
WORLD_READ
|
2009-09-25 02:50:48 +00:00
|
|
|
DIRECTORY_PERMISSIONS
|
|
|
|
OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
|
|
|
GROUP_EXECUTE GROUP_READ
|
|
|
|
WORLD_EXECUTE WORLD_READ
|
2014-02-07 19:14:52 +00:00
|
|
|
PATTERN ".git" EXCLUDE
|
2009-09-21 00:19:07 +00:00
|
|
|
PATTERN ".svn" EXCLUDE
|
|
|
|
PATTERN "Makefile.*" EXCLUDE
|
|
|
|
)
|
2012-02-04 14:19:38 +00:00
|
|
|
|
2018-11-23 20:39:51 +00:00
|
|
|
if(WIN32)
|
|
|
|
# Note: CMake export mechanism misbehaves with a '.' in the
|
|
|
|
# path (incorrect relative path computation).
|
|
|
|
set(WIRESHARK_INSTALL_CMAKEDIR "cmake")
|
|
|
|
else()
|
2019-02-01 16:25:24 +00:00
|
|
|
set(WIRESHARK_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake")
|
2018-11-23 20:39:51 +00:00
|
|
|
endif()
|
|
|
|
|
2014-11-11 13:41:01 +00:00
|
|
|
install(
|
|
|
|
FILES
|
2014-11-12 12:02:17 +00:00
|
|
|
${CMAKE_MODULE_PATH}/FindGLIB2.cmake
|
2020-03-20 03:18:41 +00:00
|
|
|
${CMAKE_MODULE_PATH}/FindWSLibrary.cmake
|
2014-11-12 12:02:17 +00:00
|
|
|
${CMAKE_MODULE_PATH}/FindWSWinLibs.cmake
|
2014-11-12 12:43:14 +00:00
|
|
|
${CMAKE_MODULE_PATH}/UseAsn2Wrs.cmake
|
2014-11-16 15:07:45 +00:00
|
|
|
${CMAKE_MODULE_PATH}/LocatePythonModule.cmake
|
2017-11-20 19:58:46 +00:00
|
|
|
${CMAKE_MODULE_PATH}/UseMakePluginReg.cmake
|
2014-11-11 13:41:01 +00:00
|
|
|
DESTINATION
|
2018-11-23 20:39:51 +00:00
|
|
|
${WIRESHARK_INSTALL_CMAKEDIR}
|
2014-11-11 13:41:01 +00:00
|
|
|
)
|
|
|
|
|
2018-08-23 21:03:28 +00:00
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
|
|
|
|
configure_package_config_file(WiresharkConfig.cmake.in
|
|
|
|
${CMAKE_BINARY_DIR}/WiresharkConfig.cmake
|
2018-11-23 20:39:51 +00:00
|
|
|
INSTALL_DESTINATION ${WIRESHARK_INSTALL_CMAKEDIR}
|
2018-08-23 21:03:28 +00:00
|
|
|
PATH_VARS
|
|
|
|
CMAKE_INSTALL_LIBDIR
|
|
|
|
CMAKE_INSTALL_INCLUDEDIR
|
|
|
|
PLUGIN_INSTALL_VERSION_LIBDIR
|
|
|
|
EXTCAP_INSTALL_LIBDIR
|
|
|
|
)
|
|
|
|
|
|
|
|
write_basic_package_version_file(
|
|
|
|
${CMAKE_BINARY_DIR}/WiresharkConfigVersion.cmake
|
|
|
|
COMPATIBILITY AnyNewerVersion
|
|
|
|
)
|
|
|
|
|
2018-11-23 20:39:47 +00:00
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${CMAKE_BINARY_DIR}/WiresharkConfig.cmake
|
|
|
|
${CMAKE_BINARY_DIR}/WiresharkConfigVersion.cmake
|
|
|
|
DESTINATION
|
|
|
|
${WIRESHARK_INSTALL_CMAKEDIR}
|
|
|
|
)
|
2018-08-23 21:03:28 +00:00
|
|
|
|
2018-11-23 20:39:47 +00:00
|
|
|
install(EXPORT WiresharkTargets
|
|
|
|
DESTINATION ${WIRESHARK_INSTALL_CMAKEDIR}
|
|
|
|
)
|
2018-08-23 21:03:28 +00:00
|
|
|
|
2018-04-16 21:49:55 +00:00
|
|
|
if (DOXYGEN_EXECUTABLE)
|
|
|
|
# API reference
|
2018-04-17 17:28:37 +00:00
|
|
|
# We don't have a good way of tracking dependencies, so we simply
|
|
|
|
# recreate the whole thing from scratch each time.
|
2018-04-16 21:49:55 +00:00
|
|
|
add_custom_target(wsar_html
|
2018-04-17 17:28:37 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory wsar_html
|
2018-04-16 21:49:55 +00:00
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} doxygen.cfg
|
|
|
|
)
|
|
|
|
|
2020-01-07 20:38:21 +00:00
|
|
|
if (WIN32)
|
|
|
|
add_custom_target(wsar_html_perms DEPENDS wsar_html)
|
|
|
|
else()
|
|
|
|
add_custom_target(wsar_html_perms
|
|
|
|
COMMAND find wsar_html
|
|
|
|
-type d
|
|
|
|
-exec chmod 755 "{}" +
|
|
|
|
COMMAND find wsar_html
|
|
|
|
-type f
|
|
|
|
-exec chmod 644 "{}" +
|
|
|
|
DEPENDS wsar_html)
|
|
|
|
endif()
|
|
|
|
|
2018-04-16 21:49:55 +00:00
|
|
|
add_custom_target(wsar_html_zip
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E tar "cfv" "wsar_html.zip" --format=zip wsar_html
|
2020-01-07 20:38:21 +00:00
|
|
|
DEPENDS wsar_html_perms
|
2018-04-16 21:49:55 +00:00
|
|
|
)
|
2018-04-23 15:31:25 +00:00
|
|
|
set_target_properties(wsar_html wsar_html_zip PROPERTIES
|
|
|
|
FOLDER "Docs"
|
|
|
|
EXCLUDE_FROM_DEFAULT_BUILD True
|
|
|
|
)
|
2018-04-16 21:49:55 +00:00
|
|
|
endif(DOXYGEN_EXECUTABLE)
|
|
|
|
|
2018-03-07 19:35:33 +00:00
|
|
|
add_custom_target(test-programs
|
2018-05-01 22:49:11 +00:00
|
|
|
DEPENDS exntest
|
2018-03-07 19:35:33 +00:00
|
|
|
oids_test
|
|
|
|
reassemble_test
|
|
|
|
tvbtest
|
|
|
|
wmem_test
|
|
|
|
COMMENT "Building unit test programs and wrapper"
|
|
|
|
)
|
|
|
|
set_target_properties(test-programs PROPERTIES
|
|
|
|
FOLDER "Tests"
|
|
|
|
EXCLUDE_FROM_DEFAULT_BUILD True
|
|
|
|
)
|
2016-02-28 22:32:13 +00:00
|
|
|
|
2018-04-03 00:12:23 +00:00
|
|
|
# Test suites
|
|
|
|
enable_testing()
|
2018-05-05 22:53:54 +00:00
|
|
|
# We could try to build this list dynamically, but given that we tend to
|
|
|
|
# go years between adding suites just run
|
2018-06-18 19:01:01 +00:00
|
|
|
# test/test.py --list-groups | sort
|
2018-05-05 22:53:54 +00:00
|
|
|
# and paste the output here.
|
2018-06-18 19:01:01 +00:00
|
|
|
set(_test_group_list
|
2018-05-05 22:53:54 +00:00
|
|
|
suite_capture
|
|
|
|
suite_clopts
|
|
|
|
suite_decryption
|
2018-06-18 19:01:01 +00:00
|
|
|
suite_dfilter.group_bytes_ether
|
|
|
|
suite_dfilter.group_bytes_ipv6
|
|
|
|
suite_dfilter.group_bytes_type
|
|
|
|
suite_dfilter.group_double
|
2019-01-06 09:34:32 +00:00
|
|
|
suite_dfilter.group_dfunction_string
|
2018-06-18 19:01:01 +00:00
|
|
|
suite_dfilter.group_integer
|
|
|
|
suite_dfilter.group_integer_1byte
|
|
|
|
suite_dfilter.group_ipv4
|
|
|
|
suite_dfilter.group_membership
|
|
|
|
suite_dfilter.group_range_method
|
|
|
|
suite_dfilter.group_scanner
|
|
|
|
suite_dfilter.group_string_type
|
|
|
|
suite_dfilter.group_stringz
|
|
|
|
suite_dfilter.group_time_relative
|
|
|
|
suite_dfilter.group_time_type
|
|
|
|
suite_dfilter.group_tvb
|
|
|
|
suite_dfilter.group_uint64
|
2018-05-05 22:53:54 +00:00
|
|
|
suite_dissection
|
2018-12-25 14:13:40 +00:00
|
|
|
suite_dissectors.group_asterix
|
2019-12-10 22:47:17 +00:00
|
|
|
suite_extcaps
|
2018-05-05 22:53:54 +00:00
|
|
|
suite_fileformats
|
2018-07-05 23:57:44 +00:00
|
|
|
suite_follow
|
2018-05-05 22:53:54 +00:00
|
|
|
suite_io
|
|
|
|
suite_mergecap
|
|
|
|
suite_nameres
|
2018-12-15 20:25:40 +00:00
|
|
|
suite_outputformats
|
2020-02-13 23:18:14 +00:00
|
|
|
suite_release
|
2018-05-05 22:53:54 +00:00
|
|
|
suite_text2pcap
|
2018-06-18 18:01:31 +00:00
|
|
|
suite_sharkd
|
2018-05-05 22:53:54 +00:00
|
|
|
suite_unittests
|
|
|
|
suite_wslua
|
|
|
|
)
|
2018-04-03 00:12:23 +00:00
|
|
|
|
2018-05-05 22:53:54 +00:00
|
|
|
# We don't currently handle spaces in arguments. On Windows this
|
2018-04-03 00:12:23 +00:00
|
|
|
# means that you will probably have to pass in an interface index
|
|
|
|
# instead of a name.
|
|
|
|
set(TEST_EXTRA_ARGS "" CACHE STRING "Extra arguments to pass to test/test.py")
|
|
|
|
separate_arguments(TEST_EXTRA_ARGS)
|
|
|
|
|
2018-06-18 19:01:01 +00:00
|
|
|
foreach(_group_name ${_test_group_list})
|
2018-04-03 00:12:23 +00:00
|
|
|
add_test(
|
2018-06-18 19:01:01 +00:00
|
|
|
NAME ${_group_name}
|
2018-05-21 16:02:26 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E env PYTHONIOENCODING=UTF-8
|
|
|
|
${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/test/test.py
|
2018-04-27 16:35:37 +00:00
|
|
|
--verbose
|
2018-09-04 20:03:48 +00:00
|
|
|
--program-path ${WS_PROGRAM_PATH}
|
2018-04-03 00:12:23 +00:00
|
|
|
${TEST_EXTRA_ARGS}
|
2018-06-18 19:01:01 +00:00
|
|
|
${_group_name}
|
2018-04-03 00:12:23 +00:00
|
|
|
)
|
2018-06-18 19:01:01 +00:00
|
|
|
set_tests_properties(${_group_name} PROPERTIES TIMEOUT 600)
|
2018-04-03 00:12:23 +00:00
|
|
|
endforeach()
|
|
|
|
|
2019-01-03 22:43:56 +00:00
|
|
|
# Make it possible to run pytest without passing the full path as argument.
|
|
|
|
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
|
|
|
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/pytest.ini" pytest_ini)
|
|
|
|
string(REGEX REPLACE "\naddopts = ([^\n]+)"
|
|
|
|
"\naddopts = ${CMAKE_CURRENT_SOURCE_DIR}/test \\1"
|
|
|
|
pytest_ini "${pytest_ini}")
|
|
|
|
file(WRITE "${CMAKE_BINARY_DIR}/pytest.ini" "${pytest_ini}")
|
|
|
|
endif()
|
|
|
|
|
2016-03-04 17:55:40 +00:00
|
|
|
if (GIT_EXECUTABLE)
|
2016-03-27 21:31:36 +00:00
|
|
|
# Update AUTHORS file with entries from git shortlog
|
|
|
|
add_custom_target(
|
2016-03-04 17:55:40 +00:00
|
|
|
gen-authors
|
2016-03-27 21:31:36 +00:00
|
|
|
COMMAND ${PERL_EXECUTABLE} tools/generate_authors.pl AUTHORS.src > AUTHORS
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
2016-03-04 17:55:40 +00:00
|
|
|
)
|
|
|
|
else (GIT_EXECUTABLE)
|
2016-03-27 21:31:36 +00:00
|
|
|
add_custom_target( gen-authors COMMAND ${CMAKE_COMMAND} -E echo "Git not found." )
|
2016-03-04 17:55:40 +00:00
|
|
|
endif (GIT_EXECUTABLE)
|
2016-03-19 23:36:22 +00:00
|
|
|
set_target_properties(gen-authors PROPERTIES FOLDER "Docs")
|
2015-03-07 01:49:24 +00:00
|
|
|
|
2015-09-24 17:42:46 +00:00
|
|
|
if (WIN32)
|
|
|
|
file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/tools/Get-HardenFlags.ps1 _win_harden_flags)
|
|
|
|
add_custom_target(hardening-check
|
2015-11-21 18:09:33 +00:00
|
|
|
COMMAND ${POWERSHELL_COMMAND} "${_win_harden_flags}" "${_dll_output_dir_win}"
|
2015-09-24 17:42:46 +00:00
|
|
|
DEPENDS ${PROGLIST}
|
|
|
|
COMMENT "Checking binaries for security features"
|
|
|
|
)
|
|
|
|
set_target_properties(hardening-check PROPERTIES FOLDER "Tests")
|
|
|
|
else ()
|
|
|
|
find_program(HARDENING_CHECK_EXECUTABLE hardening-check
|
|
|
|
DOC "Path to the hardening-check utility."
|
|
|
|
)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(HARDENING_CHECK_EXECUTABLE)
|
2015-09-24 17:42:46 +00:00
|
|
|
foreach(_prog ${PROGLIST})
|
|
|
|
get_target_property(_prog_dir ${_prog} RUNTIME_OUTPUT_DIRECTORY)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(NOT _prog_dir)
|
2015-09-24 17:42:46 +00:00
|
|
|
set(_prog_dir "${CMAKE_BINARY_DIR}/run")
|
|
|
|
endif()
|
|
|
|
set(_prog_paths ${_prog_paths} "${_prog_dir}/${_prog}")
|
|
|
|
endforeach()
|
|
|
|
add_custom_target(hardening-check
|
|
|
|
COMMAND ${HARDENING_CHECK_EXECUTABLE} ${_prog_paths}
|
|
|
|
DEPENDS ${PROGLIST}
|
|
|
|
COMMENT "Checking binaries for security features"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
2015-03-13 16:21:01 +00:00
|
|
|
|
2016-03-11 19:51:39 +00:00
|
|
|
CHECKAPI(
|
|
|
|
NAME
|
|
|
|
main
|
|
|
|
SWITCHES
|
|
|
|
SOURCES
|
|
|
|
${WIRESHARK_SRC}
|
|
|
|
${TSHARK_TAP_SRC}
|
|
|
|
)
|
|
|
|
|
2016-09-26 17:34:04 +00:00
|
|
|
find_program(SHELLCHECK_EXECUTABLE shellcheck
|
|
|
|
DOC "Path to the shellcheck utility."
|
|
|
|
)
|
2018-05-10 12:54:31 +00:00
|
|
|
if(SHELLCHECK_EXECUTABLE)
|
2016-09-26 17:34:04 +00:00
|
|
|
add_custom_target(shellcheck)
|
|
|
|
set_target_properties(shellcheck PROPERTIES FOLDER "Tests")
|
|
|
|
# --external-sources requires 0.4.0 or later.
|
|
|
|
add_custom_command(TARGET shellcheck POST_BUILD
|
|
|
|
COMMAND shellcheck --external-sources
|
2018-06-06 17:10:07 +00:00
|
|
|
image/stock_icons/svg-to-png.sh
|
2018-12-07 01:23:54 +00:00
|
|
|
packaging/appimage/AppRun
|
2018-06-06 17:10:07 +00:00
|
|
|
packaging/macosx/osx-app.sh.in
|
2019-09-26 17:43:13 +00:00
|
|
|
packaging/macosx/osx-dmg.sh.in
|
2019-01-11 22:34:03 +00:00
|
|
|
packaging/source/git-export-release.sh.in
|
2018-06-06 17:10:07 +00:00
|
|
|
tools/compress-pngs.sh
|
2018-06-25 22:39:30 +00:00
|
|
|
tools/debian-setup.sh
|
2016-09-26 17:34:04 +00:00
|
|
|
tools/fuzz-test.sh
|
2018-06-07 22:03:48 +00:00
|
|
|
tools/gen-bugnote
|
|
|
|
tools/pre-commit
|
2016-09-26 17:34:04 +00:00
|
|
|
tools/randpkt-test.sh
|
2018-06-06 19:01:44 +00:00
|
|
|
tools/release-update-debian-soversions.sh
|
2016-09-26 17:34:04 +00:00
|
|
|
tools/test-captures.sh
|
2018-06-07 22:03:48 +00:00
|
|
|
tools/update-tx
|
2016-09-26 17:34:04 +00:00
|
|
|
tools/valgrind-wireshark.sh
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2015-01-15 11:45:02 +00:00
|
|
|
#
|
2019-07-26 18:43:17 +00:00
|
|
|
# Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2015-01-15 11:45:02 +00:00
|
|
|
#
|
|
|
|
# Local variables:
|
|
|
|
# c-basic-offset: 8
|
|
|
|
# tab-width: 8
|
|
|
|
# indent-tabs-mode: t
|
|
|
|
# End:
|
|
|
|
#
|
|
|
|
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
|
|
# :indentSize=8:tabSize=8:noTabs=false:
|
|
|
|
#
|