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
#
2021-02-16 21:23:46 +00:00
if ( DEFINED ENV{FORCE_CMAKE_NINJA_NON_VERBOSE} )
#
# Forcibly unset CMAKE_VERBOSE_MAKEFILE,
# to make *CERTAIN* that we don't do
# anything verbose here!
#
unset ( CMAKE_VERBOSE_MAKEFILE CACHE )
endif ( )
2006-09-05 09:50:45 +00:00
2022-11-17 13:31:45 +00:00
# Needed for add_custom_command() WORKING_DIRECTORY generator expressions
cmake_minimum_required ( VERSION 3.13 )
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 )
2023-01-11 00:10:05 +00:00
if ( DEFINED ENV{MSYSTEM} )
set ( _msystem $ENV{ MSYSTEM } )
set ( _repository False )
message ( STATUS "Using MSYS2 with MSYSTEM=${_msystem}" )
else ( )
set ( _msystem False )
set ( _repository True )
message ( STATUS "Using 3rd party repository" )
endif ( )
set ( USE_MSYSTEM ${ _msystem } CACHE INTERNAL "Use MSYS2 subsystem" )
2023-02-06 16:09:54 +00:00
set ( HAVE_MSYSTEM ${ USE_MSYSTEM } ) # For config.h
2023-01-11 00:10:05 +00:00
set ( USE_REPOSITORY ${ _repository } CACHE INTERNAL "Use Wireshark 3rd Party Repository" )
endif ( )
if ( WIN32 AND NOT USE_MSYSTEM )
2019-02-01 16:25:24 +00:00
set ( _project_name Wireshark )
2022-06-30 16:45:49 +00:00
set ( _log_project_name Logray )
2019-02-01 16:25:24 +00:00
else ( )
set ( _project_name wireshark )
2022-06-30 16:45:49 +00:00
set ( _log_project_name logray )
2019-02-01 16:25:24 +00:00
endif ( )
project ( ${ _project_name } C CXX )
2006-09-05 09:27:22 +00:00
2022-07-11 14:44:23 +00:00
# Updated by tools/make-version.py
2022-08-15 22:32:07 +00:00
set ( PROJECT_MAJOR_VERSION 4 )
set ( PROJECT_MINOR_VERSION 1 )
set ( PROJECT_PATCH_VERSION 0 )
2022-07-04 22:40:26 +00:00
set ( PROJECT_BUILD_VERSION 0 )
2016-09-01 22:09:12 +00:00
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}" )
2022-04-27 21:38:38 +00:00
set ( LOG_PROJECT_NAME ${ _log_project_name } )
set ( LOG_PROJECT_MAJOR_VERSION 0 )
set ( LOG_PROJECT_MINOR_VERSION 8 )
2022-08-17 01:14:02 +00:00
set ( LOG_PROJECT_PATCH_VERSION 3 )
set ( LOG_PROJECT_VERSION "${LOG_PROJECT_MAJOR_VERSION}.${LOG_PROJECT_MINOR_VERSION}.${LOG_PROJECT_PATCH_VERSION}${PROJECT_VERSION_EXTENSION}" )
2022-04-27 21:38:38 +00:00
2019-09-17 18:07:54 +00:00
include ( CMakeOptions.txt )
2021-12-14 23:47:30 +00:00
# We require minimum C11
set ( CMAKE_C_STANDARD 11 )
set ( CMAKE_C_STANDARD_REQUIRED ON )
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
2021-12-05 12:42:48 +00:00
# Set a default build type if none was specified
set ( _default_build_type "RelWithDebInfo" )
if ( NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
set ( CMAKE_BUILD_TYPE "${_default_build_type}" CACHE STRING "Choose the type of build." FORCE )
# Set the possible values of build type for cmake-gui
set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
endif ( )
2021-11-15 14:27:42 +00:00
# Build type is ignored by multi-config generators.
2021-12-05 12:42:48 +00:00
if ( NOT CMAKE_CONFIGURATION_TYPES )
message ( STATUS "Using \" ${ CMAKE_GENERATOR } \" generator and build type \"${CMAKE_BUILD_TYPE}\"")
else ( )
message ( STATUS "Using \" ${ CMAKE_GENERATOR } \" generator ( multi-config ) " )
endif ( )
2021-11-15 14:27:42 +00:00
2015-04-07 21:05:52 +00:00
#Where to find local cmake scripts
2021-11-17 10:57:24 +00:00
set ( WS_CMAKE_MODULE_PATH ${ CMAKE_SOURCE_DIR } /cmake/modules )
set ( CMAKE_MODULE_PATH ${ WS_CMAKE_MODULE_PATH } )
2015-04-07 21:05:52 +00:00
2021-05-23 18:44:07 +00:00
# CMake >= 3.9.0 supports LTO/IPO.
2020-06-28 15:42:43 +00:00
if ( ENABLE_LTO )
include ( CheckIPOSupported )
2021-05-23 18:44:07 +00:00
check_ipo_supported ( RESULT lto_supported OUTPUT lto_output )
2020-06-28 15:42:43 +00:00
if ( lto_supported )
2021-07-22 20:29:37 +00:00
set ( CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE )
message ( STATUS "LTO/IPO is enabled for Release configuration" )
2021-05-23 18:44:07 +00:00
else ( )
2021-07-13 18:02:52 +00:00
message ( STATUS "LTO/IPO requested but it is not supported by the compiler: ${lto_output}" )
2020-06-28 15:42:43 +00:00
endif ( )
else ( )
2020-12-12 23:29:05 +00:00
message ( STATUS "LTO/IPO is not enabled" )
2020-06-28 15:42:43 +00:00
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 )
2021-09-22 22:02:03 +00:00
if ( DEFINED ENV{WIRESHARK_TARGET_PLATFORM} )
string ( TOLOWER $ENV{ WIRESHARK_TARGET_PLATFORM } _target_platform )
set ( WIRESHARK_TARGET_PLATFORM ${ _target_platform } )
2023-01-14 21:11:36 +00:00
elseif ( USE_MSYSTEM MATCHES "MINGW64|CLANG64|UCRT64" )
# https://www.msys2.org/docs/environments
# MSYS2 comes with different environments/subsystems and
# the first thing you have to decide is which one to use.
# The differences among the environments are mainly environment
# variables, default compilers/linkers, architecture,
# system libraries used etc. If you are unsure, go with UCRT64.
2021-09-22 22:02:03 +00:00
set ( WIRESHARK_TARGET_PLATFORM win64 )
elseif ( USE_MSYSTEM )
2023-01-14 21:11:36 +00:00
if ( $ENV{ MSYSTEM_CARCH } MATCHES "x86_64" )
set ( WIRESHARK_TARGET_PLATFORM win64 )
elseif ( $ENV{ MSYSTEM_CARCH } MATCHES "i686" )
set ( WIRESHARK_TARGET_PLATFORM win32 )
2023-02-13 04:27:02 +00:00
elseif ( $ENV{ MSYSTEM_CARCH } MATCHES "aarch64" )
set ( WIRESHARK_TARGET_PLATFORM "win64arm" )
2023-01-14 21:11:36 +00:00
else ( )
set ( WIRESHARK_TARGET_PLATFORM "$ENV{MSYSTEM_CARCH}" )
endif ( )
2021-09-22 22:02:03 +00:00
elseif ( 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 )
2021-09-20 13:14:03 +00:00
else ( )
2021-09-22 12:40:57 +00:00
message ( WARNING "Assuming \" win64\ " target platform" )
2021-09-20 13:14:03 +00:00
set ( WIRESHARK_TARGET_PLATFORM win64 )
2015-01-09 21:53:17 +00:00
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 )
2021-09-22 12:40:57 +00:00
elseif ( WIRESHARK_TARGET_PLATFORM MATCHES "win32" )
2022-04-22 16:56:45 +00:00
message ( FATAL_ERROR "Deprecated target platform ${WIRESHARK_TARGET_PLATFORM}. See https://gitlab.com/wireshark/wireshark/-/issues/17779 for details." )
2018-02-09 21:59:15 +00:00
set ( WIRESHARK_TARGET_PROCESSOR_ARCHITECTURE x86 )
2023-02-13 04:27:02 +00:00
elseif ( WIRESHARK_TARGET_PLATFORM MATCHES "win64arm" )
set ( WIRESHARK_TARGET_PROCESSOR_ARCHITECTURE arm64 )
2021-09-22 12:40:57 +00:00
else ( )
message ( FATAL_ERROR "Invalid target platform: ${WIRESHARK_TARGET_PLATFORM}" )
2015-04-30 18:35:57 +00:00
endif ( )
2015-04-07 21:05:52 +00:00
# Sanity check
2021-09-20 13:14:03 +00:00
if ( MSVC )
if ( DEFINED ENV{PLATFORM} )
string ( TOLOWER $ENV{ PLATFORM } _vs_platform )
else ( )
set ( _vs_platform "[undefined]" ) # x86
endif ( )
if (
( _ v s _ p l a t f o r m S T R E Q U A L " x 6 4 " A N D N O T W I R E S H A R K _ T A R G E T _ P L A T F O R M S T R E Q U A L " w i n 6 4 " )
O R
( _ v s _ p l a t f o r m S T R E Q U A L " [ u n d e f i n e d ] " A N D N O T W I R E S H A R K _ T A R G E T _ P L A T F O R M S T R E Q U A L " w i n 3 2 " )
)
message ( FATAL_ERROR "The PLATFORM environment variable (${_vs_platform})"
" d o e s n ' t m a t c h t h e g e n e r a t o r platform ( ${ WIRESHARK_TARGET_PLATFORM } ) " )
endif ( )
2015-04-09 00:36:35 +00:00
endif ( )
2021-09-22 12:40:57 +00:00
message ( STATUS
2021-11-15 14:27:42 +00:00
" B u i l d i n g f o r $ { W I R E S H A R K _ T A R G E T _ P L A T F O R M } \
2021-09-22 22:02:03 +00:00
a n d C P U t a r g e t $ { W I R E S H A R K _ T A R G E T _ P R O C E S S O R _ A R C H I T E C T U R E } "
2021-09-22 12:40:57 +00:00
)
2015-01-09 21:53:17 +00:00
2015-11-16 14:02:16 +00:00
# Determine where the 3rd party libraries will be
2021-09-22 22:02:03 +00:00
if ( USE_REPOSITORY )
find_package ( PowerShell REQUIRED )
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" )
else ( )
# Don't know what to do
message ( FATAL_ERROR "Neither WIRESHARK_BASE_DIR or WIRESHARK_LIB_DIR are defined" )
endif ( )
2015-04-20 15:36:06 +00:00
2021-09-22 22:02:03 +00:00
# Download third-party libraries
file ( TO_NATIVE_PATH ${ CMAKE_SOURCE_DIR } /tools/win-setup.ps1 _win_setup )
file ( TO_NATIVE_PATH ${ _PROJECT_LIB_DIR } _ws_lib_dir )
2022-05-25 17:29:57 +00:00
file ( TO_NATIVE_PATH ${ CMAKE_COMMAND } _win_cmake_command )
2021-09-22 22:02:03 +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 (
2022-05-25 17:29:57 +00:00
C O M M A N D $ { P O W E R S H E L L _ C O M M A N D } " \ " $ { _ w i n _ s e t u p } \ " " - D e s t i n a t i o n " $ { _ w s _ l i b _ d i r } " - P l a t f o r m $ { W I R E S H A R K _ T A R G E T _ P L A T F O R M } - C M a k e E x e c u t a b l e " \ " $ { _ w i n _ c m a k e _ c o m m a n d } \ " "
2021-09-22 22:02:03 +00:00
R E S U L T _ V A R I A B L E _ w i n _ s e t u p _ f a i l e d
E R R O R _ V A R I A B L E _ w i n _ s e t u p _ e r r o r _ o u t p u t
)
if ( _win_setup_failed )
message ( FATAL_ERROR "Windows setup (win-setup.ps1) failed: ${_win_setup_error_output}." )
endif ( )
2015-04-07 21:05:52 +00:00
2021-09-22 22:02:03 +00:00
set ( EXTRA_INSTALLER_DIR ${ _ws_lib_dir } )
2019-03-18 23:32:54 +00:00
2021-09-22 22:02:03 +00:00
# XXX Add a dependency on ${_ws_lib_dir}/current_tag.txt?
endif ( )
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
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
" S i n g l e o u t p u t d i r e c t o r y f o r b u i l d i n g a l l a r c h i v e s . " )
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
" S i n g l e o u t p u t d i r e c t o r y f o r b u i l d i n g a l l e x e c u t a b l e s . " )
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
" S i n g l e o u t p u t d i r e c t o r y f o r b u i l d i n g a l l l i b r a r i e s . " )
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 ...
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT USE_MSYSTEM )
2018-11-23 20:39:51 +00:00
# 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
C A C H E P A T H " R e a d - o n l y a r c h i t e c t u r e - i n d e p e n d e n t d a t a "
)
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}" )
2021-12-31 03:03:45 +00:00
# Make sure our executables 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
2023-01-25 21:41:55 +00:00
#
# Also note that some systems (notably those using GNU libc)
# silently ignore $ORIGIN in RPATH for binaries that are
# setuid root or use privileged capabilities.
#
2019-01-19 00:59:29 +00:00
if ( CMAKE_SYSTEM_NAME MATCHES "^(Linux|SunOS|FreeBSD)$" )
2019-02-12 16:55:27 +00:00
set ( _enable_rpath_origin TRUE )
2019-01-19 00:59:29 +00:00
else ( )
2023-01-25 21:41:55 +00:00
set ( _enable_rpath_origin FALSE )
2019-01-19 00:59:29 +00:00
endif ( )
2023-01-25 21:41:55 +00:00
# Provide a knob to optionally force absolute rpaths,
# to support old/buggy systems and as a user preference
# for hardening.
# XXX Should this be a CMake option?
set ( ENABLE_RPATH_ORIGIN ${ _enable_rpath_origin } CACHE BOOL
" U s e $ O R I G I N w i t h I N S T A L L _ R P A T H " )
mark_as_advanced ( ENABLE_RPATH_ORIGIN )
2019-01-19 00:59:29 +00:00
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 )
2021-07-14 02:10:25 +00:00
if ( MSVC )
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 )
2021-07-14 02:10:25 +00:00
endif ( )
2018-10-02 20:33:02 +00:00
2021-03-23 02:13:34 +00:00
include ( CheckSymbolExists )
#
# Large file support on UN*X, a/k/a LFS.
#
# On Windows, we require _fseeki64() and _ftelli64(). Visual
# Studio has had supported them since Visual Studio 2005/MSVCR80,
# and we require newer versions, so we know we have them.
#
2023-01-11 00:10:05 +00:00
if ( NOT MSVC )
2021-03-23 02:13:34 +00:00
include ( FindLFS )
if ( LFS_FOUND )
#
# Add the required #defines.
#
add_definitions ( ${ LFS_DEFINITIONS } )
endif ( )
#
# Check for fseeko as well.
#
include ( FindFseeko )
if ( FSEEKO_FOUND )
set ( HAVE_FSEEKO ON )
#
# Add the required #defines.
#
add_definitions ( ${ FSEEKO_DEFINITIONS } )
endif ( )
endif ( )
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 ( )
2022-06-07 22:51:24 +00:00
# Used in .rc files and manifests
2015-01-06 23:07:50 +00:00
set ( RC_VERSION ${ PROJECT_MAJOR_VERSION } , ${ PROJECT_MINOR_VERSION } , ${ PROJECT_PATCH_VERSION } , ${ PROJECT_BUILD_VERSION } )
2022-06-07 22:51:24 +00:00
set ( LOG_RC_VERSION ${ LOG_PROJECT_MAJOR_VERSION } , ${ LOG_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
$ { C M A K E _ B I N A R Y _ D I R }
$ { C M A K E _ S O U R C E _ D I R }
2021-11-11 18:09:22 +00:00
$ { C M A K E _ S O U R C E _ D I R } / i n c l u d e
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
D U M P C A P _ I N S T A L L _ O P T I O N S T R E Q U A L " c a p a b i l i t i e s " )
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 )
2021-05-24 17:10:46 +00:00
# Preprocessor definitions common to all compilers
set_property ( DIRECTORY
P R O P E R T Y C O M P I L E _ D E F I N I T I O N S
" G _ D I S A B L E _ D E P R E C A T E D "
" G _ D I S A B L E _ S I N G L E _ I N C L U D E S "
2023-01-09 12:58:45 +00:00
$ < $ < O R : $ < B O O L : $ { E N A B L E _ D E B U G } > , $ < C O N F I G : D e b u g > , $ < C O N F I G : R e l W i t h D e b I n f o > > : W S _ D E B U G >
$ < $ < O R : $ < B O O L : $ { E N A B L E _ D E B U G _ U T F _ 8 } > , $ < C O N F I G : D e b u g > , $ < C O N F I G : R e l W i t h D e b I n f o > > : W S _ D E B U G _ U T F _ 8 >
2021-05-24 17:10:46 +00:00
)
2021-09-20 17:54:54 +00:00
if ( WIN32 )
#
# NOTE: Because of the way Qt moc is including "config.h" (not as the
# first header) this *MUST* be defined on the command line to precede
# every included header and not trigger symbol redefinition errors.
#
add_definitions (
2021-07-14 02:17:28 +00:00
- D W I N 3 2 _ L E A N _ A N D _ M E A N
#
2021-09-20 22:32:38 +00:00
# Use Unicode in Windows runtime functions.
#
- D U N I C O D E
- D _ U N I C O D E
#
2021-09-20 21:42:25 +00:00
# NOMINMAX keeps windows.h from defining "min" and "max" via windef.h.
# This avoids conflicts with the C++ standard library.
#
- D N O M I N M A X
2021-09-20 17:54:54 +00:00
)
endif ( )
2021-09-22 03:26:21 +00:00
if ( MINGW )
add_definitions (
#
# Enable POSIX APIs. This will switch stdio to ANSI C functions and
# enable C99 conformant vsnprintf() among other things.
#
- D _ P O S I X
)
2021-09-22 14:57:43 +00:00
list ( APPEND CMAKE_REQUIRED_DEFINITIONS -D_POSIX )
2021-09-22 03:26:21 +00:00
endif ( )
2013-09-23 21:45:55 +00:00
if ( CMAKE_C_COMPILER_ID MATCHES "MSVC" )
2021-12-16 11:58:44 +00:00
if ( MSVC_VERSION LESS "1928" )
message ( FATAL_ERROR "Microsoft Visual Studio 2019 version 16.8 or later is required" )
endif ( )
if ( 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
/ D _ C R T _ S E C U R E _ N O _ D E P R E C A T E
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
/ D P S A P I _ V E R S I O N = 1
/ D _ A L L O W _ K E Y W O R D _ M A C R O S
2021-09-21 09:02:41 +00:00
# Disable deprecation of POSIX function names.
2021-06-16 00:07:37 +00:00
# https://stackoverflow.com/questions/37845163/what-is-the-purpose-of-microsofts-underscore-c-functions
/ D _ C R T _ N O N S T D C _ N O _ W A R N I N G S
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
/ M P
)
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
#
2021-04-14 18:41:23 +00:00
# /diagnostics:caret Place a caret under compilation issues similar to
# Clang and gcc.
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/
2021-04-14 18:41:23 +00:00
list ( APPEND LOCAL_CFLAGS /diagnostics:caret /Zo /utf-8 /guard:cf )
2018-05-16 23:35:12 +00:00
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 )
2021-02-16 19:03:35 +00:00
# We should probably add a code_analysis.props file and use it to set
# CAExcludePath, otherwise we trigger on Qt's headers:
# https://stackoverflow.com/questions/59669026/how-to-add-property-to-affect-code-analysis-in-cmake
# https://gitlab.kitware.com/cmake/cmake/-/issues/19682
# For now, we set CAExcludePath=C:\Qt;%include% in the Visual Studio
# Code Analys builder's environment.
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
2021-12-31 03:03:45 +00:00
# Disable warnings about use of flexible array members:
2016-08-31 13:58:20 +00:00
## 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
2021-12-15 16:37:38 +00:00
# MSVC 14.28 + C11 enables C5105, but older Windows SDKs aren't completely compatible.
# Windows SDK 10.0.17763.0 generates syntax errors with C11 enabled.
if ( CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS 10.0.18362.0 )
2021-12-16 11:58:44 +00:00
message ( FATAL_ERROR "Windows SDK ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} doesn't support C11. Please make sure you're using 10.0.20348.0 or later." )
2021-12-15 16:37:38 +00:00
endif ( )
# Windows SDK 10.0.18362.0 to 10.0.19041.685 generate warning C5105 with C11 enabled.
if ( CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS 10.0.20348.0 )
2021-12-16 11:58:44 +00:00
message ( WARNING "Windows SDK ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} doesn't support C11. Please make sure you're using 10.0.20348.0 or later." )
2021-12-15 16:37:38 +00:00
## 5105: macro expansion producing 'defined' has undefined behavior
list ( APPEND LOCAL_CFLAGS /wd5105 )
2021-12-14 23:47:30 +00:00
endif ( )
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 )
2020-12-19 19:23:57 +00:00
# MIN_MACOS_VERSION is used to set LSMinimumSystemVersion
# in Info.plist, so start with something low.
2022-04-20 22:59:32 +00:00
set ( MIN_MACOS_VERSION 10.10 )
2018-12-14 19:30:39 +00:00
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 } )
2014-08-03 20:07:46 +00:00
endif ( )
endif ( )
2022-11-12 21:22:34 +00:00
#
# NOTE: Adding new warnings is a policy decision that can have far-reaching
# implications for the project and each developers workflow. Modern
# C compilers are on a race to add new warnings, not always sensibly.
# They are opt-in so take a moment to fully consider the implications
# of enabling the latest shiny new warning.
# If in doubt ask on the Wireshark developer list (recommended).
#
2018-09-10 00:13:56 +00:00
list ( APPEND WIRESHARK_COMMON_FLAGS
2022-11-12 21:22:34 +00:00
#
### Flags common to C and C++ ###
#
2013-11-17 14:03:58 +00:00
# -O<X> and -g get set by the CMAKE_BUILD_TYPE
- W a l l
- W e x t r a
- W p o i n t e r - a r i t h
- W f o r m a t - s e c u r i t y
2014-08-03 00:46:32 +00:00
- f n o - s t r i c t - o v e r f l o w
2022-11-17 09:50:36 +00:00
- f e x c e s s - p r e c i s i o n = f a s t # GCC-only
2013-11-17 14:03:58 +00:00
- W v l a
- W a t t r i b u t e s
2022-11-16 23:40:31 +00:00
- W p r a g m a s # Clang-only
- W h e a d e r - g u a r d # Clang-only
- W c o m m a # Clang-only
- W s h o r t e n - 6 4 - t o - 3 2 # Clang-only
2021-02-14 20:54:42 +00:00
- W r e d u n d a n t - d e c l s
2022-11-17 00:04:39 +00:00
- W u n r e a c h a b l e - c o d e # Clang-only
- W d o c u m e n t a t i o n # Clang-only
2022-11-17 00:15:03 +00:00
- W l o g i c a l - o p # GCC-only
2021-11-01 21:44:10 +00:00
#
2022-10-04 13:30:38 +00:00
# Disable errors unconditionally for some static analysis warnings
2022-12-15 02:32:24 +00:00
# that are dormant at lower optimizations levels or active only in
# bleeding edge versions of a compiler and possibly also
2022-10-04 13:30:38 +00:00
# prone to false positives and compiler bugs. This is
# a big nuisance because the warning is dormant and a low
# priority target for action. That is very disruptive
# with -Werror enabled (the default on the master branch).
2022-12-14 17:24:12 +00:00
#
2022-12-15 02:32:24 +00:00
- W n o - e r r o r = s t r i n g o p - o v e r f l o w =
#
2022-11-17 11:58:38 +00:00
# XXX Now that we have a CI job with Release build type (using
# -O3 optimization level) the dormancy issue should be ameliorated
# so comment out these exceptions to re-evaluate the impact.
#-Wno-error=maybe-uninitialized
#-Wno-error=alloc-size-larger-than=
2022-12-14 17:24:12 +00:00
#
2022-10-10 10:41:15 +00:00
# Updating external dependencies can introduce new deprecations.
# Also fixing new internal deprecations takes time.
# We want to be able to build with -Werror in that case. New
# code should not introduce new deprecations in any case.
#
- W n o - e r r o r = d e p r e c a t e d - d e c l a r a t i o n s
2017-07-31 08:43:58 +00:00
)
2017-08-06 22:49:13 +00:00
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
#
2022-11-12 21:22:34 +00:00
list ( APPEND WIRESHARK_COMMON_FLAGS
2018-05-29 23:44:09 +00:00
- W f r a m e - l a r g e r - t h a n = 3 2 7 6 8
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
2022-11-12 21:22:34 +00:00
#
### Flags for C only ###
#
2017-08-07 00:58:00 +00:00
#
# 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
- W s h a d o w
- W o l d - s t y l e - d e f i n i t i o n
- W s t r i c t - p r o t o t y p e s
)
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
( C M A K E _ C _ C O M P I L E R _ I D S T R E Q U A L " C l a n g " A N D C M A K E _ C _ C O M P I L E R _ V E R S I O N V E R S I O N _ L E S S " 6 . 0 " ) O R
2023-01-14 02:02:34 +00:00
( C M A K E _ C _ C O M P I L E R _ I D S T R E Q U A L " A p p l e C l a n g " A N D C M A K E _ C _ C O M P I L E R _ V E R S I O N V E R S I O N _ L E S S " 1 2 . 0 " ) )
2023-01-19 10:08:22 +00:00
if ( NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0" )
2018-12-08 11:11:23 +00:00
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
2022-11-12 21:22:34 +00:00
#
### Flags for C++ only ###
#
2022-11-16 23:40:31 +00:00
- W e x t r a - s e m i # Clang-only
2014-01-07 23:08:42 +00:00
)
2022-11-12 21:22:34 +00:00
#
# Not all warnings are the same. They fall on a spectrum from "critical"
# to "pedantic nonsense". These are warnings that realistically are worth
# fixing eventually.
#
if ( ENABLE_TODO_WARNINGS )
list ( APPEND WIRESHARK_COMMON_FLAGS
#
# All the registration functions block these for now.
#
- W m i s s i n g - p r o t o t y p e s
- W m i s s i n g - d e c l a r a t i o n s
#
# 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().
#
- W c a s t - a l i g n
)
else ( )
list ( APPEND WIRESHARK_COMMON_FLAGS
#
# Converting from g_printf() and g_snprintf() to stdio.h turns
# up many of these warnings. They will have to be handled later.
# It can be a lot of work to fix properly and none of them
# seem to flag very interesting issues.
#
- W n o - f o r m a t - t r u n c a t i o n # Enabled with -Wall
)
list ( APPEND WIRESHARK_C_ONLY_FLAGS
- W n o - p o i n t e r - s i g n # Enabled with -Wall
)
endif ( )
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.
#
2022-11-12 21:22:34 +00:00
if ( ENABLE_PEDANTIC_COMPILER_WARNINGS )
2018-09-10 00:13:56 +00:00
list ( APPEND WIRESHARK_COMMON_FLAGS
# The following are for C and C++
- W p e d a n t i c
2022-11-16 23:40:31 +00:00
- W n o - o v e r l e n g t h - s t r i n g s
- W n o - l o n g - l o n g
2018-09-10 00:13:56 +00:00
#
# As we use variadic macros, we don't want warnings
# about them, even with -Wpedantic.
#
- W n o - v a r i a d i c - m a c r o s
#
# Various code blocks this one.
#
- W o v e r f l o w
- f s t r i c t - o v e r f l o w - W s t r i c t - o v e r f l o w = 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.
#
- W c a s t - q u a l
#
2022-11-17 00:04:39 +00:00
# Doesn't warn of interesting issues. Usually the
# duplicated branches are protocol constants that
# happen to be equal and are relevant for documentation
# and readability and are trivially optimized by the
# compiler.
2018-09-10 00:13:56 +00:00
#
2022-11-17 00:04:39 +00:00
- W d u p l i c a t e d - b r a n c h e s # GCC-only
2018-09-10 00:13:56 +00:00
#
# 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?
#
- f n o - d e l e t e - n u l l - p o i n t e r - c h e c k s
)
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.
#
- W b a d - f u n c t i o n - c a s t
)
2014-01-07 23:08:42 +00:00
2018-09-10 00:13:56 +00:00
list ( APPEND WIRESHARK_CXX_ONLY_FLAGS
)
2014-03-15 11:52:29 +00:00
endif ( )
2021-04-12 19:13:02 +00:00
if ( ENABLE_COMPILER_COLOR_DIAGNOSTICS )
if ( CMAKE_C_COMPILER_ID MATCHES "Clang" )
set ( WIRESHARK_COMMON_FLAGS ${ WIRESHARK_COMMON_FLAGS }
- f c o l o r - d i a g n o s t i c s
)
elseif ( CMAKE_C_COMPILER_ID MATCHES "GNU" )
set ( WIRESHARK_COMMON_FLAGS ${ WIRESHARK_COMMON_FLAGS }
- f d i a g n o s t i c s - c o l o r = a l w a y s
)
endif ( )
endif ( )
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
- W l , - - a s - n e e d e d
# -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 ( )
2021-03-29 10:10:16 +00:00
if ( MSVC )
if ( ENABLE_VLD )
include ( FindVLD )
2021-04-26 19:37:06 +00:00
if ( NOT VLD_FOUND )
2021-03-29 10:10:16 +00:00
message ( FATAL_ERROR "ENABLE_VLD was requested, but not found!" )
endif ( )
message ( STATUS "Enabling Visual Leak Detector in Debug configuration" )
set ( WS_MSVC_DEBUG_LINK_FLAGS ${ VLD_LINK_FLAGS } )
endif ( )
endif ( )
2016-09-30 14:06:15 +00:00
set ( WERROR_COMMON_FLAGS "" )
2022-11-12 21:07:13 +00:00
if ( ENABLE_WERROR )
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 ( 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."
" A l l s h a r e d l i b r a r y s y m b o l s w i l l b e e x p o r t e d . " )
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
2021-02-17 02:04:59 +00:00
include_directories ( SYSTEM /usr/local/opt/gettext/include )
2013-09-10 21:24:52 +00:00
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
$ { _ p a c k a g e _ n a m e } _ L I B R A R Y
$ { _ p a c k a g e _ n a m e } _ I N C L U D E _ D I R
# mark_as_advanced
$ { _ p a c k a g e _ n a m e } _ L I B R A R I E S
$ { _ p a c k a g e _ n a m e } _ I N C L U D E _ D I R S
# Others
$ { _ p a c k a g e _ n a m e } _ D L L _ D I R
$ { _ p a c k a g e _ n a m e } _ D L L S
$ { _ p a c k a g e _ n a m e } _ D L L
$ { _ p a c k a g e _ n a m e } _ P D B
$ { A R G N }
)
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 )
2022-11-02 13:11:30 +00:00
find_package ( GLIB2 "2.54.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 )
2022-04-21 01:08:29 +00:00
find_package ( GCRYPT "1.8.0" REQUIRED )
2019-11-22 19:16:36 +00:00
# C Asynchronous resolver
reset_find_package ( CARES )
2022-09-30 12:50:06 +00:00
find_package ( CARES "1.13.0" REQUIRED )
2019-01-10 01:45:00 +00:00
find_package ( LEX REQUIRED )
2022-07-22 20:47:59 +00:00
find_package ( Perl )
2021-11-12 10:11:25 +00:00
find_package ( PCRE2 REQUIRED )
2015-01-15 21:07:48 +00:00
2022-11-17 13:31:45 +00:00
find_package ( Python3 3.6 REQUIRED )
# Several files (including LocatePythonModule) still use the old name
# from FindPythonInterp, let's stick to it for now.
set ( PYTHON_EXECUTABLE ${ Python3_EXECUTABLE } )
2019-01-09 18:34:57 +00:00
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 ( )
2022-03-08 21:38:13 +00:00
if ( BUILD_sshdump OR BUILD_ciscodump OR BUILD_wifidump )
2019-01-10 01:45:00 +00:00
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
2021-12-23 21:55:15 +00:00
# Build one of the Qt GUIs?
2022-06-30 16:45:49 +00:00
if ( BUILD_wireshark OR BUILD_logray )
2021-11-18 00:29:59 +00:00
if ( USE_qt6 )
set ( qtver "6" )
2022-08-26 08:42:28 +00:00
if ( DEFINED ENV{WIRESHARK_QT6_PREFIX_PATH} )
list ( APPEND CMAKE_PREFIX_PATH $ENV{ WIRESHARK_QT6_PREFIX_PATH } )
endif ( )
2021-11-18 00:29:59 +00:00
else ( )
set ( qtver "5" )
2022-08-26 08:42:28 +00:00
if ( DEFINED ENV{WIRESHARK_QT5_PREFIX_PATH} )
list ( APPEND CMAKE_PREFIX_PATH $ENV{ WIRESHARK_QT5_PREFIX_PATH } )
2022-03-21 19:07:13 +00:00
# XXX We used to recommend setting QT5_BASE_DIR. Remove after the 4.0 branch is created.
2023-01-11 00:10:05 +00:00
elseif ( WIN32 AND NOT USE_MSYSTEM AND DEFINED ENV{QT5_BASE_DIR} )
2022-03-21 19:07:13 +00:00
message ( WARNING "Support for QT5_BASE_DIR will be removed in a future release." )
set ( QT5_BASE_PATH "$ENV{QT5_BASE_DIR}" )
set ( CMAKE_PREFIX_PATH "${QT5_BASE_PATH}" )
endif ( )
2019-01-10 01:45:00 +00:00
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
2021-11-18 00:29:59 +00:00
Q t $ { q t v e r } C o r e
Q t $ { q t v e r } G u i
Q t $ { q t v e r } L i n g u i s t T o o l s
Q t $ { q t v e r } P r i n t S u p p o r t
Q t $ { q t v e r } W i d g e t s
2022-07-10 09:13:07 +00:00
Q t $ { q t v e r } C o n c u r r e n t
2018-04-07 10:58:17 +00:00
)
2022-05-24 01:59:35 +00:00
set ( QT_OPTIONAL_PACKAGELIST
Q t $ { q t v e r } M u l t i m e d i a
)
2021-11-18 00:29:59 +00:00
if ( USE_qt6 )
set ( CMAKE_CXX_STANDARD 17 )
# Setting CMAKE_CXX_STANDARD is not sufficient with MSVC, see
# https://gitlab.kitware.com/cmake/cmake/-/issues/18837
2021-11-26 13:42:47 +00:00
# The below test can be found in Qt6, lib/cmake/Qt6/QtFeature.cmake
2021-11-18 00:29:59 +00:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION GREATER_EQUAL 1913 )
2021-11-26 13:42:47 +00:00
add_definitions ( "-Zc:__cplusplus" )
2021-11-18 00:29:59 +00:00
endif ( )
list ( APPEND QT_PACKAGELIST Qt6Core5Compat )
else ( )
if ( WIN32 )
list ( APPEND QT_PACKAGELIST Qt5WinExtras )
endif ( )
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 ( )
2022-05-24 01:59:35 +00:00
foreach ( _qt_package IN LISTS QT_OPTIONAL_PACKAGELIST )
find_package ( ${ _qt_package } ${ 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 ( )
2021-03-10 17:01:09 +00:00
if ( APPLE AND "/usr/local/opt/qt5/lib/QtCore.framework" IN_LIST Qt5Core_INCLUDE_DIRS )
# When qt@6 and qt@5 are both installed via Homebrew,
# /usr/local/include/QtCore/qvariant.h points to Qt 6 headers.
# Normally the Headers from `-iframework /usr/local/opt/qt5/lib`
# should be used, but `-isystem /usr/local/include` (via
# Libgcrypt and others) seems to prioritized, resulting in use
# of the Qt6 headers. Resolve this by explicit including Qt5.
list ( APPEND QT_INCLUDE_DIRS /usr/local/opt/qt5/include )
endif ( )
2019-01-10 01:45:00 +00:00
set ( QT_FOUND ON )
2021-11-18 00:29:59 +00:00
if ( APPLE )
2022-04-21 17:11:08 +00:00
ws_find_package ( Sparkle ENABLE_SPARKLE HAVE_SOFTWARE_UPDATE 2 )
2021-11-18 00:29:59 +00:00
endif ( )
2021-11-21 21:05:36 +00:00
if ( Qt ${ qtver } Multimedia_FOUND )
set ( QT_MULTIMEDIA_LIB 1 )
endif ( )
2012-02-02 00:46:02 +00:00
endif ( )
2018-02-09 01:20:26 +00:00
# MaxMind DB address resolution
2021-06-23 10:07:37 +00:00
reset_find_package ( MAXMINDDB )
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.
2022-04-23 00:54:16 +00:00
ws_find_package ( GNUTLS ENABLE_GNUTLS HAVE_LIBGNUTLS "3.5.8" )
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
2022-04-24 01:19:43 +00:00
ws_find_package ( NGHTTP2 ENABLE_NGHTTP2 HAVE_NGHTTP2 "1.11.0" )
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
2021-07-13 18:02:52 +00:00
# SpanDSP codec
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 )
2020-09-29 04:33:06 +00:00
ws_find_package ( OPUS ENABLE_OPUS HAVE_OPUS )
2022-06-30 16:45:49 +00:00
if ( BUILD_logray )
2022-03-27 18:30:32 +00:00
# libsinsp+libscap, required for falco-bridge
ws_find_package ( Sinsp ENABLE_SINSP HAVE_SINSP )
endif ( )
2022-03-10 20:21:12 +00:00
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 ( )
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-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.
2022-06-30 16:45:49 +00:00
if ( BUILD_wireshark OR BUILD_logray OR BUILD_sharkd )
2022-12-15 18:54:48 +00:00
find_package ( SpeexDSP REQUIRED )
2019-02-02 14:52:07 +00:00
endif ( )
2021-01-09 18:49:24 +00:00
# Generate the distribution tarball.
2017-06-19 14:37:29 +00:00
add_custom_target ( dist
2019-01-11 22:34:03 +00:00
C O M M A N D $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / s o u r c e / g i t - e x p o r t - r e l e a s e . s h - d " $ { C M A K E _ B I N A R Y _ D I R } "
2018-04-16 18:39:27 +00:00
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ S O U R C E _ D I R }
2017-06-19 14:37:29 +00:00
)
2022-04-23 00:54:16 +00:00
if ( GNUTLS_FOUND )
2020-11-26 06:10:34 +00:00
# Calculating public keys from PKCS #11 private keys requires GnuTLS
# 3.4.0 or greater.
2018-12-12 13:34:00 +00:00
#
2020-11-26 06:10:34 +00:00
# Check that the support is present in case GnuTLS was compiled
2020-12-21 16:27:44 +00:00
# --without-p11-kit as macos-setup.sh did until December 2020.
2018-12-12 13:34:00 +00:00
cmake_push_check_state ( )
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT MINGW )
2018-12-12 13:34:00 +00:00
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 )
2022-07-13 21:22:28 +00:00
if ( Qt ${ qtver } Widgets_VERSION VERSION_LESS 5.10 )
message ( FATAL_ERROR "Qt 5.12 or later is required." )
endif ( )
if ( Qt ${ qtver } Widgets_VERSION VERSION_LESS 5.12 )
message ( WARNING "Wireshark can be build with this version of Qt, though 5.12 or higher is recommended." )
2018-05-10 15:53:42 +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
2021-12-31 03:03:45 +00:00
# from Qt5::qmake, which is defined in Qt5CoreConfigExtras.cmake.
2021-11-18 00:29:59 +00:00
get_target_property ( QT_QMAKE_EXECUTABLE Qt ${ qtver } ::qmake IMPORTED_LOCATION )
2018-06-20 22:59:41 +00:00
get_filename_component ( _qt_bin_path "${QT_QMAKE_EXECUTABLE}" DIRECTORY )
set ( QT_BIN_PATH "${_qt_bin_path}" CACHE INTERNAL
" P a t h t o q m a k e , m a c d e p l o y q t , w i n d e p l o y q t , a n d o t h e r Q t u t i l i t i e s . "
)
# Use qmake to find windeployqt and macdeployqt. Ideally one of
# the modules in ${QTDIR}/lib/cmake would do this for us.
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT USE_MSYSTEM )
find_program ( QT_WINDEPLOYQT_EXECUTABLE windeployqt
2018-06-20 22:59:41 +00:00
H I N T S " $ { Q T _ B I N _ P A T H } "
D O C " P a t h t o t h e w i n d e p l o y q t u t i l i t y . "
)
elseif ( APPLE )
find_program ( QT_MACDEPLOYQT_EXECUTABLE macdeployqt
H I N T S " $ { Q T _ B I N _ P A T H } "
D O C " P a t h t o t h e m a c d e p l o y q t u t i l i t y . "
)
2019-09-25 20:17:31 +00:00
find_program ( DMGBUILD_EXECUTABLE dmgbuild
D O C " P a t h t o t h e d m g b u i l d u t i l i t y "
)
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
2020-12-19 19:23:57 +00:00
# https://doc.qt.io/qt-5.15/supported-platforms.html
# https://doc-snapshots.qt.io/qt6-dev/supported-platforms.html
2022-04-22 00:19:56 +00:00
if ( Qt ${ qtver } Widgets_VERSION VERSION_GREATER_EQUAL "6.0.0" )
2020-12-19 19:23:57 +00:00
set ( MIN_MACOS_VERSION 10.14 )
2022-04-22 00:19:56 +00:00
elseif ( Qt5Widgets_VERSION VERSION_GREATER_EQUAL "5.14.0" )
2020-05-27 22:00:46 +00:00
set ( MIN_MACOS_VERSION 10.13 )
2022-04-22 00:19:56 +00:00
elseif ( Qt5Widgets_VERSION VERSION_GREATER_EQUAL "5.12.0" )
2018-12-14 19:30:39 +00:00
set ( MIN_MACOS_VERSION 10.12 )
2022-04-22 00:19:56 +00:00
elseif ( Qt5Widgets_VERSION VERSION_GREATER_EQUAL "5.10.0" )
2018-12-14 19:30:39 +00:00
set ( MIN_MACOS_VERSION 10.11 )
endif ( )
if ( CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS MIN_MACOS_VERSION )
2021-11-18 00:29:59 +00:00
message ( FATAL_ERROR "Qt version ${Qt${qtver}Widgets_VERSION} requires CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) >= ${MIN_MACOS_VERSION}" )
2018-12-14 19:30:39 +00:00
endif ( )
2018-06-20 22:59:41 +00:00
endif ( )
2022-07-10 10:25:57 +00:00
# Qt requires MSVC /permissive- option since 6.3 release
if ( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND Qt ${ qtver } Widgets_VERSION VERSION_GREATER_EQUAL "6.3.0" )
add_compile_options ( "/permissive-" )
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 )
2021-07-13 18:02:52 +00:00
set ( WIN_COMCTL32_LIBRARY comctl32.lib )
set ( WIN_IPHLPAPI_LIBRARY iphlpapi.lib )
2018-10-08 03:38:51 +00:00
set ( WIN_PSAPI_LIBRARY psapi.lib )
set ( WIN_VERSION_LIBRARY version.lib )
2021-07-13 18:02:52 +00:00
set ( WIN_WS2_32_LIBRARY ws2_32.lib )
2018-10-08 03:38:51 +00:00
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 )
2020-12-19 19:23:57 +00:00
message ( STATUS "Building for Mac OS X/OS X/macOS ${MIN_MACOS_VERSION} using SDK ${CMAKE_OSX_SYSROOT}" )
2014-11-10 20:24:18 +00:00
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
2020-10-29 22:42:27 +00:00
if ( ENABLE_CCACHE )
if ( NOT ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" ) )
# https://ccache.dev/platform-compiler-language-support.html
message ( WARNING "Ccache is enabled, but your compiler is ${CMAKE_C_COMPILER_ID}."
" W e w i s h y o u t h e b e s t o f l u c k . " )
endif ( )
2016-11-08 19:11:14 +00:00
find_program ( CCACHE_EXECUTABLE ccache )
if ( CCACHE_EXECUTABLE )
2022-07-25 21:01:41 +00:00
set ( CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}" )
set ( CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}" )
set ( CMAKE_C_LINKER_LAUNCHER "${CCACHE_EXECUTABLE}" )
set ( CMAKE_CXX_LINKER_LAUNCHER "${CCACHE_EXECUTABLE}" )
2016-11-08 19:11:14 +00:00
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
P R O P E R T I E S
F O L D E R " A u x i l i a r y "
E X C L U D E _ F R O M _ A L L T r u e
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D T r u e
)
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.
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT USE_MSYSTEM )
2022-04-18 23:46:20 +00:00
set ( EXTCAP_INSTALL_LIBDIR "extcap" CACHE INTERNAL "The extcap dir" )
2023-01-11 00:10:05 +00:00
else ( )
2022-04-18 23:46:20 +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 ( )
2023-01-11 00:10:05 +00:00
set ( EXTCAP_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${EXTCAP_INSTALL_LIBDIR}" )
2018-05-24 13:08:48 +00:00
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.
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT USE_MSYSTEM )
2018-08-21 21:23:46 +00:00
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 ( )
2023-01-11 00:10:05 +00:00
set ( PLUGIN_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_LIBDIR}" )
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
2021-03-24 22:09:19 +00:00
add_subdirectory ( capture )
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 )
2022-03-18 01:41:12 +00:00
add_subdirectory ( tools/radiotap-gen )
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." )
2022-06-17 22:22:26 +00:00
if ( ENABLE_APPLICATION_BUNDLE )
if ( CMAKE_CFG_INTDIR STREQUAL "." )
set ( _log_datafile_dir "${CMAKE_BINARY_DIR}/run/Logray.app/Contents/Resources/share/logray" )
else ( )
# Xcode
set ( _log_datafile_dir "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}/Logray.app/Contents/Resources/share/logray" )
endif ( )
set ( LOG_DATAFILE_DIR ${ _log_datafile_dir } CACHE INTERNAL "Build time log analysis data file location." )
# XXX We need to update wsutil/filesystem.c and packaging/nsis/*logray* to match.
# elseif(NOT CMAKE_CFG_INTDIR STREQUAL ".")
# # Visual Studio, Xcode, etc.
# set(_log_datafile_dir "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}/share/logray")
# else()
# # Makefile, Ninja, etc.
# set(_log_datafile_dir "${CMAKE_BINARY_DIR}/run/share/logray")
endif ( )
2018-12-07 01:01:28 +00:00
# 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 )
2022-08-22 07:57:46 +00:00
elseif ( BUILD_wireshark AND USE_qt6 )
message ( VERBOSE "To use Qt5 instead of Qt6 use CMake option USE_qt6=OFF." )
2012-02-02 00:46:02 +00:00
endif ( )
2022-06-30 16:45:49 +00:00
if ( BUILD_logray AND QT_FOUND )
add_subdirectory ( ui/logray )
2021-12-23 21:55:15 +00:00
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
p l u g i n s / e p a n / e t h e r c a t
p l u g i n s / e p a n / g r y p h o n
p l u g i n s / e p a n / i r d a
p l u g i n s / e p a n / m a t e
p l u g i n s / e p a n / o p c u a
p l u g i n s / e p a n / p r o f i n e t
p l u g i n s / e p a n / s t a t s _ t r e e
p l u g i n s / e p a n / t r a n s u m
p l u g i n s / e p a n / u n i s t i m
p l u g i n s / e p a n / w i m a x
p l u g i n s / e p a n / w i m a x a s n c p
p l u g i n s / e p a n / w i m a x m a c p h y
2018-01-26 23:46:32 +00:00
p l u g i n s / w i r e t a p / u s b d u m p
2019-02-03 01:07:26 +00:00
p l u g i n s / c o d e c s / G 7 1 1
2018-02-27 07:22:25 +00:00
p l u g i n s / c o d e c s / l 1 6 _ m o n o
2015-01-18 21:27:13 +00:00
$ { C U S T O M _ P L U G I N _ S R C _ D I R }
)
2022-06-30 16:45:49 +00:00
set ( LOGRAY_PLUGIN_SRC_DIRS )
2022-03-10 20:21:12 +00:00
if ( SINSP_FOUND )
2022-06-30 16:45:49 +00:00
list ( APPEND LOGRAY_PLUGIN_SRC_DIRS
2022-03-10 20:21:12 +00:00
p l u g i n s / e p a n / f a l c o _ b r i d g e
)
endif ( )
2019-02-03 01:07:26 +00:00
if ( SPANDSP_FOUND )
list ( APPEND PLUGIN_SRC_DIRS
p l u g i n s / c o d e c s / G 7 2 2
p l u g i n s / c o d e c s / G 7 2 6
)
endif ( )
if ( BCG729_FOUND )
list ( APPEND PLUGIN_SRC_DIRS
p l u g i n s / c o d e c s / G 7 2 9
)
endif ( )
2019-11-18 22:55:25 +00:00
if ( ILBC_FOUND )
list ( APPEND PLUGIN_SRC_DIRS
p l u g i n s / c o d e c s / i L B C
)
endif ( )
2020-09-29 04:33:06 +00:00
if ( OPUS_FOUND )
list ( APPEND PLUGIN_SRC_DIRS
p l u g i n s / c o d e c s / o p u s _ d e c
)
endif ( )
2019-02-03 01:07:26 +00:00
if ( SBC_FOUND )
list ( APPEND PLUGIN_SRC_DIRS
p l u g i n s / c o d e c s / s b c
)
endif ( )
2017-01-24 16:34:07 +00:00
# Build demo plugin, only if asked explicitly
if ( ENABLE_PLUGIN_IFDEMO )
2022-08-13 03:42:44 +00:00
list ( APPEND PLUGIN_SRC_DIRS
2018-01-16 15:59:28 +00:00
p l u g i n s / e p a n / p l u g i n i f d e m o
2017-01-24 16:34:07 +00:00
)
endif ( )
2015-01-18 21:27:13 +00:00
else ( )
set ( PLUGIN_SRC_DIRS )
2022-06-30 16:45:49 +00:00
set ( LOGRAY_PLUGIN_SRC_DIRS )
2015-01-18 21:27:13 +00:00
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 ( )
2022-02-20 20:09:34 +00:00
if ( CMAKE_CFG_INTDIR STREQUAL "." )
2022-06-30 16:45:49 +00:00
set ( _logray_plugin_dir "${CMAKE_BINARY_DIR}/run/Logray.app/Contents/PlugIns/logray/${PLUGIN_PATH_ID}" )
2022-02-20 20:09:34 +00:00
else ( )
# Xcode
2022-06-30 16:45:49 +00:00
set ( _logray_plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/Logray.app/Contents/PlugIns/logray/${PLUGIN_PATH_ID}" )
2022-02-20 20:09:34 +00:00
endif ( )
2023-01-11 00:10:05 +00:00
elseif ( MSVC AND NOT CMAKE_CFG_INTDIR STREQUAL "." )
2018-06-15 10:44:47 +00:00
set ( _plugin_dir "${CMAKE_BINARY_DIR}/run/$<CONFIG>/${PLUGIN_VERSION_DIR}" )
2022-06-30 16:45:49 +00:00
set ( _logray_plugin_dir ${ _plugin_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}" )
2022-06-30 16:45:49 +00:00
set ( _logray_plugin_dir ${ _plugin_dir } )
2015-01-18 21:27:13 +00:00
endif ( )
set ( PLUGIN_DIR ${ _plugin_dir } CACHE INTERNAL "Build time plugin location." )
2022-06-30 16:45:49 +00:00
set ( LOGRAY_PLUGIN_DIR ${ _logray_plugin_dir } CACHE INTERNAL "Build time Logray plugin location." )
2015-01-18 21:27:13 +00:00
2022-06-30 16:45:49 +00:00
foreach ( _plugin_src_dir ${ PLUGIN_SRC_DIRS } ${ LOGRAY_PLUGIN_SRC_DIRS } )
2015-01-18 21:27:13 +00:00
add_subdirectory ( ${ _plugin_src_dir } )
endforeach ( )
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"
_ v e r s i o n _ h _ c o n t e n t s E S C A P E _ Q U O T E S )
2021-07-03 13:26:30 +00:00
file ( WRITE "${CMAKE_BINARY_DIR}/vcs_version.h" "${_version_h_contents}" )
2019-07-27 16:10:39 +00:00
message ( STATUS "VCSVERSION_OVERRIDE: ${VCSVERSION_OVERRIDE}" )
else ( )
2021-07-03 13:26:30 +00:00
add_custom_target ( vcs_version
B Y P R O D U C T S v c s _ v e r s i o n . h
2022-07-11 14:44:23 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E }
$ { C M A K E _ S O U R C E _ D I R } / t o o l s / m a k e - v e r s i o n . p y
2019-07-27 16:10:39 +00:00
$ { C M A K E _ S O U R C E _ D I R }
)
2021-07-03 13:26:30 +00:00
set_target_properties ( vcs_version PROPERTIES FOLDER "Auxiliary" )
2019-07-27 16:10:39 +00:00
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
d o x y g e n . c f g
p a c k a g i n g / m a c o s x / o s x - a p p . s h
2019-09-26 17:43:13 +00:00
p a c k a g i n g / m a c o s x / o s x - d m g . s h
2022-02-26 23:14:36 +00:00
p a c k a g i n g / m a c o s x / w i r e s h a r k - a p p . d m g b u i l d
p a c k a g i n g / m a c o s x / w i r e s h a r k - d s y m . d m g b u i l d
2022-02-21 00:19:22 +00:00
p a c k a g i n g / m a c o s x / W i r e s h a r k I n f o . p l i s t
2019-01-11 22:34:03 +00:00
p a c k a g i n g / s o u r c e / g i t - e x p o r t - r e l e a s e . s h
2022-03-06 22:16:36 +00:00
r e s o u r c e s / d u m p c a p . r c
r e s o u r c e s / l i b w i r e s h a r k . r c
r e s o u r c e s / l i b w i r e t a p . r c
r e s o u r c e s / l i b w s u t i l . r c
r e s o u r c e s / w i r e s h a r k . e x e . m a n i f e s t
r e s o u r c e s / w i r e s h a r k . r c
2018-10-08 23:34:39 +00:00
w i r e s h a r k . p c
2014-06-20 22:38:07 +00:00
)
2022-06-08 01:38:46 +00:00
2022-06-30 16:45:49 +00:00
if ( BUILD_logray )
2022-06-08 01:38:46 +00:00
list ( APPEND CFG_OUT_FILES
2022-06-30 16:45:49 +00:00
p a c k a g i n g / m a c o s x / L o g r a y I n f o . p l i s t
p a c k a g i n g / m a c o s x / l o g r a y - a p p . d m g b u i l d
p a c k a g i n g / m a c o s x / l o g r a y - d s y m . d m g b u i l d
r e s o u r c e s / l o g r a y . e x e . m a n i f e s t
2022-06-08 01:38:46 +00:00
)
endif ( )
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
D E S C R I P T I O N " T h e L i b c a p p a c k a g e i m p l e m e n t s t h e u s e r - s p a c e i n t e r f a c e s t o t h e P O S I X 1 0 0 3 . 1 e c a p a b i l i t i e s a v a i l a b l e i n L i n u x k e r n e l s "
U R L " h t t p s : / / s i t e s . g o o g l e . c o m / s i t e / f u l l y c a p a b l e / "
P U R P O S E " A l l o w p a c k e t c a p t u r e s w i t h o u t r u n n i n g a s r o o t "
)
2017-06-25 22:34:41 +00:00
set_package_properties ( SBC PROPERTIES
D E S C R I P T I O N " B l u e t o o t h l o w - c o m p l e x i t y , s u b b a n d codec ( SBC ) d e c o d e r "
U R L " h t t p s : / / g i t . k e r n e l . o r g / p u b / s c m / b l u e t o o t h / s b c . g i t "
P U R P O S E " S u p p o r t f o r p l a y i n g S B C c o d e c i n R T P p l a y e r "
)
set_package_properties ( SPANDSP PROPERTIES
D E S C R I P T I O N " a l i b r a r y o f m a n y D S P f u n c t i o n s f o r t e l e p h o n y "
2019-07-27 07:54:44 +00:00
U R L " h t t p s : / / w w w . s o f t - s w i t c h . o r g "
2017-06-25 22:34:41 +00:00
P U R P O S E " S u p p o r t f o r G . 7 2 2 a n d G . 7 2 6 c o d e c s i n R T P p l a y e r "
)
2017-07-26 21:23:12 +00:00
set_package_properties ( BCG729 PROPERTIES
D E S C R I P T I O N " G . 7 2 9 d e c o d e r "
2021-04-26 06:41:17 +00:00
U R L " h t t p s : / / w w w . l i n p h o n e . o r g / t e c h n i c a l - c o r n e r / b c g 7 2 9 "
2017-07-26 21:23:12 +00:00
P U R P O S E " S u p p o r t f o r G . 7 2 9 c o d e c i n R T P p l a y e r "
)
2019-11-18 22:55:25 +00:00
set_package_properties ( ILBC PROPERTIES
D E S C R I P T I O N " i L B C d e c o d e r "
U R L " h t t p s : / / g i t h u b . c o m / T i m o t h y G u / l i b i l b c "
P U R P O S E " S u p p o r t f o r i L B C c o d e c i n R T P p l a y e r "
)
2020-09-29 04:33:06 +00:00
set_package_properties ( OPUS PROPERTIES
D E S C R I P T I O N " o p u s d e c o d e r "
U R L " h t t p s : / / o p u s - c o d e c . o r g / "
P U R P O S E " S u p p o r t f o r o p u s c o d e c i n R T P p l a y e r "
)
2017-06-25 22:34:41 +00:00
set_package_properties ( LIBXML2 PROPERTIES
D E S C R I P T I O N " X M L p a r s i n g l i b r a r y "
U R L " h t t p : / / x m l s o f t . o r g / "
P U R P O S E " R e a d X M L c o n f i g u r a t i o n f i l e s i n E P L d i s s e c t o r "
)
set_package_properties ( LIBSSH PROPERTIES
D E S C R I P T I O N " L i b r a r y f o r i m p l e m e n t i n g S S H c l i e n t s "
U R L " h t t p s : / / w w w . l i b s s h . o r g / "
2022-03-08 21:38:13 +00:00
P U R P O S E " e x t c a p r e m o t e S S H interfaces ( sshdump, ciscodump, wifidump ) "
2017-06-25 22:34:41 +00:00
)
set_package_properties ( LZ4 PROPERTIES
2021-09-11 00:46:54 +00:00
D E S C R I P T I O N " L Z 4 i s a f a s t l o s s l e s s c o m p r e s s i o n a l g o r i t h m "
2017-06-25 22:34:41 +00:00
U R L " h t t p : / / w w w . l z 4 . o r g "
2021-09-11 00:46:54 +00:00
P U R P O S E " L Z 4 d e c o m p r e s s i o n i n C Q L a n d K a f k a d i s s e c t o r s , r e a d c o m p r e s s e d c a p t u r e f i l e s "
2017-06-25 22:34:41 +00:00
)
set_package_properties ( SNAPPY PROPERTIES
D E S C R I P T I O N " A f a s t c o m p r e s s o r / d e c o m p r e s s o r f r o m G o o g l e "
2019-07-27 07:54:44 +00:00
U R L " h t t p s : / / g o o g l e . g i t h u b . i o / s n a p p y / "
2017-06-25 22:34:41 +00:00
P U R P O S E " S n a p p y d e c o m p r e s s i o n i n C Q L a n d K a f k a d i s s e c t o r s "
)
2019-08-12 21:57:45 +00:00
set_package_properties ( ZSTD PROPERTIES
D E S C R I P T I O N " A c o m p r e s s o r / d e c o m p r e s s o r f r o m F a c e b o o k p r o v i d i n g b e t t e r c o m p r e s s i o n t h a n S n a p p y a t a c o s t o f s p e e d "
U R L " h t t p s : / / f a c e b o o k . g i t h u b . i o / z s t d / "
2021-09-11 00:46:54 +00:00
P U R P O S E " Z s t d d e c o m p r e s s i o n i n K a f k a d i s s e c t o r , r e a d c o m p r e s s e d c a p t u r e f i l e s "
2019-08-12 21:57:45 +00:00
)
2017-06-25 22:34:41 +00:00
set_package_properties ( NGHTTP2 PROPERTIES
D E S C R I P T I O N " H T T P / 2 C l i b r a r y a n d t o o l s "
U R L " h t t p s : / / n g h t t p 2 . o r g "
P U R P O S E " H e a d e r d e c o m p r e s s i o n i n H T T P 2 "
)
2019-01-28 20:02:34 +00:00
set_package_properties ( CARES PROPERTIES
D E S C R I P T I O N " L i b r a r y f o r a s y n c h r o n o u s D N S r e q u e s t s "
2021-11-16 09:10:54 +00:00
U R L " h t t p s : / / c - a r e s . o r g / "
2019-01-28 20:02:34 +00:00
P U R P O S E " D N S n a m e r e s o l u t i o n f o r c a p t u r e s "
)
2019-01-31 10:34:47 +00:00
set_package_properties ( Systemd PROPERTIES
U R L " h t t p s : / / f r e e d e s k t o p . o r g / w i k i / S o f t w a r e / s y s t e m d / "
D E S C R I P T I O N " S y s t e m a n d S e r v i c e Manager ( libraries ) "
P U R P O S E " S u p p o r t f o r s y s t e m d j o u r n a l e x t c a p interface ( sdjournal ) "
)
2019-01-31 10:43:04 +00:00
set_package_properties ( NL PROPERTIES
U R L " h t t p s : / / w w w . i n f r a d e a d . o r g / ~ t g r / l i b n l / "
D E S C R I P T I O N " L i b r a r i e s f o r u s i n g t h e N e t l i n k p r o t o c o l o n L i n u x "
P U R P O S E " S u p p o r t f o r m a n a g i n g w i r e l e s s 8 0 2 . 1 1 i n t e r f a c e s "
)
2019-01-31 10:47:26 +00:00
set_package_properties ( MaxMindDB PROPERTIES
U R L " h t t p s : / / g i t h u b . c o m / m a x m i n d / l i b m a x m i n d d b "
D E S C R I P T I O N " C l i b r a r y f o r t h e M a x M i n d D B f i l e f o r m a t "
P U R P O S E " S u p p o r t f o r G e o I P l o o k u p "
)
2019-02-02 14:52:07 +00:00
set_package_properties ( SpeexDSP PROPERTIES
U R L " h t t p s : / / w w w . s p e e x . o r g / "
D E S C R I P T I O N " S p e e x D S P i s a p a t e n t - f r e e , O p e n S o u r c e / F r e e S o f t w a r e D S P l i b r a r y "
P U R P O S E " R T P a u d i o r e s a m p l i n g "
)
2019-07-10 22:25:45 +00:00
set_package_properties ( Minizip PROPERTIES
2021-09-23 11:51:03 +00:00
U R L " h t t p s : / / g i t h u b . c o m / m a d l e r / z l i b "
D E S C R I P T I O N " M i n i z i p a n d u n z i p b a s e d o n z l i b "
2019-07-10 22:25:45 +00:00
P U R P O S E " S u p p o r t f o r p r o f i l e s i m p o r t / e x p o r t "
)
2021-05-25 17:12:29 +00:00
set_package_properties ( SMI PROPERTIES
U R L " h t t p s : / / w w w . i b r . c s . t u - b s . d e / p r o j e c t s / l i b s m i / "
D E S C R I P T I O N " L i b r a r y t o a c c e s s S M I m a n a g e m e n t i n f o r m a t i o n "
P U R P O S E " S u p p o r t M I B a n d P I B p a r s i n g a n d O I D r e s o l u t i o n "
)
2021-10-15 17:34:33 +00:00
set_package_properties ( PCRE2 PROPERTIES
U R L " h t t p s : / / w w w . p c r e . o r g "
D E S C R I P T I O N " R e g u l a r e x p r e s s i o n p a t t e r n m a t c h i n g u s i n g t h e s a m e s y n t a x a n d s e m a n t i c s a s P e r l 5 "
P U R P O S E " S u p p o r t f o r r e g u l a r e x p r e s s i o n s "
)
2022-03-10 20:21:12 +00:00
set_package_properties ( Sinsp PROPERTIES
D E S C R I P T I O N " l i b s i n s p a n d l i b s c a p "
U R L " h t t p s : / / g i t h u b . c o m / f a l c o s e c u r i t y / l i b s / "
P U R P O S E " S u p p o r t f o r F a l c o p l u g i n s "
)
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
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
2021-07-01 17:06:02 +00:00
u i / w i n 3 2 / f i l e _ d l g _ w i n 3 2 . c p p
2015-01-07 10:17:14 +00:00
)
set ( PLATFORM_UI_RC_FILES
2022-03-06 22:16:36 +00:00
r e s o u r c e s / f i l e _ d l g _ w i n 3 2 . r c
2009-09-02 16:33:01 +00:00
)
2018-04-09 09:39:49 +00:00
elseif ( APPLE )
set ( PLATFORM_UI_SRC
u i / m a c o s x / c o c o a _ b r i d g e . m m
)
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
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - c r e d e n t i a l s . c
2017-12-10 17:29:40 +00:00
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - c a m e l s r t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - d i a m e t e r - a v p . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - e x p e r t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - e x p o r t o b j e c t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - e n d p o i n t s . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - f l o w . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - f o l l o w . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - f u n n e l . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - g s m _ a s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - h o s t s . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - h t t p s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - i c m p s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - i c m p v 6 s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - i o s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - i o u s e r s . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - m a c l t e s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - p r o t o c o l i n f o . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - p r o t o h i e r s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - r l c l t e s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - r p c p r o g s . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - r t d . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - r t p . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - r t s p s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - s c t p c h u n k s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - s i m p l e _ s t a t t a b l e . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - s i p s t a t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - s m b s i d s . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - s r t . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - s t a t s _ t r e e . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - s v . c
$ { C M A K E _ S O U R C E _ D I R } / u i / c l i / t a p - w s p s t a t . c
2019-10-18 07:32:25 +00:00
$ { C U S T O M _ T S H A R K _ T A P _ S R C }
2009-09-08 07:03:57 +00:00
)
2022-04-25 16:04:55 +00:00
# Installed into ${DATAFILE_DIR}
2009-09-21 00:19:07 +00:00
set ( INSTALL_DIRS
2022-04-25 16:04:55 +00:00
r e s o u r c e s / s h a r e / w i r e s h a r k / p r o f i l e s
2022-03-11 00:01:14 +00:00
r e s o u r c e s / p r o t o c o l s / d i a m e t e r
r e s o u r c e s / p r o t o c o l s / d t d s
r e s o u r c e s / p r o t o c o l s / r a d i u s
r e s o u r c e s / p r o t o c o l s / t p n c p
r e s o u r c e s / p r o t o c o l s / w i m a x a s n c p
2009-09-21 00:19:07 +00:00
)
2022-04-25 16:04:55 +00:00
# Installed into ${DATAFILE_DIR}
2009-09-21 00:19:07 +00:00
set ( INSTALL_FILES
2017-07-13 20:03:13 +00:00
e n t e r p r i s e s . t s v
2009-09-25 02:50:48 +00:00
m a n u f
2022-04-25 16:04:55 +00:00
r e s o u r c e s / s h a r e / w i r e s h a r k / c f i l t e r s
r e s o u r c e s / s h a r e / w i r e s h a r k / c o l o r f i l t e r s
r e s o u r c e s / s h a r e / w i r e s h a r k / d f i l t e r _ m a c r o s
r e s o u r c e s / s h a r e / w i r e s h a r k / d f i l t e r s
r e s o u r c e s / s h a r e / w i r e s h a r k / s m i _ m o d u l e s
2009-09-25 02:50:48 +00:00
s e r v i c e s
2017-07-20 01:32:40 +00:00
w k a
2009-09-21 00:19:07 +00:00
)
2023-01-18 14:12:14 +00:00
set ( DOC_FILES
r e s o u r c e s / s h a r e / d o c / w i r e s h a r k / i p m a p . h t m l
2023-01-19 16:19:46 +00:00
r e s o u r c e s / s h a r e / d o c / w i r e s h a r k / p d m l 2 h t m l . x s l
d o c / R E A D M E . x m l - o u t p u t
2023-01-19 17:06:05 +00:00
d o c b o o k / w s . c s s
2023-01-18 14:12:14 +00:00
)
2009-09-21 00:19:07 +00:00
2022-06-17 22:22:26 +00:00
if ( BUILD_logray )
set ( LOG_INSTALL_FILES
2022-10-10 21:49:45 +00:00
d o c b o o k / w s . c s s
2022-06-17 22:22:26 +00:00
r e s o u r c e s / s h a r e / l o g r a y / c o l o r f i l t e r s
r e s o u r c e s / s h a r e / l o g r a y / d f i l t e r _ b u t t o n s
)
endif ( )
2021-06-18 10:20:51 +00:00
if ( ASCIIDOCTOR_FOUND )
2023-01-18 14:12:14 +00:00
list ( APPEND DOC_FILES
2021-06-18 10:20:51 +00:00
$ { C M A K E _ B I N A R Y _ D I R } / d o c / a n d r o i d d u m p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / u d p d u m p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / c a p i n f o s . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / c a p t y p e . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / c i s c o d u m p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / d u m p c a p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / e d i t c a p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / e x t c a p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / m e r g e c a p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / r a n d p k t . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / r a n d p k t d u m p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / e t w d u m p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / r a w s h a r k . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / r e o r d e r c a p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / s s h d u m p . h t m l
2022-03-08 21:38:13 +00:00
$ { C M A K E _ B I N A R Y _ D I R } / d o c / w i f i d u m p . h t m l
2021-06-18 10:20:51 +00:00
$ { C M A K E _ B I N A R Y _ D I R } / d o c / t e x t 2 p c a p . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / t s h a r k . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / w i r e s h a r k . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / w i r e s h a r k - f i l t e r . h t m l
2019-10-10 15:34:46 +00:00
)
2021-06-18 10:20:51 +00:00
if ( MAXMINDDB_FOUND )
2023-01-18 14:12:14 +00:00
list ( APPEND DOC_FILES ${ CMAKE_BINARY_DIR } /doc/mmdbresolve.html )
2021-06-18 10:20:51 +00:00
endif ( )
if ( BUILD_corbaidl2wrs )
2023-01-18 14:12:14 +00:00
list ( APPEND DOC_FILES ${ CMAKE_BINARY_DIR } /doc/idl2wrs.html )
2021-06-18 10:20:51 +00:00
endif ( )
if ( BUILD_xxx2deb )
2023-01-18 14:12:14 +00:00
list ( APPEND DOC_FILES
2021-06-18 10:20:51 +00:00
$ { C M A K E _ B I N A R Y _ D I R } / d o c / a s n 2 d e b . h t m l
$ { C M A K E _ B I N A R Y _ D I R } / d o c / i d l 2 d e b . h t m l
)
endif ( )
2022-10-10 21:49:45 +00:00
if ( BUILD_logray )
2023-01-18 14:12:14 +00:00
list ( APPEND DOC_FILES
2022-10-10 21:49:45 +00:00
$ { C M A K E _ B I N A R Y _ D I R } / d o c / f a l c o d u m p . h t m l
)
endif ( )
2019-10-10 15:34:46 +00:00
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.
2023-01-18 14:12:14 +00:00
list ( APPEND DOC_FILES COPYING )
2015-01-15 21:07:48 +00:00
endif ( )
2021-09-22 22:02:03 +00:00
if ( USE_REPOSITORY )
2022-07-05 22:44:54 +00:00
set ( _dll_output_dir "$<TARGET_FILE_DIR:wsutil>" )
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
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y " $ { _ d l l _ o u t p u t _ d i r } "
)
# 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
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2019-09-03 18:28:52 +00:00
" $ < I F : $ < C O N F I G : D e b u g > , $ { G L I B 2 _ D L L S _ D E B U G } , $ { G L I B 2 _ D L L S _ R E L E A S E } > "
" $ < I F : $ < C O N F I G : D e b u g > , $ { G L I B 2 _ P D B S _ D E B U G } , $ { G L I B 2 _ P D B S _ R E L E A S E } > "
2018-01-20 00:02:20 +00:00
" $ { _ d l l _ o u t p u t _ d i r } "
2019-09-03 18:28:52 +00:00
W O R K I N G _ D I R E C T O R Y $ < I F : $ < C O N F I G : D e b u g > , $ { G L I B 2 _ D L L _ D I R _ D E B U G } , $ { G L I B 2 _ D L L _ D I R _ R E L E A S E } >
C O M M A N D _ E X P A N D _ L I S T S
2018-01-20 00:02:20 +00:00
)
2015-04-13 20:44:23 +00:00
2021-03-29 10:10:16 +00:00
if ( MSVC AND VLD_FOUND )
add_custom_command ( TARGET copy_cli_dlls PRE_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E " $ < I F : $ < C O N F I G : D e b u g > , c o p y _ i f _ d i f f e r e n t , t r u e > "
" $ { V L D _ F I L E S } "
" $ { _ d l l _ o u t p u t _ d i r } "
C O M M A N D _ E X P A N D _ L I S T S
)
endif ( )
2021-04-26 18:31:25 +00:00
# Third party DLLs and PDBs.
set ( THIRD_PARTY_DLLS )
set ( THIRD_PARTY_PDBS )
2015-01-12 22:44:42 +00:00
if ( AIRPCAP_FOUND )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${AIRPCAP_DLL_DIR}/${AIRPCAP_DLL}" )
2015-01-12 22:44:42 +00:00
endif ( AIRPCAP_FOUND )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${CARES_DLL_DIR}/${CARES_DLL}" )
list ( APPEND THIRD_PARTY_PDBS "${CARES_DLL_DIR}/${CARES_PDB}" )
2020-11-30 22:57:01 +00:00
# vcpkg's libmaxminddb is static-only for now. This can be uncommented when
# https://github.com/maxmind/libmaxminddb/commit/3998f42bdb6678cbaa1a543057e5c81ba1668ac2
# percolates up to vcpkg.
# if (MAXMINDDB_FOUND)
2021-04-26 18:31:25 +00:00
# list (APPEND THIRD_PARTY_DLLS "${MAXMINDDB_DLL_DIR}/${MAXMINDDB_DLL}")
2020-11-30 22:57:01 +00:00
# endif(MAXMINDDB_FOUND)
2015-11-19 10:30:44 +00:00
if ( LIBSSH_FOUND )
2020-12-08 22:18:39 +00:00
foreach ( _dll ${ LIBSSH_DLLS } )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${LIBSSH_DLL_DIR}/${_dll}" )
2020-12-08 22:18:39 +00:00
endforeach ( _dll )
2015-11-19 10:30:44 +00:00
endif ( LIBSSH_FOUND )
2017-02-09 14:00:19 +00:00
foreach ( _dll ${ GCRYPT_DLLS } )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${GCRYPT_DLL_DIR}/${_dll}" )
2018-01-20 00:02:20 +00:00
endforeach ( _dll )
foreach ( _dll ${ GNUTLS_DLLS } )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${GNUTLS_DLL_DIR}/${_dll}" )
2018-01-20 00:02:20 +00:00
endforeach ( _dll )
foreach ( _dll ${ KERBEROS_DLLS } )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_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 )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_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 )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${LZ4_DLL_DIR}/${LZ4_DLL}" )
list ( APPEND THIRD_PARTY_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 )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${ZSTD_DLL_DIR}/${ZSTD_DLL}" )
2019-08-12 21:57:45 +00:00
endif ( ZSTD_FOUND )
2016-08-26 13:18:29 +00:00
if ( NGHTTP2_FOUND )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${NGHTTP2_DLL_DIR}/${NGHTTP2_DLL}" )
list ( APPEND THIRD_PARTY_PDBS "${NGHTTP2_DLL_DIR}/${NGHTTP2_PDB}" )
2016-08-26 13:18:29 +00:00
endif ( NGHTTP2_FOUND )
2021-10-15 17:34:33 +00:00
if ( PCRE2_FOUND )
list ( APPEND THIRD_PARTY_DLLS "${PCRE2_DLL_DIR}/${PCRE2_DLL}" )
list ( APPEND THIRD_PARTY_PDBS "${PCRE2_DLL_DIR}/${PCRE2_PDB}" )
endif ( PCRE2_FOUND )
2016-10-22 16:15:51 +00:00
if ( SBC_FOUND )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_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 )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_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 )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_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 )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${ILBC_DLL_DIR}/${ILBC_DLL}" )
2019-11-18 22:55:25 +00:00
endif ( ILBC_FOUND )
2020-09-29 04:33:06 +00:00
if ( OPUS_FOUND )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${OPUS_DLL_DIR}/${OPUS_DLL}" )
2020-09-29 04:33:06 +00:00
endif ( OPUS_FOUND )
2017-04-04 21:23:59 +00:00
if ( LIBXML2_FOUND )
2019-01-04 23:37:46 +00:00
foreach ( _dll ${ LIBXML2_DLLS } )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${LIBXML2_DLL_DIR}/${_dll}" )
2019-01-04 23:37:46 +00:00
endforeach ( _dll )
foreach ( _pdb ${ LIBXML2_PDBS } )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_PDBS "${LIBXML2_DLL_DIR}/${_pdb}" )
2019-01-04 23:37:46 +00:00
endforeach ( _pdb )
2017-04-04 21:23:59 +00:00
endif ( LIBXML2_FOUND )
2015-01-12 22:44:42 +00:00
if ( SMI_FOUND )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_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
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y
" $ { _ d l l _ o u t p u t _ d i r } / s n m p "
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s "
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
2016-05-08 20:46:48 +00:00
" $ { S M I _ S H A R E _ D I R } / m i b s / i a n a "
2015-01-12 22:44:42 +00:00
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s "
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
2016-05-08 20:46:48 +00:00
" $ { S M I _ S H A R E _ D I R } / m i b s / i e t f "
2015-01-12 22:44:42 +00:00
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s "
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
2016-05-08 20:46:48 +00:00
" $ { S M I _ S H A R E _ D I R } / m i b s / i r t f "
2015-01-12 22:44:42 +00:00
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s "
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
2016-05-08 20:46:48 +00:00
" $ { S M I _ S H A R E _ D I R } / m i b s / s i t e "
2015-01-12 22:44:42 +00:00
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s "
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
2016-05-08 20:46:48 +00:00
" $ { S M I _ S H A R E _ D I R } / m i b s / t u b s "
2015-01-12 22:44:42 +00:00
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s "
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
2016-05-08 20:46:48 +00:00
" $ { S M I _ S H A R E _ D I R } / p i b s "
2015-01-12 22:44:42 +00:00
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s "
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
2016-05-08 20:46:48 +00:00
" $ { S M I _ S H A R E _ D I R } / y a n g "
2015-01-12 22:44:42 +00:00
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s "
2016-04-07 23:03:51 +00:00
#remove the extra directories copied (shallow copying the above would remove the need for this)
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s / i a n a "
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s / i e t f "
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s / s i t e "
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y
" $ { _ d l l _ o u t p u t _ d i r } / s n m p / m i b s / t u b s "
2015-01-12 22:44:42 +00:00
)
endif ( SMI_FOUND )
2016-10-17 19:04:49 +00:00
if ( SNAPPY_FOUND )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_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 )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${WINSPARKLE_DLL_DIR}/${WINSPARKLE_DLL}" )
2018-01-20 00:02:20 +00:00
endif ( WINSPARKLE_FOUND )
2019-01-04 23:37:46 +00:00
if ( ZLIB_FOUND )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${ZLIB_DLL_DIR}/${ZLIB_DLL}" )
list ( APPEND THIRD_PARTY_PDBS "${ZLIB_DLL_DIR}/${ZLIB_PDB}" )
2019-01-04 23:37:46 +00:00
endif ( ZLIB_FOUND )
2019-04-10 10:52:52 +00:00
if ( BROTLI_FOUND )
foreach ( _dll ${ BROTLI_DLLS } )
2021-04-26 18:31:25 +00:00
list ( APPEND THIRD_PARTY_DLLS "${BROTLI_DLL_DIR}/${_dll}" )
2019-04-10 10:52:52 +00:00
endforeach ( _dll )
endif ( BROTLI_FOUND )
2022-12-15 18:54:48 +00:00
if ( SPEEXDSP_FOUND )
list ( APPEND THIRD_PARTY_DLLS "${SPEEXDSP_DLL_DIR}/${SPEEXDSP_DLL}" )
endif ( )
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.
2021-04-26 18:31:25 +00:00
if ( THIRD_PARTY_DLLS )
2015-01-12 22:44:42 +00:00
add_custom_command ( TARGET copy_cli_dlls PRE_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2021-04-26 18:31:25 +00:00
$ { T H I R D _ P A R T Y _ D L L S }
2015-01-12 22:44:42 +00:00
" $ { _ d l l _ o u t p u t _ d i r } "
2018-01-20 00:02:20 +00:00
V E R B A T I M
2015-01-12 22:44:42 +00:00
)
2021-04-26 18:31:25 +00:00
install ( FILES ${ THIRD_PARTY_DLLS } DESTINATION "${CMAKE_INSTALL_BINDIR}" )
endif ( THIRD_PARTY_DLLS )
2015-01-12 22:44:42 +00:00
2021-04-26 18:31:25 +00:00
if ( THIRD_PARTY_PDBS )
2019-01-04 18:14:13 +00:00
add_custom_command ( TARGET copy_cli_dlls PRE_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2021-04-26 18:31:25 +00:00
$ { T H I R D _ P A R T Y _ P D B S }
2019-01-04 18:14:13 +00:00
" $ { _ d l l _ o u t p u t _ d i r } "
V E R B A T I M
)
2021-04-26 18:31:25 +00:00
endif ( THIRD_PARTY_PDBS )
2019-01-04 18:14:13 +00:00
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
P A T H " $ E N V { P R O G R A M F I L E S } / 7 - Z i p " " $ E N V { P R O G R A M W 6 4 3 2 } / 7 - Z i p "
D O C " P a t h t o t h e 7 z u t i l i t y . "
)
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" )
2022-06-07 22:51:24 +00:00
set ( _pdb_zip "${CMAKE_BINARY_DIR}/Wireshark-pdb-${WIRESHARK_TARGET_PLATFORM}-${PROJECT_VERSION}.zip" )
2015-01-19 21:33:01 +00:00
file ( TO_NATIVE_PATH "${_pdb_zip}" _pdb_zip_win )
add_custom_command ( TARGET pdb_zip_package POST_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e - f " $ { _ p d b _ z i p } "
2018-02-27 18:10:54 +00:00
C O M M A N D $ { Z I P _ E X E C U T A B L E } a - t z i p - m m t = o n " $ { _ p d b _ z i p _ w i n } "
2021-12-11 21:57:29 +00:00
- b b 0 - b d
2020-01-06 17:58:38 +00:00
- r * . p d b * . l i b
2015-01-19 21:33:01 +00:00
W O R K I N G _ D I R E C T O R Y " $ { _ d l l _ o u t p u t _ d i r } "
)
endif ( )
2021-09-22 22:02:03 +00:00
endif ( )
2015-01-15 21:07:48 +00:00
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
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT USE_MSYSTEM )
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 }
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
$ { C M A K E _ S O U R C E _ D I R } / $ { _ i n s t a l l _ a s _ t x t _ f i l e }
$ { _ o u t p u t _ f i l e }
2017-08-16 19:26:42 +00:00
D E P E N D S
2019-12-17 00:42:13 +00:00
$ { C M A K E _ S O U R C E _ D I R } / $ { _ i n s t a l l _ a s _ t x t _ f i l e }
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 ( )
2023-01-18 14:12:14 +00:00
foreach ( _install_file ${ INSTALL_FILES } ${ DOC_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
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2017-06-17 07:42:14 +00:00
" $ { _ i n s t a l l _ f i l e _ s r c } "
2015-11-21 23:16:08 +00:00
" $ { _ o u t p u t _ f i l e } "
D E P E N D S
2019-10-10 15:34:46 +00:00
d o c s
2015-11-21 23:16:08 +00:00
" $ { _ i n s t a l l _ f i l e } "
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 ( )
2022-06-17 22:22:26 +00:00
if ( BUILD_logray AND ENABLE_APPLICATION_BUNDLE )
foreach ( _install_file ${ LOG_INSTALL_FILES } )
get_filename_component ( _install_file_src "${_install_file}" ABSOLUTE )
get_filename_component ( _install_basename "${_install_file}" NAME )
set ( _output_file "${LOG_DATAFILE_DIR}/${_install_basename}" )
add_custom_command ( OUTPUT "${_output_file}"
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
" $ { _ i n s t a l l _ f i l e _ s r c } "
" $ { _ o u t p u t _ f i l e } "
D E P E N D S
d o c s
" $ { _ i n s t a l l _ f i l e } "
)
list ( APPEND copy_data_files_depends "${_output_file}" )
endforeach ( )
endif ( )
2021-11-10 23:51:29 +00:00
# Install Lua files in staging directory such that Lua can used when Wireshark
2015-11-21 23:16:08 +00:00
# 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
2022-10-02 10:03:23 +00:00
" $ { C M A K E _ S O U R C E _ D I R } / e p a n / w s l u a / i n i t . l u a "
2015-11-21 23:16:08 +00:00
" $ { C M A K E _ S O U R C E _ D I R } / e p a n / w s l u a / c o n s o l e . l u a "
" $ { C M A K E _ S O U R C E _ D I R } / e p a n / w s l u a / d t d _ g e n . l u a "
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
" $ { D A T A F I L E _ D I R } / $ { _ l u a _ f i l e n a m e } " )
add_custom_command ( OUTPUT "${DATAFILE_DIR}/${_lua_filename}"
2018-01-20 00:02:20 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2015-11-21 23:16:08 +00:00
" $ { _ l u a _ f i l e } "
" $ { D A T A F I L E _ D I R } / $ { _ l u a _ f i l e n a m e } "
D E P E N D S
" $ { _ l u a _ f i l e } "
)
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
2022-03-11 00:01:14 +00:00
set ( _protocol_data_dir ${ CMAKE_SOURCE_DIR } /resources/protocols )
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
2022-03-11 00:01:14 +00:00
$ { _ p r o t o c o l _ d a t a _ d i r } / t p n c p / t p n c p . d a t
$ { _ p r o t o c o l _ d a t a _ d i r } / w i m a x a s n c p / * . d t d
$ { _ p r o t o c o l _ d a t a _ d i r } / w i m a x a s n c p / * . x m l
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.
2022-03-11 00:01:14 +00:00
file ( GLOB _data_files RELATIVE ${ _protocol_data_dir } ${ DATA_FILES_SRC } )
2015-11-21 23:16:08 +00:00
foreach ( _data_file ${ _data_files } )
add_custom_command ( OUTPUT "${DATAFILE_DIR}/${_data_file}"
2018-01-20 00:02:20 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2022-03-11 00:01:14 +00:00
$ { _ p r o t o c o l _ d a t a _ d i r } / $ { _ d a t a _ f i l e }
$ { D A T A F I L E _ D I R } / $ { _ d a t a _ f i l e }
2015-11-21 23:16:08 +00:00
D E P E N D S
2022-03-11 00:01:14 +00:00
$ { _ p r o t o c o l _ d a t a _ d i r } / $ { _ d a t a _ f i l e }
2015-01-15 21:07:48 +00:00
)
2022-03-11 00:01:14 +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
2022-03-11 00:01:14 +00:00
file ( GLOB _dtds_src_files RELATIVE ${ _protocol_data_dir } ${ _protocol_data_dir } /dtds/*.dtd )
2018-01-23 20:05:10 +00:00
set ( _dtds_data_files )
2022-03-11 00:01:14 +00:00
set ( _dtds_dep_files )
2018-01-23 20:05:10 +00:00
foreach ( _data_file ${ _dtds_src_files } )
2022-03-11 00:01:14 +00:00
list ( APPEND _dtds_data_files ${ DATAFILE_DIR } / ${ _data_file } )
2022-03-19 17:36:05 +00:00
list ( APPEND _dtds_dep_files ${ _protocol_data_dir } / ${ _data_file } )
2018-01-23 20:05:10 +00:00
endforeach ( )
add_custom_command (
O U T P U T $ { _ d t d s _ d a t a _ f i l e s }
2022-03-11 00:01:14 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { D A T A F I L E _ D I R } / d t d s
2018-05-10 12:54:31 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2018-01-23 20:05:10 +00:00
$ { _ d t d s _ s r c _ f i l e s }
2022-03-11 00:01:14 +00:00
$ { D A T A F I L E _ D I R } / d t d s
2018-01-23 20:05:10 +00:00
V E R B A T I M
2022-03-11 00:01:14 +00:00
D E P E N D S $ { _ d t d s _ d e p _ f i l e s }
W O R K I N G _ D I R E C T O R Y $ { _ p r o t o c o l _ d a t a _ d i r }
2018-01-23 20:05:10 +00:00
)
2022-03-11 00:01:14 +00:00
file ( GLOB _diameter_src_files RELATIVE ${ _protocol_data_dir }
$ { _ p r o t o c o l _ d a t a _ d i r } / d i a m e t e r / * . d t d
$ { _ p r o t o c o l _ d a t a _ d i r } / d i a m e t e r / * . x m l
2018-01-23 20:05:10 +00:00
)
set ( _diameter_data_files )
2022-03-11 00:01:14 +00:00
set ( _diameter_dep_files )
2018-01-23 20:05:10 +00:00
foreach ( _data_file ${ _diameter_src_files } )
2022-03-11 00:01:14 +00:00
list ( APPEND _diameter_data_files ${ DATAFILE_DIR } / ${ _data_file } )
list ( APPEND _diameter_dep_files ${ _protocol_data_dir } / ${ _data_file } )
2018-01-23 20:05:10 +00:00
endforeach ( )
add_custom_command (
O U T P U T $ { _ d i a m e t e r _ d a t a _ f i l e s }
2022-03-11 00:01:14 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { D A T A F I L E _ D I R } / d i a m e t e r
2018-05-10 12:54:31 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2018-01-23 20:05:10 +00:00
$ { _ d i a m e t e r _ s r c _ f i l e s }
2022-03-11 00:01:14 +00:00
$ { D A T A F I L E _ D I R } / d i a m e t e r
2018-01-23 20:05:10 +00:00
V E R B A T I M
2022-03-11 00:01:14 +00:00
D E P E N D S $ { _ d i a m e t e r _ d e p _ f i l e s }
W O R K I N G _ D I R E C T O R Y $ { _ p r o t o c o l _ d a t a _ d i r }
2018-01-23 20:05:10 +00:00
)
2022-03-11 00:01:14 +00:00
file ( GLOB _radius_src_files RELATIVE ${ _protocol_data_dir }
$ { _ p r o t o c o l _ d a t a _ d i r } / r a d i u s / R E A D M E . r a d i u s _ d i c t i o n a r y
$ { _ p r o t o c o l _ d a t a _ d i r } / r a d i u s / c u s t o m . i n c l u d e s
$ { _ p r o t o c o l _ d a t a _ d i r } / r a d i u s / d i c t i o n a r y
$ { _ p r o t o c o l _ d a t a _ d i r } / r a d i u s / d i c t i o n a r y . *
2018-01-23 20:05:10 +00:00
)
set ( _radius_data_files )
2022-03-11 00:01:14 +00:00
set ( _radius_dep_files )
2018-01-23 20:05:10 +00:00
foreach ( _data_file ${ _radius_src_files } )
2022-03-11 00:01:14 +00:00
list ( APPEND _radius_data_files ${ DATAFILE_DIR } / ${ _data_file } )
list ( APPEND _radius_dep_files ${ _protocol_data_dir } / ${ _data_file } )
2018-01-23 20:05:10 +00:00
endforeach ( )
add_custom_command (
O U T P U T $ { _ r a d i u s _ d a t a _ f i l e s }
2022-03-11 00:01:14 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { D A T A F I L E _ D I R } / r a d i u s
2018-05-10 12:54:31 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2018-01-23 20:05:10 +00:00
$ { _ r a d i u s _ s r c _ f i l e s }
2022-03-11 00:01:14 +00:00
$ { D A T A F I L E _ D I R } / r a d i u s
2018-01-23 20:05:10 +00:00
V E R B A T I M
2022-03-11 00:01:14 +00:00
D E P E N D S $ { _ r a d i u s _ d e p _ f i l e s }
W O R K I N G _ D I R E C T O R Y $ { _ p r o t o c o l _ d a t a _ d i r }
2018-01-23 20:05:10 +00:00
)
2022-03-11 00:01:14 +00:00
file ( GLOB _protobuf_src_files RELATIVE ${ _protocol_data_dir }
$ { _ p r o t o c o l _ d a t a _ d i r } / p r o t o b u f / * . p r o t o
)
2021-04-10 18:15:34 +00:00
set ( _protobuf_data_files )
2022-03-11 00:01:14 +00:00
set ( _protobuf_dep_files )
2021-04-10 18:15:34 +00:00
foreach ( _data_file ${ _protobuf_src_files } )
2022-03-11 00:01:14 +00:00
list ( APPEND _protobuf_data_files ${ DATAFILE_DIR } / ${ _data_file } )
2022-03-25 11:31:43 +00:00
list ( APPEND _protobuf_dep_files ${ _protocol_data_dir } / ${ _data_file } )
2021-04-10 18:15:34 +00:00
endforeach ( )
add_custom_command (
O U T P U T $ { _ p r o t o b u f _ d a t a _ f i l e s }
2022-03-11 00:01:14 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { D A T A F I L E _ D I R } / p r o t o b u f
2021-04-10 18:15:34 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2021-05-20 15:26:19 +00:00
$ { _ p r o t o b u f _ s r c _ f i l e s }
2022-03-11 00:01:14 +00:00
$ { D A T A F I L E _ D I R } / p r o t o b u f
2021-04-10 18:15:34 +00:00
V E R B A T I M
2022-03-11 00:01:14 +00:00
D E P E N D S $ { _ p r o t o b u f _ d e p _ f i l e s }
W O R K I N G _ D I R E C T O R Y $ { _ p r o t o c o l _ d a t a _ d i r }
2021-04-10 18:15:34 +00:00
)
2022-07-17 00:07:23 +00:00
set ( _profiles_src_dir ${ CMAKE_SOURCE_DIR } /resources/share/wireshark )
file ( GLOB _profiles_src_files RELATIVE ${ _profiles_src_dir } ${ _profiles_src_dir } /profiles/*/* )
2018-01-23 20:05:10 +00:00
set ( _profiles_data_files )
foreach ( _data_file ${ _profiles_src_files } )
list ( APPEND _profiles_data_files "${DATAFILE_DIR}/${_data_file}" )
endforeach ( )
add_custom_command (
O U T P U T $ { _ p r o f i l e s _ d a t a _ f i l e s }
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y
2022-04-25 16:04:55 +00:00
" $ { C M A K E _ S O U R C E _ D I R } / r e s o u r c e s / s h a r e / w i r e s h a r k / p r o f i l e s " " $ { D A T A F I L E _ D I R } / p r o f i l e s "
2018-01-23 20:05:10 +00:00
)
list ( APPEND copy_data_files_depends
$ { _ d t d s _ d a t a _ f i l e s }
$ { _ d i a m e t e r _ d a t a _ f i l e s }
$ { _ r a d i u s _ d a t a _ f i l e s }
2021-04-10 18:15:34 +00:00
$ { _ p r o t o b u f _ d a t a _ f i l e s }
2018-01-23 20:05:10 +00:00
$ { _ p r o f i l e s _ d a t a _ f i l e s }
)
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
# sources common for wireshark, tshark, rawshark and sharkd
add_library ( shark_common OBJECT
c f i l e . c
e x t c a p _ p a r s e r . c
f i l e _ p a c k e t _ p r o v i d e r . c
f r a m e _ t v b u f f . c
s y n c _ p i p e _ w r i t e . 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 } )
2021-07-03 11:58:30 +00:00
set_target_properties ( shark_common cli_main capture_opts
2019-01-12 11:43:18 +00:00
P R O P E R T I E S
C O M P I L E _ F L A G S " $ { W E R R O R _ C O M M O N _ F L A G S } "
)
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
f i l e . c
f i l e s e t . c
2022-08-07 10:31:48 +00:00
e x t c a p . c
2013-10-11 10:32:11 +00:00
$ { P L A T F O R M _ U I _ S R C }
2014-07-31 21:17:07 +00:00
)
set ( wireshark_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c a p t u r e _ o p t s >
2019-01-12 15:33:39 +00:00
$ < T A R G E T _ O B J E C T S : q t u i >
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : s h a r k _ c o m m o n >
2014-07-31 21:17:07 +00:00
$ { W I R E S H A R K _ S R C }
2015-01-07 10:17:14 +00:00
$ { P L A T F O R M _ U I _ R C _ F I L E S }
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 ( )
2022-06-30 16:45:49 +00:00
if ( BUILD_logray AND QT_FOUND )
set ( LOGRAY_SRC
2021-12-23 21:55:15 +00:00
f i l e . c
f i l e s e t . c
2022-08-07 10:31:48 +00:00
e x t c a p . c
2021-12-23 21:55:15 +00:00
$ { P L A T F O R M _ U I _ S R C }
)
2022-06-30 16:45:49 +00:00
set ( logray_FILES
2021-12-23 21:55:15 +00:00
$ < T A R G E T _ O B J E C T S : c a p t u r e _ o p t s >
2022-06-30 16:45:49 +00:00
$ < T A R G E T _ O B J E C T S : u i _ l o g r a y >
2021-12-23 21:55:15 +00:00
$ < T A R G E T _ O B J E C T S : s h a r k _ c o m m o n >
2022-06-30 16:45:49 +00:00
$ { L O G R A Y _ S R C }
2021-12-23 21:55:15 +00:00
$ { P L A T F O R M _ U I _ R C _ F I L E S }
)
2022-06-30 16:45:49 +00:00
set_executable_resources ( logray "Logray" UNIQUE_RC )
2021-12-23 21:55:15 +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
" - W l , - h e a d e r p a d _ m a x _ i n s t a l l _ n a m e s - W l , - s e a r c h _ p a t h s _ f i r s t $ { C M A K E _ E X E _ L I N K E R _ F L A G S } "
2014-10-23 15:41:39 +00:00
)
2022-09-01 00:59:36 +00:00
# Add files to the Wireshark application bundle
2014-10-09 18:37:27 +00:00
# Wireshark.app/Contents
2022-09-01 00:59:36 +00:00
file ( WRITE ${ CMAKE_BINARY_DIR } /packaging/macosx/wireshark/PkgInfo "APPLWshk\n" )
set ( WIRESHARK_BUNDLE_CONTENTS_FILES
$ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / m a c o s x / w i r e s h a r k / P k g I n f o
2014-10-09 18:37:27 +00:00
)
2022-09-01 00:59:36 +00:00
set_source_files_properties ( ${ WIRESHARK_BUNDLE_CONTENTS_FILES } PROPERTIES
2014-10-09 18:37:27 +00:00
M A C O S X _ P A C K A G E _ L O C A T I O N .
)
# Wireshark.app/Contents/Resources
2022-09-01 00:59:36 +00:00
set ( WIRESHARK_BUNDLE_RESOURCE_FILES
2016-03-11 21:45:54 +00:00
$ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / W i r e s h a r k . i c n s
$ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / W i r e s h a r k d o c . i c n s
2014-10-09 18:37:27 +00:00
)
2022-09-01 00:59:36 +00:00
set_source_files_properties ( ${ WIRESHARK_BUNDLE_RESOURCE_FILES } PROPERTIES
2014-10-09 18:37:27 +00:00
M A C O S X _ P A C K A G E _ L O C A T I O N R e s o u r c e s
)
2014-10-10 15:32:51 +00:00
# Wireshark.app/Contents/Resources/share/man/man1
2022-09-01 00:59:36 +00:00
set_source_files_properties ( ${ WIRESHARK_BUNDLE_RESOURCE_SHARE_MAN1_FILES } PROPERTIES
2014-10-10 15:32:51 +00:00
M A C O S X _ P A C K A G E _ L O C A T I O N R e s o u r c e s / s h a r e / m a n / m a n 1
2016-10-12 19:55:54 +00:00
G E N E R A T E D 1
2014-10-10 15:32:51 +00:00
)
2016-10-27 15:54:41 +00:00
# Wireshark.app/Contents/Resources/share/man/man4
2022-09-01 00:59:36 +00:00
set_source_files_properties ( ${ WIRESHARK_BUNDLE_RESOURCE_SHARE_MAN4_FILES } PROPERTIES
2014-10-10 15:32:51 +00:00
M A C O S X _ P A C K A G E _ L O C A T I O N R e s o u r c e s / s h a r e / m a n / m a n 4
2016-10-12 19:55:54 +00:00
G E N E R A T E D 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
2022-09-01 00:59:36 +00:00
set ( EXTRA_WIRESHARK_BUNDLE_FILES
$ { W I R E S H A R K _ B U N D L E _ C O N T E N T S _ F I L E S }
$ { W I R E S H A R K _ B U N D L E _ R E S O U R C E _ F I L E S }
$ { W I R E S H A R K _ B U N D L E _ R E S O U R C E _ S H A R E _ M A N 1 _ F I L E S }
$ { W I R E S H A R K _ B U N D L E _ R E S O U R C E _ S H A R E _ M A N 4 _ F I L E S }
2014-10-10 15:32:51 +00:00
)
2022-09-01 00:59:36 +00:00
# Add files to the Logray application bundle
# Logray.app/Contents
file ( WRITE ${ CMAKE_BINARY_DIR } /packaging/macosx/logray/PkgInfo "APPLLgry\n" )
set ( LOGRAY_BUNDLE_CONTENTS_FILES
$ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / m a c o s x / l o g r a y / P k g I n f o
)
set_source_files_properties ( ${ LOGRAY_BUNDLE_CONTENTS_FILES } PROPERTIES
M A C O S X _ P A C K A G E _ L O C A T I O N .
)
# Logray.app/Contents/Resources
set ( LOGRAY_BUNDLE_RESOURCE_FILES
2022-09-01 00:36:49 +00:00
$ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / L o g r a y . i c n s
2022-09-01 00:59:36 +00:00
$ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / W i r e s h a r k d o c . i c n s
)
set_source_files_properties ( ${ LOGRAY_BUNDLE_RESOURCE_FILES } PROPERTIES
M A C O S X _ P A C K A G E _ L O C A T I O N R e s o u r c e s
)
# Logray.app/Contents/Resources/share/man/man1
set_source_files_properties ( ${ LOGRAY_BUNDLE_RESOURCE_SHARE_MAN1_FILES } PROPERTIES
M A C O S X _ P A C K A G E _ L O C A T I O N R e s o u r c e s / s h a r e / m a n / m a n 1
G E N E R A T E D 1
)
# Logray.app/Contents/Resources/share/man/man4
set_source_files_properties ( ${ LOGRAY_BUNDLE_RESOURCE_SHARE_MAN4_FILES } PROPERTIES
M A C O S X _ P A C K A G E _ L O C A T I O N R e s o u r c e s / s h a r e / m a n / m a n 4
G E N E R A T E D 1
)
# INSTALL_FILES and INSTALL_DIRS are handled by copy_data_files
set ( EXTRA_LOGRAY_BUNDLE_FILES
$ { L O G R A Y _ B U N D L E _ C O N T E N T S _ F I L E S }
$ { L O G R A Y _ B U N D L E _ R E S O U R C E _ F I L E S }
$ { L O G R A Y _ B U N D L E _ R E S O U R C E _ S H A R E _ M A N 1 _ F I L E S }
$ { L O G R A Y _ B U N D L E _ R E S O U R C E _ S H A R E _ M A N 4 _ F I L E S }
)
2014-10-09 18:37:27 +00:00
else ( )
2022-09-01 00:59:36 +00:00
set ( EXTRA_WIRESHARK_BUNDLE_FILES )
set ( EXTRA_LOGRAY_BUNDLE_FILES )
2014-10-09 18:37:27 +00:00
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
u i
2014-06-23 23:48:41 +00:00
c a p c h i l d
2014-07-04 07:24:02 +00:00
c a p u t i l s
2023-01-31 20:44:36 +00:00
i f a c e _ m o n i t o r
2018-08-23 21:03:28 +00:00
w i r e t a p
2018-11-27 19:37:33 +00:00
e p a n
2023-01-30 20:27:06 +00:00
s u m m a r y
2019-01-10 01:45:00 +00:00
$ { Q T _ L I B R A R I E S }
2012-11-22 18:19:37 +00:00
$ { A P P L E _ A P P L I C A T I O N _ S E R V I C E S _ L I B R A R Y }
2018-04-09 09:39:49 +00:00
$ { A P P L E _ A P P K I T _ L I B R A R Y }
2012-11-22 16:49:17 +00:00
$ { A P P L E _ C O R E _ F O U N D A T I O N _ L I B R A R Y }
$ { A P P L E _ S Y S T E M _ C O N F I G U R A T I O N _ L I B R A R Y }
2019-11-15 21:30:19 +00:00
$ { S P A R K L E _ L I B R A R I E S }
2019-04-30 22:48:06 +00:00
$ { W I N _ W S 2 _ 3 2 _ L I B R A R Y }
2016-08-03 19:14:23 +00:00
$ { W I N _ V E R S I O N _ L I B R A R Y }
2018-11-27 19:37:33 +00:00
$ { W I N S P A R K L E _ L I B R A R I E S }
2019-01-12 15:33:39 +00:00
$ < $ < B O O L : $ { WIN32 } > : U x T h e m e . l i b >
2019-02-02 14:52:07 +00:00
$ { S P E E X D S P _ L I B R A R I E S }
2023-02-06 21:57:51 +00:00
$ { Z L I B _ L I B R A R I E S }
2019-07-10 22:25:45 +00:00
$ { M I N I Z I P _ L I B R A R I E S }
2012-02-02 00:46:02 +00:00
)
2022-09-01 00:59:36 +00:00
add_executable ( wireshark WIN32 MACOSX_BUNDLE ${ wireshark_FILES } ${ EXTRA_WIRESHARK_BUNDLE_FILES } )
2023-01-11 00:10:05 +00:00
if ( MSVC )
2019-09-12 14:21:16 +00:00
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
L I N K _ F L A G S " $ { W S _ L I N K _ F L A G S } "
2017-09-24 01:30:08 +00:00
F O L D E R " E x e c u t a b l e s "
2019-01-21 10:56:57 +00:00
I N S T A L L _ R P A T H " $ { E X E C U T A B L E _ I N S T A L L _ R P A T H } "
2021-05-14 00:53:40 +00:00
A U T O M O C O N
A U T O U I C O N
A U T O R C C O N
2017-09-24 01:30:08 +00:00
)
2021-03-29 10:10:16 +00:00
if ( MSVC )
set_target_properties ( wireshark PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}" )
endif ( )
2023-01-11 00:10:05 +00:00
if ( USE_MSYSTEM )
set_target_properties ( wireshark PROPERTIES OUTPUT_NAME wireshark )
elseif ( ENABLE_APPLICATION_BUNDLE OR WIN32 )
2014-10-09 18:37:27 +00:00
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 )
2021-11-03 14:23:10 +00:00
if ( ASCIIDOCTOR_FOUND )
# Make sure to generate files referenced by
2022-09-01 00:59:36 +00:00
# WIRESHARK_BUNDLE_RESOURCE_SHARE_MAN1_FILES
2021-11-03 14:23:10 +00:00
add_dependencies ( wireshark manpages )
endif ( )
2014-10-09 18:37:27 +00:00
set_target_properties (
w i r e s h a r k P R O P E R T I E S
2021-12-23 21:55:15 +00:00
M A C O S X _ B U N D L E _ I N F O _ P L I S T $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / m a c o s x / W i r e s h a r k I n f o . p l i s t
2014-10-09 18:37:27 +00:00
)
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 (
T A R G E T S w i r e s h a r k
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
B U N D L E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
)
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
P O S T _ B U I L D
C O M M A N D s e t " P A T H = $ { Q T _ B I N _ P A T H } ; % P A T H % "
C O M M A N D " $ { Q T _ W I N D E P L O Y Q T _ E X E C U T A B L E } "
- - n o - c o m p i l e r - r u n t i m e
2021-12-11 21:57:29 +00:00
- - v e r b o s e 0
2021-07-15 00:37:23 +00:00
$ < $ < B O O L : $ { MSVC } > : - - p d b >
2018-06-20 22:59:41 +00:00
" $ < T A R G E T _ F I L E : w i r e s h a r k > "
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
\ " $ { Q T _ W I N D E P L O Y Q T _ E X E C U T A B L E } \ "
- - n o - c o m p i l e r - r u n t i m e
\ " \ $ { C M A K E _ I N S T A L L _ P R E F I X } / $ { C M A K E _ I N S T A L L _ B I N D I R } / W i r e s h a r k . e x e \ " ) "
)
2018-06-20 22:59:41 +00:00
endif ( QT_WINDEPLOYQT_EXECUTABLE )
2014-09-05 18:17:17 +00:00
endif ( )
2022-06-30 16:45:49 +00:00
if ( BUILD_logray AND QT_FOUND )
set ( logray_LIBS
2021-12-23 21:55:15 +00:00
u i
c a p c h i l d
c a p u t i l s
2023-01-31 20:44:36 +00:00
i f a c e _ m o n i t o r
2021-12-23 21:55:15 +00:00
w i r e t a p
e p a n
2023-01-30 20:27:06 +00:00
s u m m a r y
2021-12-23 21:55:15 +00:00
$ { Q T _ L I B R A R I E S }
$ { A P P L E _ A P P L I C A T I O N _ S E R V I C E S _ L I B R A R Y }
$ { A P P L E _ A P P K I T _ L I B R A R Y }
$ { A P P L E _ C O R E _ F O U N D A T I O N _ L I B R A R Y }
$ { A P P L E _ S Y S T E M _ C O N F I G U R A T I O N _ L I B R A R Y }
$ { S P A R K L E _ L I B R A R I E S }
$ { W I N _ W S 2 _ 3 2 _ L I B R A R Y }
$ { W I N _ V E R S I O N _ L I B R A R Y }
$ { W I N S P A R K L E _ L I B R A R I E S }
$ < $ < B O O L : $ { WIN32 } > : U x T h e m e . l i b >
$ { S P E E X D S P _ L I B R A R I E S }
$ { M I N I Z I P _ L I B R A R I E S }
)
2022-09-01 00:59:36 +00:00
add_executable ( logray WIN32 MACOSX_BUNDLE ${ logray_FILES } ${ EXTRA_LOGRAY_BUNDLE_FILES } )
2021-12-23 21:55:15 +00:00
if ( WIN32 AND NOT BUILD_wireshark )
2022-06-30 16:45:49 +00:00
set_property ( DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } PROPERTY VS_STARTUP_PROJECT logray )
2021-12-23 21:55:15 +00:00
endif ( )
2022-06-30 16:45:49 +00:00
set ( PROGLIST ${ PROGLIST } logray )
set_target_properties ( logray PROPERTIES
2021-12-23 21:55:15 +00:00
L I N K _ F L A G S " $ { W S _ L I N K _ F L A G S } "
F O L D E R " E x e c u t a b l e s "
I N S T A L L _ R P A T H " $ { E X E C U T A B L E _ I N S T A L L _ R P A T H } "
A U T O M O C O N
A U T O U I C O N
A U T O R C C O N
)
if ( MSVC )
2022-06-30 16:45:49 +00:00
set_target_properties ( logray PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}" )
2021-12-23 21:55:15 +00:00
endif ( )
if ( ENABLE_APPLICATION_BUNDLE OR WIN32 )
2022-06-30 16:45:49 +00:00
set_target_properties ( logray PROPERTIES OUTPUT_NAME Logray )
2021-12-23 21:55:15 +00:00
endif ( )
if ( ENABLE_APPLICATION_BUNDLE )
if ( ASCIIDOCTOR_FOUND )
# Make sure to generate files referenced by
2022-09-01 00:59:36 +00:00
# LOGRAY_BUNDLE_RESOURCE_SHARE_MAN1_FILES
2022-06-30 16:45:49 +00:00
add_dependencies ( logray manpages )
2021-12-23 21:55:15 +00:00
endif ( )
set_target_properties (
2022-06-30 16:45:49 +00:00
l o g r a y P R O P E R T I E S
M A C O S X _ B U N D L E _ I N F O _ P L I S T $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / m a c o s x / L o g r a y I n f o . p l i s t
2021-12-23 21:55:15 +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
2022-06-30 16:45:49 +00:00
# XXX Running run/Logray.app/Contents/MacOS/Logray works
2021-12-23 21:55:15 +00:00
# fine for me (Gerald) here on Mojave. Can we just make this a
# symlink?
2022-06-30 16:45:49 +00:00
file ( REMOVE ${ CMAKE_BINARY_DIR } /run/logray )
file ( WRITE ${ CMAKE_BINARY_DIR } /run/logray "#!/bin/sh\n" )
file ( APPEND ${ CMAKE_BINARY_DIR } /run/logray "# Generated by ${CMAKE_CURRENT_LIST_FILE}\n" )
file ( APPEND ${ CMAKE_BINARY_DIR } /run/logray "# Wrapper script which should work around the issue described at\n" )
file ( APPEND ${ CMAKE_BINARY_DIR } /run/logray "# https://stackoverflow.com/questions/25318524/what-exactly-should-i-pass-to-nsapp-activateignoringotherapps-to-get-my-appl\n" )
file ( APPEND ${ CMAKE_BINARY_DIR } /run/logray "exec ${CMAKE_BINARY_DIR}/run/Logray.app/Contents/MacOS/Logray \" \$\@\"\n")
execute_process ( COMMAND chmod a+x ${ CMAKE_BINARY_DIR } /run/logray )
2021-12-23 21:55:15 +00:00
endif ( )
endif ( )
2022-06-30 16:45:49 +00:00
target_link_libraries ( logray ${ logray_LIBS } )
target_include_directories ( logray SYSTEM PRIVATE ${ SPARKLE_INCLUDE_DIRS } )
2021-12-23 21:55:15 +00:00
install (
2022-06-30 16:45:49 +00:00
T A R G E T S l o g r a y
2021-12-23 21:55:15 +00:00
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
B U N D L E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
)
if ( QT_WINDEPLOYQT_EXECUTABLE )
add_custom_target ( copy_ls_qt_dlls ALL )
set_target_properties ( copy_ls_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_ls_qt_dlls
P O S T _ B U I L D
C O M M A N D s e t " P A T H = $ { Q T _ B I N _ P A T H } ; % P A T H % "
C O M M A N D " $ { Q T _ W I N D E P L O Y Q T _ E X E C U T A B L E } "
- - n o - c o m p i l e r - r u n t i m e
- - v e r b o s e 0
$ < $ < B O O L : $ { MSVC } > : - - p d b >
2022-06-30 16:45:49 +00:00
" $ < T A R G E T _ F I L E : l o g r a y > "
2021-12-23 21:55:15 +00:00
)
2022-06-30 16:45:49 +00:00
add_dependencies ( copy_ls_qt_dlls logray )
2021-12-23 21:55:15 +00:00
install ( CODE " execute_process(COMMAND
\ " $ { Q T _ W I N D E P L O Y Q T _ E X E C U T A B L E } \ "
- - n o - c o m p i l e r - r u n t i m e
2022-06-30 16:45:49 +00:00
\ " \ $ { C M A K E _ I N S T A L L _ P R E F I X } / $ { C M A K E _ I N S T A L L _ B I N D I R } / L o g r a y . e x e \ " ) "
2021-12-23 21:55:15 +00:00
)
endif ( QT_WINDEPLOYQT_EXECUTABLE )
endif ( )
2023-01-12 01:50:36 +00:00
if ( BUILD_logray AND FALCO_PLUGINS )
2022-04-19 22:19:50 +00:00
add_custom_target ( copy_falco_plugins )
add_custom_command ( TARGET copy_falco_plugins
2022-06-30 16:45:49 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { L O G R A Y _ P L U G I N _ D I R } / f a l c o
2023-01-12 01:50:36 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t $ { F A L C O _ P L U G I N S } $ { L O G R A Y _ P L U G I N _ D I R } / f a l c o
V E R B A T I M
2022-04-19 22:19:50 +00:00
)
2022-06-30 16:45:49 +00:00
add_dependencies ( logray copy_falco_plugins )
2022-04-19 22:19:50 +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
L I N K _ F L A G S " $ { W I L D C A R D _ O B J } $ { W S _ L I N K _ F L A G S } "
2014-10-09 18:37:27 +00:00
F O L D E R $ { _ f o l d e r }
2019-01-21 10:56:57 +00:00
I N S T A L L _ R P A T H " $ { E X E C U T A B L E _ I N S T A L L _ R P A T H } "
2014-10-09 18:37:27 +00:00
)
2021-03-29 10:10:16 +00:00
if ( MSVC )
set_target_properties ( ${ _executable } PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}" )
endif ( )
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
R U N T I M E _ O U T P U T _ D I R E C T O R Y r u n / $ < C O N F I G > / W i r e s h a r k . a p p / C o n t e n t s / M a c O S
)
else ( )
set_target_properties ( ${ _executable } PROPERTIES
R U N T I M E _ O U T P U T _ D I R E C T O R Y r u n / W i r e s h a r k . a p p / C o n t e n t s / M a c O S
)
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
C O M M A N D l n - s - f
W i r e s h a r k . a p p / C o n t e n t s / M a c O S / $ { _ e x e c u t a b l e }
$ { C M A K E _ B I N A R Y _ D I R } / r u n / $ { _ e x e c u t a b l e }
)
add_dependencies ( ${ _executable } ${ _executable } -symlink )
2018-06-15 10:44:47 +00:00
endif ( )
2014-10-09 18:37:27 +00:00
endif ( )
endmacro ( )
2021-09-21 18:15:09 +00:00
macro ( executable_link_mingw_unicode _target )
# target_link_options() requires CMake >= 3.13
2021-09-22 13:48:06 +00:00
if ( MINGW )
2021-09-21 18:15:09 +00:00
target_link_options ( ${ _target } PRIVATE "-municode" )
endif ( )
endmacro ( )
2012-01-12 19:16:15 +00:00
register_tap_files ( tshark-tap-register.c
$ { T S H A R K _ T A P _ S R C }
)
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
u i
2014-06-23 23:48:41 +00:00
c a p c h i l d
2014-07-04 07:24:02 +00:00
c a p u t i l s
2018-08-23 21:03:28 +00:00
w i r e t a p
2018-11-27 19:37:33 +00:00
e p a n
2023-01-30 20:27:06 +00:00
w s u t i l
2012-11-22 16:49:17 +00:00
$ { A P P L E _ C O R E _ F O U N D A T I O N _ L I B R A R Y }
$ { A P P L E _ S Y S T E M _ C O N F I G U R A T I O N _ L I B R A R Y }
2019-04-30 22:48:06 +00:00
$ { W I N _ W S 2 _ 3 2 _ L I B R A R Y }
2018-11-27 19:37:33 +00:00
$ { M _ L I B R A R I E S }
2009-09-08 07:03:57 +00:00
)
set ( tshark_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c a p t u r e _ o p t s >
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
$ < T A R G E T _ O B J E C T S : s h a r k _ c o m m o n >
2009-09-08 07:03:57 +00:00
t s h a r k - t a p - r e g i s t e r . c
t s h a r k . c
2022-08-07 10:31:48 +00:00
e x t c a p . c
2009-09-08 07:03:57 +00:00
$ { T S H A R K _ T A P _ S R C }
)
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 } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( tshark )
2009-09-08 07:03:57 +00:00
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
u i
2018-08-23 21:03:28 +00:00
w i r e t a p
2018-11-27 19:37:33 +00:00
e p a n
2014-01-08 04:35:28 +00:00
$ { A P P L E _ C O R E _ F O U N D A T I O N _ L I B R A R Y }
$ { A P P L E _ S Y S T E M _ C O N F I G U R A T I O N _ L I B R A R Y }
)
set ( tfshark_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
$ < T A R G E T _ O B J E C T S : s h a r k _ c o m m o n >
2014-01-08 04:35:28 +00:00
t f s h a r k . c
$ { T S H A R K _ T A P _ S R C }
)
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
c a p u t i l s
2017-04-08 21:44:00 +00:00
u i
2018-08-23 21:03:28 +00:00
w i r e t a p
2018-11-27 19:37:33 +00:00
e p a n
2012-11-22 16:49:17 +00:00
$ { A P P L E _ C O R E _ F O U N D A T I O N _ L I B R A R Y }
$ { A P P L E _ S Y S T E M _ C O N F I G U R A T I O N _ L I B R A R Y }
2019-04-30 22:48:06 +00:00
$ { W I N _ W S 2 _ 3 2 _ L I B R A R Y }
2009-09-08 07:03:57 +00:00
)
set ( rawshark_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
$ < T A R G E T _ O B J E C T S : s h a r k _ c o m m o n >
2009-09-08 07:03:57 +00:00
r a w s h a r k . 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 } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( rawshark )
2009-09-08 07:03:57 +00:00
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
u i
2018-08-23 21:03:28 +00:00
w i r e t a p
2018-11-27 19:37:33 +00:00
e p a n
2016-10-15 18:48:17 +00:00
$ { A P P L E _ C O R E _ F O U N D A T I O N _ L I B R A R Y }
$ { A P P L E _ S Y S T E M _ C O N F I G U R A T I O N _ L I B R A R Y }
2019-04-30 22:48:06 +00:00
$ { W I N _ W S 2 _ 3 2 _ L I B R A R Y }
2019-02-02 14:52:07 +00:00
$ { S P E E X D S P _ L I B R A R I E S }
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
$ < T A R G E T _ O B J E C T S : s h a r k _ c o m m o n >
2016-10-15 18:48:17 +00:00
s h a r k d . c
s h a r k d _ d a e m o n . c
s h a r k d _ s e s s i o n . 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 } )
2021-02-17 02:04:59 +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
u i
2018-08-23 21:03:28 +00:00
w i r e t a p
2018-11-27 19:37:33 +00:00
e p a n
2009-09-08 07:03:57 +00:00
)
set ( dftest_FILES
2012-02-19 08:59:17 +00:00
d f t e s t . c
2009-09-08 07:03:57 +00:00
)
2021-12-12 21:11:17 +00:00
set_executable_resources ( dftest "Dftest" )
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
r a n d p k t _ c o r e
2017-04-20 21:07:06 +00:00
u i
2009-09-08 07:03:57 +00:00
w i r e t a p
2013-10-13 09:21:55 +00:00
w s u t i l
2009-09-08 07:03:57 +00:00
)
set ( randpkt_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
2009-09-08 07:03:57 +00:00
r a n d p k t . c
)
2021-12-12 21:11:17 +00:00
set_executable_resources ( randpkt "Randpkt"
C O P Y R I G H T _ I N F O " Copyright ( C ) 1 9 9 9 b y G i l b e r t R a m i r e z < g r a m @ a l u m n i . r i c e . e d u > " )
2009-09-08 07:03:57 +00:00
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 } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( randpkt )
2009-09-08 07:03:57 +00:00
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
2021-12-20 05:30:04 +00:00
w i r e t a p
2012-12-18 22:56:06 +00:00
w s u t i l
2021-12-20 05:30:04 +00:00
u i
2021-12-22 15:06:25 +00:00
e p a n
2010-05-19 13:05:35 +00:00
$ { Z L I B _ L I B R A R I E S }
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
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
2009-09-02 16:33:01 +00:00
t e x t 2 p c a p . c
)
2018-10-08 23:34:39 +00:00
set_executable_resources ( text2pcap "Text2pcap"
C O P Y R I G H T _ I N F O " 2 0 0 1 A s h o k N a r a y a n a n < a s h o k n @ c i s c o . c o m > " )
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 } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( text2pcap )
2009-09-02 16:33:01 +00:00
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
u i
2009-09-02 16:33:01 +00:00
w i r e t a p
2010-05-19 13:05:35 +00:00
$ { Z L I B _ L I B R A R I E S }
2013-08-13 09:58:09 +00:00
$ { C M A K E _ D L _ L I B S }
2009-09-02 16:33:01 +00:00
)
set ( mergecap_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
2009-09-02 16:33:01 +00:00
m e r g e c a p . 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 } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( mergecap )
2009-09-02 16:33:01 +00:00
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
u i
2012-09-24 10:23:20 +00:00
w i r e t a p
$ { Z L I B _ L I B R A R I E S }
2013-08-13 09:58:09 +00:00
$ { C M A K E _ D L _ L I B S }
2012-09-24 10:23:20 +00:00
)
set ( reordercap_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
2012-09-24 10:23:20 +00:00
r e o r d e r c a p . 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 } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( reordercap )
2012-09-24 10:23:20 +00:00
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
u i
2009-09-02 16:33:01 +00:00
w i r e t a p
2012-10-03 17:31:23 +00:00
w s u t i l
2010-05-19 13:05:35 +00:00
$ { Z L I B _ L I B R A R I E S }
2009-12-08 11:04:52 +00:00
$ { G C R Y P T _ L I B R A R I E S }
2013-08-13 09:58:09 +00:00
$ { C M A K E _ D L _ L I B S }
2009-09-02 16:33:01 +00:00
)
set ( capinfos_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
2009-09-02 16:33:01 +00:00
c a p i n f o s . 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 } )
2021-07-13 18:02:52 +00:00
target_include_directories ( capinfos SYSTEM PRIVATE ${ GCRYPT_INCLUDE_DIRS } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( capinfos )
2009-09-02 16:33:01 +00:00
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
u i
2013-12-13 02:59:16 +00:00
w i r e t a p
w s u t i l
$ { Z L I B _ L I B R A R I E S }
$ { C M A K E _ D L _ L I B S }
)
set ( captype_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
2013-12-13 02:59:16 +00:00
c a p t y p e . 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 } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( captype )
2013-12-13 02:59:16 +00:00
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
u i
2009-09-02 16:33:01 +00:00
w i r e t a p
2010-05-19 13:05:35 +00:00
$ { Z L I B _ L I B R A R I E S }
2017-02-13 18:31:26 +00:00
$ { G C R Y P T _ L I B R A R I E S }
2013-08-13 09:58:09 +00:00
$ { C M A K E _ D L _ L I B S }
2009-09-02 16:33:01 +00:00
)
set ( editcap_FILES
2019-01-12 11:43:18 +00:00
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
2009-09-02 16:33:01 +00:00
e d i t c a p . 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 } )
2021-07-13 18:02:52 +00:00
target_include_directories ( editcap SYSTEM PRIVATE ${ GCRYPT_INCLUDE_DIRS } )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( editcap )
2009-09-02 16:33:01 +00:00
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
w r i t e c a p
2023-01-25 21:41:55 +00:00
w s u t i l _ s t a t i c
2019-09-22 12:35:27 +00:00
p c a p : : p c a p
2009-09-12 17:20:08 +00:00
$ { C A P _ L I B R A R I E S }
2010-05-19 13:05:35 +00:00
$ { Z L I B _ L I B R A R I E S }
2023-01-25 21:41:55 +00:00
$ { N L _ L I B R A R I E S }
2012-11-22 16:49:17 +00:00
$ { A P P L E _ C O R E _ F O U N D A T I O N _ L I B R A R Y }
$ { A P P L E _ S Y S T E M _ C O N F I G U R A T I O N _ L I B R A R Y }
2019-04-30 22:48:06 +00:00
$ { W I N _ W S 2 _ 3 2 _ L I B R A R Y }
2009-09-02 16:33:01 +00:00
)
2023-01-25 21:41:55 +00:00
if ( UNIX )
list ( APPEND CAPUTILS_SRC
c a p t u r e / c a p t u r e - p c a p - u t i l - u n i x . c )
endif ( )
if ( WIN32 )
list ( APPEND CAPUTILS_SRC
c a p t u r e / c a p t u r e _ w i n _ i f n a m e s . c
c a p t u r e / c a p t u r e - w p c a p . c
)
endif ( )
list ( APPEND CAPUTILS_SRC
c a p t u r e / c a p t u r e - p c a p - u t i l . c
)
if ( AIRPCAP_FOUND )
list ( APPEND CAPUTILS_SRC capture/airpcap_loader.c )
endif ( )
2009-09-02 16:33:01 +00:00
set ( dumpcap_FILES
2023-01-25 21:41:55 +00:00
c a p t u r e _ o p t s . c
c l i _ m a i n . c
2009-09-02 16:33:01 +00:00
d u m p c a p . c
r i n g b u f f e r . c
s y n c _ p i p e _ w r i t e . c
2023-01-25 21:41:55 +00:00
c a p t u r e / i f a c e _ m o n i t o r . c
c a p t u r e / w s 8 0 2 1 1 _ u t i l s . c
$ { C A P U T I L S _ S R C }
2009-09-02 16:33:01 +00:00
)
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 } )
2023-01-25 21:41:55 +00:00
target_include_directories ( dumpcap SYSTEM PRIVATE ${ ZLIB_INCLUDE_DIRS } ${ NL_INCLUDE_DIRS } )
target_compile_definitions ( dumpcap PRIVATE ENABLE_STATIC )
2021-09-21 18:15:09 +00:00
executable_link_mingw_unicode ( dumpcap )
2014-01-19 00:48:22 +00:00
install ( TARGETS dumpcap
2014-10-09 18:37:27 +00:00
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
2014-01-19 00:48:22 +00:00
P E R M I S S I O N S $ { D U M P C A P _ S E T U I D }
O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E
G R O U P _ R E A D G R O U P _ E X E C U T E W O R L D _ R E A D W O R L D _ E X E C U T E
)
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(
C O M M A N D
$ { S E T C A P _ E X E C U T A B L E }
c a p _ n e t _ r a w , c a p _ n e t _ a d m i n + e p
$ { C M A K E _ I N S T A L L _ P R E F I X } / $ { C M A K E _ I N S T A L L _ B I N D I R } / d u m p c a p $ { C M A K E _ E X E C U T A B L E _ S U F F I X }
R E S U L T _ V A R I A B L E
_ S E T C A P _ R E S U L T
)
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 ( )
2022-06-30 16:45:49 +00:00
if ( BUILD_logray AND ENABLE_APPLICATION_BUNDLE )
2022-04-06 16:08:12 +00:00
add_custom_command ( TARGET dumpcap POST_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t
2022-06-30 16:45:49 +00:00
$ < T A R G E T _ F I L E : d u m p c a p > r u n / L o g r a y . a p p / C o n t e n t s / M a c O S / d u m p c a p
2022-04-06 16:08:12 +00:00
)
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. "
" W i r e s h a r k w i l l b e b u i l t w i t h o u t p a c k e t c a p t u r e c a p a b i l i t y . " )
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
w s u t i l
)
set ( idl2wrs_FILES
e p a n / d i s s e c t o r s / d c e r p c / i d l 2 w r s . 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 ( )
2023-01-11 00:10:05 +00:00
if ( MSVC )
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 )
2022-06-02 22:07:09 +00:00
ADD_NSIS_UNINSTALLER_TARGETS ( )
ADD_NSIS_PACKAGE_TARGETS ( )
2015-01-06 23:07:50 +00:00
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.
$ { M A X M I N D D B _ L I B R A R Y }
2020-11-30 22:57:01 +00:00
# Needed for CMake-built libmaxminddb.lib <= 1.43.
$ { W I N _ W S 2 _ 3 2 _ L I B R A R Y }
2018-02-09 01:20:26 +00:00
)
set ( mmdbresolve_FILES
m m d b r e s o l v e . c
)
2021-12-12 21:11:17 +00:00
set_executable_resources ( mmdbresolve "Mmdbresolve" )
2018-02-09 01:20:26 +00:00
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 ( )
2022-02-28 22:04:09 +00:00
if ( ENABLE_APPLICATION_BUNDLE AND BUILD_wireshark )
2020-10-16 20:37:27 +00:00
file ( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}/Wireshark.app/Contents/Resources/Extras" )
2019-12-18 00:25:10 +00:00
# --preserve-xattr is undocumented but ensures that we install
# a signed ChmodBPF script.
2023-02-09 00:21:56 +00:00
set ( _chmodbpf_version 1.2 )
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
C O M M A N D f i n d
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / r o o t "
- t y p e d
- e x e c c h m o d 7 5 5 " { } " +
C O M M A N D c h m o d 6 4 4
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / r o o t / L i b r a r y / L a u n c h D a e m o n s / o r g . w i r e s h a r k . C h m o d B P F . p l i s t "
C O M M A N D c h m o d 7 5 5
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / r o o t / L i b r a r y / A p p l i c a t i o n S u p p o r t / W i r e s h a r k / C h m o d B P F / C h m o d B P F "
2019-12-18 17:33:23 +00:00
C O M M A N D " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / o s x - e x t r a s . s h "
2018-12-12 00:26:51 +00:00
C O M M A N D p k g b u i l d
- - i d e n t i f i e r o r g . w i r e s h a r k . C h m o d B P F . p k g
2023-02-09 00:21:56 +00:00
- - v e r s i o n $ { _ c h m o d b p f _ v e r s i o n }
2019-12-18 00:25:10 +00:00
- - p r e s e r v e - x a t t r
2018-12-12 00:26:51 +00:00
- - r o o t " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / r o o t "
- - s c r i p t s " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / i n s t a l l - s c r i p t s "
$ { i n s t a l l _ c h m o d b p f _ c o m p o n e n t _ p k g }
D E P E N D S
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / r o o t / L i b r a r y / A p p l i c a t i o n S u p p o r t / W i r e s h a r k / C h m o d B P F / C h m o d B P F "
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / r o o t / L i b r a r y / L a u n c h D a e m o n s / o r g . w i r e s h a r k . C h m o d B P F . p l i s t "
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / i n s t a l l - s c r i p t s / p o s t i n s t a l l "
)
set ( install_chmodbpf_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Install ChmodBPF.pkg" )
add_custom_command ( OUTPUT "${install_chmodbpf_pkg}"
C O M M A N D p r o d u c t b u i l d
- - i d e n t i f i e r o r g . w i r e s h a r k . i n s t a l l . C h m o d B P F . p r o d u c t
2023-02-09 00:21:56 +00:00
- - v e r s i o n $ { _ c h m o d b p f _ v e r s i o n }
2018-12-12 00:26:51 +00:00
- - d i s t r i b u t i o n " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / i n s t a l l - d i s t r i b u t i o n . x m l "
- - p a c k a g e - p a t h " $ { C M A K E _ B I N A R Y _ D I R } "
$ { i n s t a l l _ c h m o d b p f _ p k g }
D E P E N D S
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / i n s t a l l - d i s t r i b u t i o n . x m l "
$ { i n s t a l l _ c h m o d b p f _ c o m p o n e n t _ p k g }
)
set ( uninstall_chmodbpf_component_pkg "${CMAKE_BINARY_DIR}/uninstall.ChmodBPF.pkg" )
add_custom_command ( OUTPUT "${uninstall_chmodbpf_component_pkg}"
C O M M A N D p k g b u i l d
- - i d e n t i f i e r o r g . w i r e s h a r k . u n i n s t a l l . C h m o d B P F . p k g
2023-02-09 00:21:56 +00:00
- - v e r s i o n $ { _ c h m o d b p f _ v e r s i o n }
2018-12-12 00:26:51 +00:00
- - n o p a y l o a d
- - s c r i p t s " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / u n i n s t a l l - s c r i p t s "
$ { u n i n s t a l l _ c h m o d b p f _ c o m p o n e n t _ p k g }
D E P E N D S
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / u n i n s t a l l - s c r i p t s / p o s t i n s t a l l "
)
set ( uninstall_chmodbpf_pkg "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/Extras/Uninstall ChmodBPF.pkg" )
add_custom_command ( OUTPUT "${uninstall_chmodbpf_pkg}"
C O M M A N D p r o d u c t b u i l d
- - i d e n t i f i e r o r g . w i r e s h a r k . u n i n s t a l l . C h m o d B P F . p r o d u c t
2023-02-09 00:21:56 +00:00
- - v e r s i o n $ { _ c h m o d b p f _ v e r s i o n }
2018-12-12 00:26:51 +00:00
- - d i s t r i b u t i o n " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / u n i n s t a l l - d i s t r i b u t i o n . x m l "
- - p a c k a g e - p a t h " $ { C M A K E _ B I N A R Y _ D I R } "
$ { u n i n s t a l l _ c h m o d b p f _ p k g }
D E P E N D S
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / C h m o d B P F / u n i n s t a l l - d i s t r i b u t i o n . x m l "
$ { u n i n s t a l l _ c h m o d b p f _ c o m p o n e n t _ p k g }
)
add_custom_target ( chmodbpf DEPENDS ${ install_chmodbpf_pkg } ${ uninstall_chmodbpf_pkg } )
2023-02-09 00:21:56 +00:00
set ( _path_helper_version 1.1 )
2018-12-12 00:26:51 +00:00
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
C O M M A N D f i n d
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / r o o t "
- t y p e d
- e x e c c h m o d 7 5 5 " { } " +
C O M M A N D f i n d
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / r o o t "
- t y p e f
- e x e c c h m o d 6 4 4 " { } " +
2018-12-12 00:26:51 +00:00
C O M M A N D p k g b u i l d
- - i d e n t i f i e r o r g . w i r e s h a r k . p a t h _ h e l p e r . p k g
2023-02-09 00:21:56 +00:00
- - v e r s i o n $ { _ p a t h _ h e l p e r _ v e r s i o n }
2018-12-12 00:26:51 +00:00
- - r o o t " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / r o o t / e t c "
- - i n s t a l l - l o c a t i o n / p r i v a t e / e t c
$ { i n s t a l l _ p a t h _ h e l p e r _ c o m p o n e n t _ p k g }
D E P E N D S
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / r o o t / e t c / p a t h s . d / W i r e s h a r k "
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / r o o t / e t c / m a n p a t h s . d / W i r e s h a r k "
)
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}"
C O M M A N D p r o d u c t b u i l d
- - i d e n t i f i e r o r g . w i r e s h a r k . i n s t a l l . p a t h _ h e l p e r . p r o d u c t
2023-02-09 00:21:56 +00:00
- - v e r s i o n $ { _ p a t h _ h e l p e r _ v e r s i o n }
2018-12-12 00:26:51 +00:00
- - d i s t r i b u t i o n " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / i n s t a l l - d i s t r i b u t i o n . x m l "
- - p a c k a g e - p a t h " $ { C M A K E _ B I N A R Y _ D I R } "
$ { i n s t a l l _ p a t h _ h e l p e r _ p k g }
D E P E N D S
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / i n s t a l l - d i s t r i b u t i o n . x m l "
$ { i n s t a l l _ p a t h _ h e l p e r _ c o m p o n e n t _ p k g }
)
set ( uninstall_path_helper_component_pkg "${CMAKE_BINARY_DIR}/uninstall.path_helper.pkg" )
add_custom_command ( OUTPUT "${uninstall_path_helper_component_pkg}"
C O M M A N D p k g b u i l d
- - i d e n t i f i e r o r g . w i r e s h a r k . u n i n s t a l l . p a t h _ h e l p e r . p k g
2023-02-09 00:21:56 +00:00
- - v e r s i o n $ { _ p a t h _ h e l p e r _ v e r s i o n }
2018-12-12 00:26:51 +00:00
- - n o p a y l o a d
- - s c r i p t s " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / u n i n s t a l l - s c r i p t s "
$ { u n i n s t a l l _ p a t h _ h e l p e r _ c o m p o n e n t _ p k g }
D E P E N D S
" $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / u n i n s t a l l - s c r i p t s / p o s t i n s t a l l "
)
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}"
C O M M A N D p r o d u c t b u i l d
- - i d e n t i f i e r o r g . w i r e s h a r k . u n i n s t a l l . p a t h _ h e l p e r . p r o d u c t
2023-02-09 00:21:56 +00:00
- - v e r s i o n $ { _ p a t h _ h e l p e r _ v e r s i o n }
2018-12-12 00:26:51 +00:00
- - d i s t r i b u t i o n " $ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / u n i n s t a l l - d i s t r i b u t i o n . x m l "
- - p a c k a g e - p a t h " $ { C M A K E _ B I N A R Y _ D I R } "
$ { u n i n s t a l l _ p a t h _ h e l p e r _ p k g }
D E P E N D S
$ { C M A K E _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / p a t h _ h e l p e r / u n i n s t a l l - d i s t r i b u t i o n . x m l
$ { u n i n s t a l l _ p a t h _ h e l p e r _ c o m p o n e n t _ p k g }
)
add_custom_target ( path_helper DEPENDS ${ install_path_helper_pkg } ${ uninstall_path_helper_pkg } )
2022-05-25 20:56:57 +00:00
add_custom_target ( wireshark_app_bundle )
set_target_properties ( wireshark_app_bundle PROPERTIES FOLDER "Copy Tasks" )
add_custom_command ( TARGET wireshark_app_bundle
2015-02-01 21:56:39 +00:00
P O S T _ B U I L D
2017-10-04 23:27:08 +00:00
C O M M A N D " $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / m a c o s x / o s x - a p p . s h "
2015-02-01 21:56:39 +00:00
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ B I N A R Y _ D I R } / r u n "
)
2022-05-25 20:56:57 +00:00
add_dependencies ( wireshark_app_bundle ${ PROGLIST } chmodbpf path_helper )
2014-10-23 17:57:45 +00:00
2022-05-25 20:56:57 +00:00
add_custom_target ( wireshark_dmg_prep DEPENDS wireshark_app_bundle )
2020-03-03 16:28:39 +00:00
2022-05-25 20:56:57 +00:00
FILE ( MAKE_DIRECTORY packaging/macosx/wireshark )
set ( _wireshark_read_me_first "packaging/macosx/wireshark/Read me first.html" )
2020-03-03 16:28:39 +00:00
ADD_CUSTOM_COMMAND (
O U T P U T
2022-05-25 20:56:57 +00:00
$ { _ w i r e s h a r k _ r e a d _ m e _ f i r s t }
2020-03-03 16:28:39 +00:00
C O M M A N D $ { A S C I I D O C T O R _ E X E C U T A B L E }
- - b a c k e n d h t m l
2022-05-25 20:56:57 +00:00
- - o u t - f i l e $ { _ w i r e s h a r k _ r e a d _ m e _ f i r s t }
2020-03-03 16:28:39 +00:00
- - a t t r i b u t e i n c l u d e - d i r = $ { C M A K E _ S O U R C E _ D I R } / d o c b o o k
- - a t t r i b u t e m i n - m a c o s - v e r s i o n = $ { M I N _ M A C O S _ V E R S I O N }
2022-05-25 20:56:57 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / W i r e s h a r k _ r e a d _ m e _ f i r s t . a d o c
2020-03-03 16:28:39 +00:00
D E P E N D S
2022-05-25 20:56:57 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / W i r e s h a r k _ r e a d _ m e _ f i r s t . a d o c
2020-03-03 16:28:39 +00:00
)
2022-02-26 23:14:36 +00:00
2023-01-11 02:04:34 +00:00
set ( _wireshark_donate "packaging/macosx/wireshark/Donate to the Wireshark Foundation.html" )
ADD_CUSTOM_COMMAND (
O U T P U T
$ { _ w i r e s h a r k _ d o n a t e }
C O M M A N D $ { A S C I I D O C T O R _ E X E C U T A B L E }
- - b a c k e n d h t m l
- - o u t - f i l e $ { _ w i r e s h a r k _ d o n a t e }
- - a t t r i b u t e i n c l u d e - d i r = $ { C M A K E _ S O U R C E _ D I R } / d o c b o o k
- - a t t r i b u t e m i n - m a c o s - v e r s i o n = $ { M I N _ M A C O S _ V E R S I O N }
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / D o n a t e _ t o _ t h e _ W i r e s h a r k _ F o u n d a t i o n . a d o c
D E P E N D S
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / D o n a t e _ t o _ t h e _ W i r e s h a r k _ F o u n d a t i o n . a d o c
)
2022-05-25 20:56:57 +00:00
set ( _wireshark_dsym_installation "packaging/macosx/wireshark/Debugging symbols installation.html" )
2022-02-26 23:14:36 +00:00
ADD_CUSTOM_COMMAND (
O U T P U T
2022-05-25 20:56:57 +00:00
$ { _ w i r e s h a r k _ d s y m _ i n s t a l l a t i o n }
2022-02-26 23:14:36 +00:00
C O M M A N D $ { A S C I I D O C T O R _ E X E C U T A B L E }
- - b a c k e n d h t m l
2022-05-25 20:56:57 +00:00
- - o u t - f i l e $ { _ w i r e s h a r k _ d s y m _ i n s t a l l a t i o n }
2022-02-26 23:14:36 +00:00
- - a t t r i b u t e i n c l u d e - d i r = $ { C M A K E _ S O U R C E _ D I R } / d o c b o o k
2022-05-25 20:56:57 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / W i r e s h a r k _ d s y m _ i n s t a l l a t i o n . a d o c
2022-02-26 23:14:36 +00:00
D E P E N D S
2022-05-25 20:56:57 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / W i r e s h a r k _ d s y m _ i n s t a l l a t i o n . a d o c
2022-02-26 23:14:36 +00:00
)
2023-01-11 02:04:34 +00:00
add_custom_target ( wireshark_dmg_readmes DEPENDS ${ _wireshark_read_me_first } ${ _wireshark_donate } ${ _wireshark_dsym_installation } )
2022-05-25 20:56:57 +00:00
add_dependencies ( wireshark_dmg_prep wireshark_dmg_readmes )
2020-03-03 16:28:39 +00:00
2022-05-25 20:56:57 +00:00
ADD_CUSTOM_TARGET ( wireshark_dmg
2020-03-03 16:28:39 +00:00
C O M M A N D b a s h - x $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / m a c o s x / o s x - d m g . s h
2022-06-02 22:07:09 +00:00
# Unlike wireshark_nsis_prep + wireshark_nsis, we can add a direct
2020-03-03 16:28:39 +00:00
# dependency here.
2022-05-25 20:56:57 +00:00
D E P E N D S w i r e s h a r k _ d m g _ p r e p
2020-03-03 16:28:39 +00:00
# We create Wireshark.app in "run". Do our work there.
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ B I N A R Y _ D I R } / r u n
)
2014-10-23 17:57:45 +00:00
2014-10-09 18:37:27 +00:00
endif ( )
2022-06-30 16:45:49 +00:00
if ( ENABLE_APPLICATION_BUNDLE AND BUILD_logray )
add_custom_target ( logray_app_bundle )
set_target_properties ( logray_app_bundle PROPERTIES FOLDER "Copy Tasks" )
add_custom_command ( TARGET logray_app_bundle
2022-02-28 22:04:09 +00:00
P O S T _ B U I L D
2022-06-30 16:45:49 +00:00
C O M M A N D " $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / m a c o s x / o s x - a p p . s h " - - b u n d l e L o g r a y . a p p
2022-02-28 22:04:09 +00:00
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ B I N A R Y _ D I R } / r u n "
)
2022-06-30 16:45:49 +00:00
add_custom_target ( logray_dmg_prep DEPENDS logray_app_bundle )
2022-05-25 20:56:57 +00:00
2022-06-30 16:45:49 +00:00
FILE ( MAKE_DIRECTORY packaging/macosx/logray )
2022-05-25 20:56:57 +00:00
2022-06-30 16:45:49 +00:00
set ( _logray_read_me_first "packaging/macosx/logray/Read me first.html" )
2022-05-25 20:56:57 +00:00
ADD_CUSTOM_COMMAND (
O U T P U T
2022-06-30 16:45:49 +00:00
$ { _ l o g r a y _ r e a d _ m e _ f i r s t }
2022-05-25 20:56:57 +00:00
C O M M A N D $ { A S C I I D O C T O R _ E X E C U T A B L E }
- - b a c k e n d h t m l
2022-06-30 16:45:49 +00:00
- - o u t - f i l e $ { _ l o g r a y _ r e a d _ m e _ f i r s t }
2022-05-25 20:56:57 +00:00
- - a t t r i b u t e i n c l u d e - d i r = $ { C M A K E _ S O U R C E _ D I R } / d o c b o o k
- - a t t r i b u t e m i n - m a c o s - v e r s i o n = $ { M I N _ M A C O S _ V E R S I O N }
2022-06-30 16:45:49 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / L o g r a y _ r e a d _ m e _ f i r s t . a d o c
2022-05-25 20:56:57 +00:00
D E P E N D S
2022-06-30 16:45:49 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / L o g r a y _ r e a d _ m e _ f i r s t . a d o c
2022-05-25 20:56:57 +00:00
)
2022-06-30 16:45:49 +00:00
set ( _logray_dsym_installation "packaging/macosx/logray/Debugging symbols installation.html" )
2022-05-25 20:56:57 +00:00
ADD_CUSTOM_COMMAND (
O U T P U T
2022-06-30 16:45:49 +00:00
$ { _ l o g r a y _ d s y m _ i n s t a l l a t i o n }
2022-05-25 20:56:57 +00:00
C O M M A N D $ { A S C I I D O C T O R _ E X E C U T A B L E }
- - b a c k e n d h t m l
2022-06-30 16:45:49 +00:00
- - o u t - f i l e $ { _ l o g r a y _ d s y m _ i n s t a l l a t i o n }
2022-05-25 20:56:57 +00:00
- - a t t r i b u t e i n c l u d e - d i r = $ { C M A K E _ S O U R C E _ D I R } / d o c b o o k
2022-06-30 16:45:49 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / L o g r a y _ d s y m _ i n s t a l l a t i o n . a d o c
2022-05-25 20:56:57 +00:00
D E P E N D S
2022-06-30 16:45:49 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a c k a g i n g / m a c o s x / L o g r a y _ d s y m _ i n s t a l l a t i o n . a d o c
2022-05-25 20:56:57 +00:00
)
2022-06-30 16:45:49 +00:00
add_custom_target ( logray_dmg_readmes DEPENDS ${ _logray_read_me_first } ${ _logray_dsym_installation } )
add_dependencies ( logray_dmg_prep logray_dmg_readmes )
2022-02-28 22:04:09 +00:00
2022-06-30 16:45:49 +00:00
ADD_CUSTOM_TARGET ( logray_dmg
C O M M A N D b a s h - x $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / m a c o s x / o s x - d m g . s h - - a p p - n a m e L o g r a y
2022-06-08 01:38:46 +00:00
# Unlike wireshark_nsis_prep + wireshark_nsis, we can add a direct
# dependency here.
2022-06-30 16:45:49 +00:00
D E P E N D S l o g r a y _ d m g _ p r e p
2022-06-08 01:38:46 +00:00
# We create Wireshark.app in "run". Do our work there.
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ B I N A R Y _ D I R } / r u n
)
2022-02-28 22:04:09 +00:00
endif ( )
2018-03-20 23:15:33 +00:00
if ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
find_program ( RPMBUILD_EXECUTABLE rpmbuild )
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
2023-01-12 23:19:35 +00:00
find_program ( LINUXDEPLOY_EXECUTABLE NAMES linuxdeploy-x86_64.AppImage linuxdeploy )
find_program ( _linuxdeploy_plugin_qt NAMES linuxdeploy-plugin-qt-x86_64.AppImage linuxdeploy-plugin-qt )
find_program ( APPIMAGETOOL_EXECUTABLE NAMES appimagetool-x86_64.AppImage
a p p i m a g e t o o l )
2018-03-20 23:15:33 +00:00
endif ( )
2018-04-27 14:22:53 +00:00
2022-06-07 22:51:24 +00:00
string ( REPLACE "-" "_" RPM_VERSION "${PROJECT_VERSION}" )
2019-01-11 22:34:03 +00:00
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 ( )
2022-10-21 16:47:28 +00:00
set ( _rpmbuild_with_args )
2021-02-16 08:33:50 +00:00
#
# This is ugly.
#
# At least some versions of rpmbuild define the cmake_build
# macro to run "cmake --build" with the "--verbose" option,
# with no obvious way to easily override that, so, if you
# are doing a build with lots of source files, and with
# lots of compiler options (for example, a log of -W flags),
# you can get a lot of output from rpmbuild.
#
# Wireshark is a program with lots of source files and
# lots of compiler options.
#
# GitLab's shared builders have a limit of 4MB on logs
# from build jobs.
#
# Wireshark uses the shared builders, and can produce
# more than 4MB with the Fedora RPM build; this causes
# the builds to fail.
#
# Forcibly overriding the cmake_build macro with a
# version that lacks the --version file should
# prevent ninja from being run with the -v flag,
# so that it prints the compact output rather
# than the raw command.
#
# We don't do that by default; if the build has the
# FORCE_CMAKE_NINJA_QUIET environment variable set,
# it will add it.
#
if ( DEFINED ENV{FORCE_CMAKE_NINJA_NON_VERBOSE} )
#
# Get the output of a pipeline running
# "rpmbuild --showrc", to find the settings
# of all macros, piped to an awk script
# to extract the value of the cmake_build
# macro.
#
execute_process (
C O M M A N D r p m b u i l d - - s h o w r c
C O M M A N D a w k " / : c m a k e _ b u i l d / { g e t l i n e ; p r i n t \ $ 0 ; e x i t } "
O U T P U T _ V A R I A B L E C M A K E _ B U I L D _ V A L U E
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
if ( CMAKE_BUILD_VALUE MATCHES ".*--verbose.*" )
#
# OK, the setting contains "--verbose".
# Rip it out.
#
string ( REPLACE "--verbose" ""
N O N _ V E R B O S E _ C M A K E _ B U I L D _ V A L U E
$ { C M A K E _ B U I L D _ V A L U E } )
list ( APPEND _rpmbuild_with_args --define "cmake_build ${NON_VERBOSE_CMAKE_BUILD_VALUE}" )
endif ( )
2021-02-16 21:23:46 +00:00
else ( )
if ( CMAKE_VERBOSE_MAKEFILE )
list ( APPEND _rpmbuild_with_args -v )
endif ( )
2021-02-16 08:33:50 +00:00
endif ( )
2022-01-19 14:12:55 +00:00
if ( CMAKE_C_COMPILER_ID STREQUAL "Clang" )
list ( APPEND _rpmbuild_with_args --with toolchain_clang )
endif ( )
2018-03-20 23:15:33 +00:00
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 )
2022-08-24 12:43:41 +00:00
list ( APPEND _rpmbuild_with_args --without qt5 --without qt6 )
elseif ( USE_qt6 )
list ( APPEND _rpmbuild_with_args --without qt5 --with qt6 )
else ( )
list ( APPEND _rpmbuild_with_args --with qt5 --without qt6 )
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 ( 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 ( )
2020-09-29 04:33:06 +00:00
if ( OPUS_FOUND )
list ( APPEND _rpmbuild_with_args --with opus )
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 (
2022-07-11 14:44:23 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E }
$ { C M A K E _ S O U R C E _ D I R } / t o o l s / m a k e - v e r s i o n . p y
2018-04-27 14:22:53 +00:00
$ { C M A K E _ S O U R C E _ D I R }
)
2020-12-24 13:05:12 +00:00
add_custom_target ( copy-dist
C O M M A N D c p $ { C M A K E _ B I N A R Y _ D I R } / w i r e s h a r k * t a r * $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / r p m / S O U R C E S /
D E P E N D S d i s t
2018-03-20 23:15:33 +00:00
)
2022-06-08 16:29:59 +00:00
add_custom_target ( wireshark_rpm
2018-03-20 23:15:33 +00:00
C O M M A N D $ { R P M B U I L D _ E X E C U T A B L E }
- - d e f i n e " _ t o p d i r $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / r p m "
- - d e f i n e " _ p r e f i x $ { C M A K E _ I N S T A L L _ P R E F I X } "
$ { _ r p m b u i l d _ w i t h _ a r g s }
2019-01-14 12:26:14 +00:00
- b a S P E C S / w i r e s h a r k . s p e c
2020-12-24 13:05:12 +00:00
D E P E N D S c o p y - d i s t
2018-03-20 23:15:33 +00:00
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / r p m "
2020-12-22 13:48:51 +00:00
C O M M E N T " C r e a t e a r p m f r o m t h e c u r r e n t g i t c o m m i t . "
2018-03-20 23:15:33 +00:00
)
endif ( )
2023-01-17 22:07:33 +00:00
if ( BUILD_wireshark AND QT_FOUND AND LINUXDEPLOY_EXECUTABLE AND _linuxdeploy_plugin_qt AND APPIMAGETOOL_EXECUTABLE )
2023-01-17 22:07:33 +00:00
configure_file ( packaging/appimage/Wireshark-AppRun.in ${ CMAKE_BINARY_DIR } /packaging/appimage/Wireshark-AppRun @ONLY )
2023-01-12 23:19:35 +00:00
# Require production builds (/usr + Release).
if ( CMAKE_BUILD_TYPE STREQUAL "Release" AND CMAKE_INSTALL_PREFIX STREQUAL "/usr" )
2022-06-08 16:29:59 +00:00
add_custom_target ( wireshark_appimage_prerequisites )
add_dependencies ( wireshark_appimage_prerequisites ${ PROGLIST } )
2018-12-07 01:23:54 +00:00
else ( )
2022-06-08 16:29:59 +00:00
add_custom_target ( wireshark_appimage_prerequisites
2023-01-12 23:19:35 +00:00
C O M M A N D e c h o " C M A K E _ B U I L D _ T Y P E i s n ' t R e l e a s e o r C M A K E _ I N S T A L L _ P R E F I X i s n ' t / u s r . "
2018-12-07 01:23:54 +00:00
C O M M A N D f a l s e
)
endif ( )
2023-01-12 23:19:35 +00:00
set ( _wireshark_ai_appdir ${ CMAKE_BINARY_DIR } /packaging/appimage/wireshark.appdir )
2022-06-08 16:29:59 +00:00
add_custom_target ( wireshark_appimage_appdir
2023-01-12 23:19:35 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { _ w i r e s h a r k _ a i _ a p p d i r }
C O M M A N D e n v D E S T D I R = $ { _ w i r e s h a r k _ a i _ a p p d i r }
2018-12-07 01:23:54 +00:00
$ { C M A K E _ C O M M A N D } - - b u i l d . - - t a r g e t i n s t a l l
2022-06-08 16:29:59 +00:00
D E P E N D S w i r e s h a r k _ a p p i m a g e _ p r e r e q u i s i t e s
2018-12-07 01:23:54 +00:00
)
2023-01-12 23:19:35 +00:00
set ( _wireshark_appimage_exe_args )
2018-12-07 01:23:54 +00:00
foreach ( _prog ${ PROGLIST } )
2023-01-12 23:19:35 +00:00
# XXX This needs to be more robust.
if ( ${ _prog } STREQUAL "dftest" OR ${ _prog } STREQUAL "logray" )
continue ( )
endif ( )
list ( APPEND _wireshark_appimage_exe_args --executable= ${ _wireshark_ai_appdir } /usr/bin/ ${ _prog } )
2018-12-07 01:23:54 +00:00
endforeach ( )
2023-01-12 23:19:35 +00:00
# It looks like linuxdeploy can't handle executables in nonstandard
# locations, so use it to prep our staging directory here and use
# appimagetool to to build the appimage.
2022-06-08 16:29:59 +00:00
add_custom_target ( wireshark_appimage_prep
2023-01-12 23:19:35 +00:00
C O M M A N D e n v L D _ L I B R A R Y _ P A T H = $ { _ w i r e s h a r k _ a i _ a p p d i r } / $ { C M A K E _ I N S T A L L _ P R E F I X } / $ { C M A K E _ I N S T A L L _ L I B D I R } $ { L I N U X D E P L O Y _ E X E C U T A B L E }
- - a p p d i r = $ { _ w i r e s h a r k _ a i _ a p p d i r }
$ { _ w i r e s h a r k _ a p p i m a g e _ e x e _ a r g s }
- - d e s k t o p - f i l e = $ { _ w i r e s h a r k _ a i _ a p p d i r } / u s r / s h a r e / a p p l i c a t i o n s / o r g . w i r e s h a r k . W i r e s h a r k . d e s k t o p
- - i c o n - f i l e = $ { C M A K E _ S O U R C E _ D I R } / r e s o u r c e s / i c o n s / w s i c o n 2 5 6 . p n g
2023-01-17 22:07:33 +00:00
- - c u s t o m - a p p r u n = $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / a p p i m a g e / W i r e s h a r k - A p p R u n
2023-01-12 23:19:35 +00:00
- - p l u g i n = q t
2022-06-08 16:29:59 +00:00
D E P E N D S w i r e s h a r k _ a p p i m a g e _ a p p d i r
2018-12-07 01:23:54 +00:00
)
2022-06-08 16:29:59 +00:00
add_custom_target ( wireshark_appimage
2023-01-12 23:19:35 +00:00
C O M M A N D e n v V E R S I O N = $ { P R O J E C T _ V E R S I O N } $ { A P P I M A G E T O O L _ E X E C U T A B L E } $ { _ w i r e s h a r k _ a i _ a p p d i r }
2022-06-08 16:29:59 +00:00
D E P E N D S w i r e s h a r k _ a p p i m a g e _ p r e p
2018-12-07 01:23:54 +00:00
)
endif ( )
2023-01-17 22:07:33 +00:00
if ( BUILD_logray AND QT_FOUND AND LINUXDEPLOY_EXECUTABLE AND _linuxdeploy_plugin_qt AND APPIMAGETOOL_EXECUTABLE )
configure_file ( packaging/appimage/Logray-AppRun.in ${ CMAKE_BINARY_DIR } /packaging/appimage/Logray-AppRun @ONLY )
# Require production builds (/usr + Release).
if ( CMAKE_BUILD_TYPE STREQUAL "Release" AND CMAKE_INSTALL_PREFIX STREQUAL "/usr" )
add_custom_target ( logray_appimage_prerequisites )
add_dependencies ( logray_appimage_prerequisites ${ PROGLIST } )
else ( )
add_custom_target ( logray_appimage_prerequisites
C O M M A N D e c h o " C M A K E _ B U I L D _ T Y P E i s n ' t R e l e a s e o r C M A K E _ I N S T A L L _ P R E F I X i s n ' t / u s r . "
C O M M A N D f a l s e
)
endif ( )
set ( _logray_ai_appdir ${ CMAKE_BINARY_DIR } /packaging/appimage/logray.appdir )
add_custom_target ( logray_appimage_appdir
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { _ l o g r a y _ a i _ a p p d i r }
C O M M A N D e n v D E S T D I R = $ { _ l o g r a y _ a i _ a p p d i r }
$ { C M A K E _ C O M M A N D } - - b u i l d . - - t a r g e t i n s t a l l
D E P E N D S l o g r a y _ a p p i m a g e _ p r e r e q u i s i t e s
)
set ( _logray_appimage_exe_args )
foreach ( _prog ${ PROGLIST } )
# XXX This needs to be more robust.
if ( ${ _prog } STREQUAL "dftest" OR ${ _prog } STREQUAL "logray" )
continue ( )
endif ( )
list ( APPEND _logray_appimage_exe_args --executable= ${ _logray_ai_appdir } /usr/bin/ ${ _prog } )
endforeach ( )
# It looks like linuxdeploy can't handle executables in nonstandard
# locations, so use it to prep our staging directory here and use
# appimagetool to to build the appimage.
add_custom_target ( logray_appimage_prep
C O M M A N D e n v L D _ L I B R A R Y _ P A T H = $ { _ l o g r a y _ a i _ a p p d i r } / $ { C M A K E _ I N S T A L L _ P R E F I X } / $ { C M A K E _ I N S T A L L _ L I B D I R } $ { L I N U X D E P L O Y _ E X E C U T A B L E }
- - a p p d i r = $ { _ l o g r a y _ a i _ a p p d i r }
$ { _ l o g r a y _ a p p i m a g e _ e x e _ a r g s }
- - d e s k t o p - f i l e = $ { _ l o g r a y _ a i _ a p p d i r } / u s r / s h a r e / a p p l i c a t i o n s / o r g . w i r e s h a r k . L o g r a y . d e s k t o p
- - i c o n - f i l e = $ { C M A K E _ S O U R C E _ D I R } / r e s o u r c e s / i c o n s / l r i c o n 2 5 6 . p n g
- - c u s t o m - a p p r u n = $ { C M A K E _ B I N A R Y _ D I R } / p a c k a g i n g / a p p i m a g e / L o g r a y - A p p R u n
- - p l u g i n = q t
D E P E N D S l o g r a y _ a p p i m a g e _ a p p d i r
)
add_custom_target ( logray_appimage
C O M M A N D e n v V E R S I O N = $ { L O G _ P R O J E C T _ V E R S I O N } $ { A P P I M A G E T O O L _ E X E C U T A B L E } $ { _ l o g r a y _ a i _ a p p d i r }
D E P E N D S l o g r a y _ a p p i m a g e _ p r e p
)
endif ( )
2017-07-25 20:31:49 +00:00
set ( CLEAN_C_FILES
2018-08-12 18:04:36 +00:00
$ { d u m p c a p _ F I L E S }
2009-11-07 10:07:00 +00:00
$ { w i r e s h a r k _ F I L E S }
2023-01-17 22:07:33 +00:00
$ { l o g r a y _ F I L E S }
2009-11-07 10:07:00 +00:00
$ { t s h a r k _ F I L E S }
2022-11-17 08:52:28 +00:00
$ { t f s h a r k _ F I L E S }
2009-11-07 10:07:00 +00:00
$ { r a w s h a r k _ F I L E S }
$ { d f t e s t _ F I L E S }
$ { r a n d p k t _ F I L E S }
2015-11-05 17:31:11 +00:00
$ { r a n d p k t d u m p _ F I L E S }
2020-12-02 09:05:11 +00:00
$ { e t w d u m p _ F I L E S }
2022-03-17 20:56:37 +00:00
$ { f a l c o d u m p _ F I L E S }
2016-02-10 14:45:45 +00:00
$ { u d p d u m p _ F I L E S }
2018-02-16 22:51:51 +00:00
$ { t e x t 2 p c a p _ F I L E S }
2009-11-07 10:07:00 +00:00
$ { m e r g e c a p _ F I L E S }
$ { c a p i n f o s _ F I L E S }
2013-12-13 02:59:16 +00:00
$ { c a p t y p e _ F I L E S }
2009-11-07 10:07:00 +00:00
$ { e d i t c a p _ F I L E S }
2017-08-10 17:20:30 +00:00
$ { i d l 2 w r s _ F I L E S }
2018-02-09 01:20:26 +00:00
$ { m m d b r e s o l v e _ F I L E S }
2022-11-19 19:06:30 +00:00
$ { s h a r k d _ F I L E S }
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.
2023-01-13 21:51:04 +00:00
if ( WIN32 )
2019-04-19 11:26:18 +00:00
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 (
$ { C L E A N _ C _ F I L E S }
P R O P E R T I E S
C O M P I L E _ F L A G S " $ { W E R R O R _ C O M M O N _ F L A G S } "
)
endif ( )
2009-11-07 10:07:00 +00:00
2009-09-21 00:19:07 +00:00
install (
F I L E S
$ { I N S T A L L _ F I L E S }
2018-02-11 22:34:04 +00:00
P E R M I S S I O N S
O W N E R _ W R I T E O W N E R _ R E A D
G R O U P _ R E A D
W O R L D _ R E A D
2009-09-21 00:19:07 +00:00
D E S T I N A T I O N
2018-12-03 19:23:35 +00:00
$ { C M A K E _ I N S T A L L _ D A T A D I R }
2009-09-21 00:19:07 +00:00
)
2023-01-19 16:19:46 +00:00
install (
F I L E S
$ { D O C _ F I L E S }
D E S T I N A T I O N
$ { C M A K E _ I N S T A L L _ D O C D I R }
)
2017-09-02 23:42:00 +00:00
set ( SHARK_PUBLIC_HEADERS
c f i l e . h
2018-12-12 10:53:08 +00:00
c l i _ m a i n . h
2017-09-02 23:42:00 +00:00
f i l e . h
2021-11-11 18:09:22 +00:00
i n c l u d e / w s _ a t t r i b u t e s . h
2022-10-17 07:21:40 +00:00
i n c l u d e / w s _ c o d e p o i n t s . h
2021-11-11 18:09:22 +00:00
i n c l u d e / w s _ c o m p i l e r _ t e s t s . h
i n c l u d e / w s _ d i a g _ c o n t r o l . h
2023-02-06 22:16:37 +00:00
i n c l u d e / w s _ e x i t _ c o d e s . h
2021-11-11 18:09:22 +00:00
i n c l u d e / w s _ l o g _ d e f s . h
2021-12-20 02:33:15 +00:00
i n c l u d e / w s _ p o s i x _ c o m p a t . h
2021-11-11 18:09:22 +00:00
i n c l u d e / w s _ s y m b o l _ e x p o r t . h
i n c l u d e / w i r e s h a r k . h
2018-08-21 14:18:56 +00:00
$ { C M A K E _ B I N A R Y _ D I R } / w s _ v e r s i o n . 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
D E S T I N A T I O N $ { P R O J E C T _ I N S T A L L _ I N C L U D E D I R }
2023-01-18 00:46:21 +00:00
C O M P O N E N T " D e v e l o p m e n t "
E X C L U D E _ F R O M _ A L L
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.
2023-01-11 00:10:05 +00:00
if ( BUILD_wireshark AND QT_FOUND AND NOT APPLE AND ( NOT WIN32 OR USE_MSYSTEM ) )
2022-03-12 00:13:17 +00:00
install ( FILES resources/freedesktop/org.wireshark.Wireshark-mime.xml
2018-12-03 19:23:35 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / m i m e / p a c k a g e s "
2020-12-06 14:38:41 +00:00
R E N A M E o r g . w i r e s h a r k . W i r e s h a r k . x m l
2016-11-08 14:20:30 +00:00
)
2022-03-12 00:13:17 +00:00
install ( FILES resources/freedesktop/org.wireshark.Wireshark.metainfo.xml
2020-12-06 14:38:41 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / m e t a i n f o "
2016-11-08 14:20:30 +00:00
)
if ( BUILD_wireshark AND QT_FOUND )
2022-03-12 00:13:17 +00:00
install ( FILES resources/freedesktop/org.wireshark.Wireshark.desktop
2018-12-03 19:23:35 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / a p p l i c a t i o n s " )
2016-11-08 14:20:30 +00:00
endif ( )
foreach ( size 16 24 32 48 64 128 256 )
2022-03-06 22:16:36 +00:00
install ( FILES resources/icons/wsicon ${ size } .png
2018-12-03 19:23:35 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / i c o n s / h i c o l o r / $ { s i z e } x $ { s i z e } / a p p s "
2020-12-06 14:38:41 +00:00
R E N A M E o r g . w i r e s h a r k . W i r e s h a r k . p n g )
2022-03-06 22:16:36 +00:00
install ( FILES resources/icons/WiresharkDoc- ${ size } .png
2018-12-03 19:23:35 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / i c o n s / h i c o l o r / $ { s i z e } x $ { s i z e } / m i m e t y p e s "
2020-12-06 14:38:41 +00:00
R E N A M E o r g . w i r e s h a r k . W i r e s h a r k - m i m e t y p e . p n g )
2016-11-08 14:20:30 +00:00
endforeach ( )
2022-03-06 22:16:36 +00:00
install ( FILES resources/icons/wsicon.svg
2018-12-03 19:23:35 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / i c o n s / h i c o l o r / s c a l a b l e / a p p s "
2020-12-06 14:38:41 +00:00
R E N A M E o r g . w i r e s h a r k . W i r e s h a r k . s v g )
2016-11-08 14:20:30 +00:00
endif ( )
2023-01-17 18:55:18 +00:00
if ( BUILD_logray AND QT_FOUND AND NOT APPLE AND ( NOT WIN32 OR USE_MSYSTEM ) )
install ( FILES resources/freedesktop/org.wireshark.Logray-mime.xml
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / m i m e / p a c k a g e s "
R E N A M E o r g . w i r e s h a r k . L o g r a y . x m l
)
install ( FILES resources/freedesktop/org.wireshark.Logray.metainfo.xml
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / m e t a i n f o "
)
if ( BUILD_wireshark AND QT_FOUND )
install ( FILES resources/freedesktop/org.wireshark.Logray.desktop
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / a p p l i c a t i o n s " )
endif ( )
2023-01-17 22:07:33 +00:00
foreach ( size 16 32 48 64 128 256 )
2023-01-17 18:55:18 +00:00
install ( FILES resources/icons/lricon ${ size } .png
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / i c o n s / h i c o l o r / $ { s i z e } x $ { s i z e } / a p p s "
R E N A M E o r g . w i r e s h a r k . L o g r a y . p n g )
install ( FILES resources/icons/WiresharkDoc- ${ size } .png
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / i c o n s / h i c o l o r / $ { s i z e } x $ { s i z e } / m i m e t y p e s "
R E N A M E o r g . w i r e s h a r k . L o g r a y - m i m e t y p e . p n g )
endforeach ( )
install ( FILES resources/icons/lricon.svg
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A R O O T D I R } / i c o n s / h i c o l o r / s c a l a b l e / a p p s "
R E N A M E o r g . w i r e s h a r k . L o g r a y . s v g )
endif ( )
2014-03-04 13:59:39 +00:00
install (
F I L E S
" $ { C M A K E _ B I N A R Y _ D I R } / w i r e s h a r k . p c "
D E S T I N A T I O N
2014-05-29 12:07:44 +00:00
$ { C M A K E _ I N S T A L L _ L I B D I R } / p k g c o n f i g
2023-01-18 00:46:21 +00:00
C O M P O N E N T
" D e v e l o p m e n t "
E X C L U D E _ F R O M _ A L L
2014-03-04 13:59:39 +00:00
)
2009-09-21 00:19:07 +00:00
install (
D I R E C T O R Y
$ { I N S T A L L _ D I R S }
2018-02-11 22:34:04 +00:00
D E S T I N A T I O N
2018-12-03 19:23:35 +00:00
$ { C M A K E _ I N S T A L L _ D A T A D I R }
2018-02-11 22:34:04 +00:00
F I L E _ P E R M I S S I O N S
O W N E R _ W R I T E O W N E R _ R E A D
G R O U P _ R E A D
W O R L D _ R E A D
2009-09-25 02:50:48 +00:00
D I R E C T O R Y _ P E R M I S S I O N S
O W N E R _ E X E C U T E O W N E R _ W R I T E O W N E R _ R E A D
G R O U P _ E X E C U T E G R O U P _ R E A D
W O R L D _ E X E C U T E W O R L D _ R E A D
2014-02-07 19:14:52 +00:00
P A T T E R N " . g i t " E X C L U D E
2009-09-21 00:19:07 +00:00
P A T T E R N " . s v n " E X C L U D E
P A T T E R N " M a k e f i l e . * " E X C L U D E
)
2012-02-04 14:19:38 +00:00
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT USE_MSYSTEM )
2018-11-23 20:39:51 +00:00
# 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 ( )
2018-08-23 21:03:28 +00:00
include ( CMakePackageConfigHelpers )
configure_package_config_file ( WiresharkConfig.cmake.in
$ { C M A K E _ B I N A R Y _ D I R } / W i r e s h a r k C o n f i g . c m a k e
2018-11-23 20:39:51 +00:00
I N S T A L L _ D E S T I N A T I O N $ { W I R E S H A R K _ I N S T A L L _ C M A K E D I R }
2018-08-23 21:03:28 +00:00
P A T H _ V A R S
C M A K E _ I N S T A L L _ L I B D I R
C M A K E _ I N S T A L L _ I N C L U D E D I R
P L U G I N _ I N S T A L L _ V E R S I O N _ L I B D I R
E X T C A P _ I N S T A L L _ L I B D I R
)
write_basic_package_version_file (
$ { C M A K E _ B I N A R Y _ D I R } / W i r e s h a r k C o n f i g V e r s i o n . c m a k e
C O M P A T I B I L I T Y A n y N e w e r V e r s i o n
)
2018-11-23 20:39:47 +00:00
install (
F I L E S
$ { C M A K E _ B I N A R Y _ D I R } / W i r e s h a r k C o n f i g . c m a k e
$ { C M A K E _ B I N A R Y _ D I R } / W i r e s h a r k C o n f i g V e r s i o n . c m a k e
D E S T I N A T I O N
$ { W I R E S H A R K _ I N S T A L L _ C M A K E D I R }
2023-01-18 00:46:21 +00:00
C O M P O N E N T
" D e v e l o p m e n t "
E X C L U D E _ F R O M _ A L L
2018-11-23 20:39:47 +00:00
)
2018-08-23 21:03:28 +00:00
2018-11-23 20:39:47 +00:00
install ( EXPORT WiresharkTargets
D E S T I N A T I O N $ { W I R E S H A R K _ I N S T A L L _ C M A K E D I R }
2023-01-18 00:46:21 +00:00
C O M P O N E N T " D e v e l o p m e n t "
E X C L U D E _ F R O M _ A L L
2018-11-23 20:39:47 +00:00
)
2018-08-23 21:03:28 +00:00
2023-01-18 10:42:45 +00:00
# This isn't strictly needed but it makes working around debhelper's
# cleverness a lot easier.
add_custom_target ( install-headers
C O M M A N D $ { C M A K E _ C O M M A N D } - D C O M P O N E N T = D e v e l o p m e n t - P c m a k e _ i n s t a l l . c m a k e
)
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
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y w s a r _ h t m l
2018-04-16 21:49:55 +00:00
C O M M A N D $ { D O X Y G E N _ E X E C U T A B L E } d o x y g e n . c f g
)
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT USE_MSYSTEM )
2020-01-07 20:38:21 +00:00
add_custom_target ( wsar_html_perms DEPENDS wsar_html )
else ( )
add_custom_target ( wsar_html_perms
C O M M A N D f i n d w s a r _ h t m l
- t y p e d
- e x e c c h m o d 7 5 5 " { } " +
C O M M A N D f i n d w s a r _ h t m l
- t y p e f
- e x e c c h m o d 6 4 4 " { } " +
D E P E N D S w s a r _ h t m l )
endif ( )
2018-04-16 21:49:55 +00:00
add_custom_target ( wsar_html_zip
C O M M A N D $ { C M A K E _ C O M M A N D } - E t a r " c f v " " w s a r _ h t m l . z i p " - - f o r m a t = z i p w s a r _ h t m l
2020-01-07 20:38:21 +00:00
D E P E N D S w s a r _ h t m l _ p e r m s
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
2021-10-20 22:23:19 +00:00
F O L D E R " D o c u m e n t a t i o n "
2018-04-23 15:31:25 +00:00
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D T r u e
)
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
D E P E N D S e x n t e s t
2018-03-07 19:35:33 +00:00
o i d s _ t e s t
r e a s s e m b l e _ t e s t
t v b t e s t
w m e m _ t e s t
2021-05-11 03:50:41 +00:00
w s c b o r _ t e s t
2022-10-16 10:35:33 +00:00
t e s t _ e p a n
2021-06-21 21:36:45 +00:00
t e s t _ w s u t i l
2018-03-07 19:35:33 +00:00
C O M M E N T " B u i l d i n g u n i t t e s t p r o g r a m s a n d w r a p p e r "
)
set_target_properties ( test-programs PROPERTIES
F O L D E R " T e s t s "
E X C L U D E _ F R O M _ D E F A U L T _ B U I L D T r u e
)
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
s u i t e _ c a p t u r e
s u i t e _ c l o p t s
s u i t e _ d e c r y p t i o n
2023-01-07 19:29:13 +00:00
s u i t e _ d f i l t e r . g r o u p _ b y t e s
2018-06-18 19:01:01 +00:00
s u i t e _ d f i l t e r . g r o u p _ d o u b l e
2023-01-07 19:29:13 +00:00
s u i t e _ d f i l t e r . g r o u p _ e t h e r
2022-04-13 13:07:01 +00:00
s u i t e _ d f i l t e r . g r o u p _ f u n c t i o n
2018-06-18 19:01:01 +00:00
s u i t e _ d f i l t e r . g r o u p _ i n t e g e r
s u i t e _ d f i l t e r . g r o u p _ i p v 4
2023-01-07 19:29:13 +00:00
s u i t e _ d f i l t e r . g r o u p _ i p v 6
2018-06-18 19:01:01 +00:00
s u i t e _ d f i l t e r . g r o u p _ m e m b e r s h i p
s u i t e _ d f i l t e r . g r o u p _ s c a n n e r
2023-01-07 19:29:13 +00:00
s u i t e _ d f i l t e r . g r o u p _ s l i c e
s u i t e _ d f i l t e r . g r o u p _ s t r i n g
2021-10-01 16:44:23 +00:00
s u i t e _ d f i l t e r . g r o u p _ s y n t a x
2023-01-07 19:29:13 +00:00
s u i t e _ d f i l t e r . g r o u p _ t i m e
2018-06-18 19:01:01 +00:00
s u i t e _ d f i l t e r . g r o u p _ t v b
2018-05-05 22:53:54 +00:00
s u i t e _ d i s s e c t i o n
2018-12-25 14:13:40 +00:00
s u i t e _ d i s s e c t o r s . g r o u p _ a s t e r i x
2019-12-10 22:47:17 +00:00
s u i t e _ e x t c a p s
2018-05-05 22:53:54 +00:00
s u i t e _ f i l e f o r m a t s
2018-07-05 23:57:44 +00:00
s u i t e _ f o l l o w
2021-02-22 11:48:46 +00:00
s u i t e _ f o l l o w _ d c c p
2021-06-28 11:58:36 +00:00
s u i t e _ f o l l o w _ m u l t i s t r e a m
2018-05-05 22:53:54 +00:00
s u i t e _ i o
s u i t e _ m e r g e c a p
s u i t e _ n a m e r e s
2023-01-07 19:29:13 +00:00
s u i t e _ n e t p e r f m e t e r
2018-12-15 20:25:40 +00:00
s u i t e _ o u t p u t f o r m a t s
2020-02-13 23:18:14 +00:00
s u i t e _ r e l e a s e
2018-06-18 18:01:31 +00:00
s u i t e _ s h a r k d
2023-01-07 19:29:13 +00:00
s u i t e _ t e x t 2 p c a p
2018-05-05 22:53:54 +00:00
s u i t e _ u n i t t e s t s
s u i t e _ w s l u a
)
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 )
2022-08-25 11:49:09 +00:00
add_test ( build_unittests
" $ { C M A K E _ C O M M A N D } "
- - b u i l d " $ { C M A K E _ B I N A R Y _ D I R } "
- - c o n f i g " $ { C O N F I G } "
- - t a r g e t t e s t - p r o g r a m s
)
set_tests_properties ( build_unittests PROPERTIES FIXTURES_SETUP unittests )
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
N A M E $ { _ g r o u p _ n a m e }
2018-05-21 16:02:26 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E e n v P Y T H O N I O E N C O D I N G = U T F - 8
$ { P Y T H O N _ E X E C U T A B L E } $ { C M A K E _ S O U R C E _ D I R } / t e s t / t e s t . p y
2018-04-27 16:35:37 +00:00
- - v e r b o s e
2021-09-01 16:31:07 +00:00
- - p r o g r a m - p a t h $ < T A R G E T _ F I L E _ D I R : w m e m _ t e s t >
2018-04-03 00:12:23 +00:00
$ { T E S T _ E X T R A _ A R G S }
2018-06-18 19:01:01 +00:00
$ { _ g r o u p _ n a m e }
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 ( )
2022-08-25 11:49:09 +00:00
set_tests_properties ( suite_unittests PROPERTIES FIXTURES_REQUIRED unittests )
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]+)"
" \ n a d d o p t s = $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / t e s t \ \ 1 "
p y t e s t _ i n i " $ { p y t e s t _ i n i } " )
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
g e n - a u t h o r s
2023-01-20 10:51:10 +00:00
C O M M A N D $ { P Y T H O N _ E X E C U T A B L E } t o o l s / g e n e r a t e _ a u t h o r s . p y A U T H O R S
2016-03-27 21:31:36 +00:00
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ S O U R C E _ D I R }
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 )
2021-10-20 22:23:19 +00:00
set_target_properties ( gen-authors PROPERTIES FOLDER "Documentation" )
2015-03-07 01:49:24 +00:00
2023-01-11 00:10:05 +00:00
if ( WIN32 AND NOT USE_MSYSTEM )
2015-09-24 17:42:46 +00:00
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
C O M M A N D $ { P O W E R S H E L L _ C O M M A N D } " $ { _ w i n _ h a r d e n _ f l a g s } " " $ { _ d l l _ o u t p u t _ d i r _ w i n } "
2015-09-24 17:42:46 +00:00
D E P E N D S $ { P R O G L I S T }
C O M M E N T " C h e c k i n g b i n a r i e s f o r s e c u r i t y f e a t u r e s "
)
set_target_properties ( hardening-check PROPERTIES FOLDER "Tests" )
2023-01-11 00:10:05 +00:00
else ( )
2015-09-24 17:42:46 +00:00
find_program ( HARDENING_CHECK_EXECUTABLE hardening-check
D O C " P a t h t o t h e h a r d e n i n g - c h e c k u t i l i t y . "
)
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
C O M M A N D $ { H A R D E N I N G _ C H E C K _ E X E C U T A B L E } $ { _ p r o g _ p a t h s }
D E P E N D S $ { P R O G L I S T }
C O M M E N T " C h e c k i n g b i n a r i e s f o r s e c u r i t y f e a t u r e s "
)
endif ( )
endif ( )
2015-03-13 16:21:01 +00:00
2016-03-11 19:51:39 +00:00
CHECKAPI (
N A M E
m a i n
S W I T C H E S
S O U R C E S
$ { W I R E S H A R K _ S R C }
$ { T S H A R K _ T A P _ S R C }
)
2016-09-26 17:34:04 +00:00
find_program ( SHELLCHECK_EXECUTABLE shellcheck
D O C " P a t h t o t h e s h e l l c h e c k u t i l i t y . "
)
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.
2020-09-20 21:59:13 +00:00
# ChmodBPF uses "shellcheck shell=bash". Not sure which version
# added support for that.
2016-09-26 17:34:04 +00:00
add_custom_command ( TARGET shellcheck POST_BUILD
C O M M A N D s h e l l c h e c k - - e x t e r n a l - s o u r c e s
2022-03-06 22:16:36 +00:00
r e s o u r c e s / s t o c k _ i c o n s / s v g - t o - p n g . s h
2023-01-17 22:07:33 +00:00
p a c k a g i n g / a p p i m a g e / L o g r a y - A p p R u n . i n
2023-01-17 22:07:33 +00:00
p a c k a g i n g / a p p i m a g e / W i r e s h a r k - A p p R u n . i n
2020-09-16 18:47:10 +00:00
" p a c k a g i n g / m a c o s x / C h m o d B P F / r o o t / L i b r a r y / A p p l i c a t i o n S u p p o r t / W i r e s h a r k / C h m o d B P F / C h m o d B P F "
2018-06-06 17:10:07 +00:00
p a c k a g i n g / m a c o s x / o s x - a p p . s h . i n
2019-09-26 17:43:13 +00:00
p a c k a g i n g / m a c o s x / o s x - d m g . s h . i n
2019-01-11 22:34:03 +00:00
p a c k a g i n g / s o u r c e / g i t - e x p o r t - r e l e a s e . s h . i n
2018-06-25 22:39:30 +00:00
t o o l s / d e b i a n - s e t u p . s h
2016-09-26 17:34:04 +00:00
t o o l s / f u z z - t e s t . s h
2018-06-07 22:03:48 +00:00
t o o l s / g e n - b u g n o t e
t o o l s / p r e - c o m m i t
2016-09-26 17:34:04 +00:00
t o o l s / r a n d p k t - t e s t . s h
2018-06-06 19:01:44 +00:00
t o o l s / r e l e a s e - u p d a t e - d e b i a n - s o v e r s i o n s . s h
2016-09-26 17:34:04 +00:00
t o o l s / t e s t - c a p t u r e s . s h
2018-06-07 22:03:48 +00:00
t o o l s / u p d a t e - t x
2016-09-26 17:34:04 +00:00
t o o l s / v a l g r i n d - w i r e s h a r k . s h
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ S O U R C E _ D I R } "
)
endif ( )
2021-08-26 07:42:51 +00:00
# uninstall target
configure_file (
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / c m a k e _ u n i n s t a l l . c m a k e . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e "
I M M E D I A T E @ O N L Y )
add_custom_target ( uninstall
C O M M A N D $ { C M A K E _ C O M M A N D } - P $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e )
2022-08-15 19:05:33 +00:00
# Break on programmer errors when debugging in Visual Studio
if ( MSVC )
get_property ( _targets DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } PROPERTY BUILDSYSTEM_TARGETS )
foreach ( _target ${ _targets } )
set_target_properties ( ${ _target } PROPERTIES VS_DEBUGGER_ENVIRONMENT "G_DEBUG=fatal-criticals" )
endforeach ( )
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:
#