2006-09-05 09:50:45 +00:00
|
|
|
# CMakeLists.txt
|
|
|
|
#
|
|
|
|
# Wireshark - Network traffic analyzer
|
|
|
|
# By Gerald Combs <gerald@wireshark.org>
|
|
|
|
# Copyright 1998 Gerald Combs
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2006-09-05 09:50:45 +00:00
|
|
|
#
|
|
|
|
|
2012-02-02 12:04:22 +00:00
|
|
|
project(Wireshark C CXX)
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2016-09-01 22:09:12 +00:00
|
|
|
# Updated by make-version.pl
|
|
|
|
set(GIT_REVISION 0)
|
|
|
|
set(PROJECT_MAJOR_VERSION 2)
|
2017-06-02 22:39:32 +00:00
|
|
|
set(PROJECT_MINOR_VERSION 5)
|
2016-09-01 22:09:12 +00:00
|
|
|
set(PROJECT_PATCH_VERSION 0)
|
|
|
|
set(PROJECT_BUILD_VERSION ${GIT_REVISION})
|
|
|
|
set(PROJECT_VERSION_EXTENSION "")
|
2017-09-29 18:49:51 +00:00
|
|
|
set(PROJECT_RELEASE_VERSION "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}")
|
2016-09-01 22:09:12 +00:00
|
|
|
|
|
|
|
if(DEFINED ENV{WIRESHARK_VERSION_EXTRA})
|
|
|
|
set(PROJECT_VERSION_EXTENSION "$ENV{WIRESHARK_VERSION_EXTRA}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(PROJECT_VERSION "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}${PROJECT_VERSION_EXTENSION}")
|
|
|
|
|
2017-09-06 10:49:12 +00:00
|
|
|
# packaging information
|
|
|
|
if(WIN32)
|
|
|
|
set(CPACK_PACKAGE_NAME Wireshark)
|
|
|
|
else()
|
|
|
|
set(CPACK_PACKAGE_NAME wireshark)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
|
|
|
|
2015-04-20 15:36:06 +00:00
|
|
|
message(STATUS "Generating build using CMake ${CMAKE_VERSION}")
|
2015-04-16 16:39:51 +00:00
|
|
|
if(WIN32)
|
2017-06-10 14:31:52 +00:00
|
|
|
# Needed for GREATER_EQUAL operator
|
|
|
|
cmake_minimum_required(VERSION 3.7)
|
2015-04-16 16:39:51 +00:00
|
|
|
else()
|
2017-11-30 02:05:07 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8.12)
|
2015-04-16 16:39:51 +00:00
|
|
|
endif()
|
2009-06-16 04:12:30 +00:00
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
#Where to find local cmake scripts
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
|
|
|
|
2017-10-13 21:08:21 +00:00
|
|
|
# Set old behaviour for MACOSX_RPATH (since 3.0)
|
2016-10-29 06:34:17 +00:00
|
|
|
if (POLICY CMP0042)
|
|
|
|
cmake_policy(SET CMP0042 OLD)
|
|
|
|
endif()
|
2015-06-02 21:11:56 +00:00
|
|
|
|
2017-10-13 21:08:21 +00:00
|
|
|
# Set old behaviour for variable quoting (since 3.1)
|
|
|
|
if (POLICY CMP0054)
|
|
|
|
cmake_policy(SET CMP0054 OLD)
|
|
|
|
endif()
|
|
|
|
|
2015-01-09 21:53:17 +00:00
|
|
|
# If our target platform is enforced by our generator, set
|
|
|
|
# WIRESHARK_TARGET_PLATFORM accordingly. Otherwise use
|
|
|
|
# %WIRESHARK_TARGET_PLATFORM%.
|
2015-04-02 19:10:36 +00:00
|
|
|
|
2015-01-09 21:53:17 +00:00
|
|
|
if(WIN32)
|
2015-04-07 21:05:52 +00:00
|
|
|
find_package(PowerShell REQUIRED)
|
|
|
|
|
2015-10-28 23:52:41 +00:00
|
|
|
if(${CMAKE_CL_64} OR "${CMAKE_GENERATOR}" MATCHES "Win64")
|
2015-01-09 21:53:17 +00:00
|
|
|
set(WIRESHARK_TARGET_PLATFORM win64)
|
2015-04-09 00:36:35 +00:00
|
|
|
elseif("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
2015-01-09 21:53:17 +00:00
|
|
|
set(WIRESHARK_TARGET_PLATFORM win32)
|
|
|
|
else()
|
|
|
|
set(WIRESHARK_TARGET_PLATFORM $ENV{WIRESHARK_TARGET_PLATFORM})
|
|
|
|
endif()
|
2015-04-09 00:36:35 +00:00
|
|
|
|
2015-04-30 18:35:57 +00:00
|
|
|
if ("${WIRESHARK_TARGET_PLATFORM}" MATCHES "win64")
|
|
|
|
set(PROCESSOR_ARCHITECTURE amd64)
|
|
|
|
else()
|
|
|
|
set(PROCESSOR_ARCHITECTURE x86)
|
|
|
|
endif()
|
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
# Sanity check
|
2015-04-09 00:36:35 +00:00
|
|
|
if(DEFINED ENV{PLATFORM})
|
|
|
|
string(TOLOWER $ENV{PLATFORM} _vs_platform)
|
|
|
|
else()
|
|
|
|
set(_vs_platform "[undefined]") # x86
|
|
|
|
endif()
|
|
|
|
if(
|
|
|
|
(_vs_platform STREQUAL "x64" AND NOT WIRESHARK_TARGET_PLATFORM STREQUAL "win64")
|
|
|
|
OR
|
|
|
|
(_vs_platform STREQUAL "[undefined]" AND NOT WIRESHARK_TARGET_PLATFORM STREQUAL "win32")
|
|
|
|
)
|
|
|
|
message(FATAL_ERROR "The PLATFORM environment variable (${_vs_platform})"
|
|
|
|
" doesn't match the generator platform (${WIRESHARK_TARGET_PLATFORM})")
|
|
|
|
endif()
|
2015-04-20 15:36:06 +00:00
|
|
|
message(STATUS "Building for ${WIRESHARK_TARGET_PLATFORM} using ${CMAKE_GENERATOR}")
|
2015-01-09 21:53:17 +00:00
|
|
|
|
2015-11-16 14:02:16 +00:00
|
|
|
# Determine where the 3rd party libraries will be
|
2015-04-30 14:00:29 +00:00
|
|
|
if( DEFINED ENV{WIRESHARK_LIB_DIR} )
|
|
|
|
# The buildbots set WIRESHARK_LIB_DIR but not WIRESHARK_BASE_DIR.
|
|
|
|
file( TO_CMAKE_PATH "$ENV{WIRESHARK_LIB_DIR}" _PROJECT_LIB_DIR )
|
|
|
|
elseif( DEFINED ENV{WIRESHARK_BASE_DIR} )
|
|
|
|
file( TO_CMAKE_PATH "$ENV{WIRESHARK_BASE_DIR}" _WS_BASE_DIR )
|
|
|
|
set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${WIRESHARK_TARGET_PLATFORM}-libs" )
|
2015-11-16 14:02:16 +00:00
|
|
|
else()
|
|
|
|
# Don't know what to do
|
|
|
|
message(FATAL_ERROR "Neither WIRESHARK_BASE_DIR or WIRESHARK_LIB_DIR are defined")
|
2015-04-30 14:00:29 +00:00
|
|
|
endif()
|
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
# Download third-party libraries
|
|
|
|
file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/tools/win-setup.ps1 _win_setup)
|
2015-04-30 14:00:29 +00:00
|
|
|
file (TO_NATIVE_PATH ${_PROJECT_LIB_DIR} _ws_lib_dir)
|
2015-05-29 08:33:58 +00:00
|
|
|
if(MSVC14)
|
|
|
|
set(_vsversion_args "14")
|
|
|
|
elseif(MSVC12)
|
2015-04-23 11:15:02 +00:00
|
|
|
set(_vsversion_args "12")
|
2015-04-07 21:05:52 +00:00
|
|
|
elseif(MSVC11)
|
2015-04-23 11:15:02 +00:00
|
|
|
set(_vsversion_args "11")
|
2015-04-07 21:05:52 +00:00
|
|
|
elseif(MSVC10)
|
2015-04-23 11:15:02 +00:00
|
|
|
set(_vsversion_args "10")
|
2015-04-30 14:00:29 +00:00
|
|
|
else()
|
2015-11-16 14:02:16 +00:00
|
|
|
message(FATAL_ERROR "Unsupported compiler ${CMAKE_C_COMPILER}")
|
2015-04-07 21:05:52 +00:00
|
|
|
endif()
|
2015-04-20 15:36:06 +00:00
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
# Is it possible to have a one-time, non-cached option in CMake? If
|
|
|
|
# so, we could add a "-DFORCE_WIN_SETUP" which passes -Force to
|
|
|
|
# win-setup.ps1.
|
|
|
|
execute_process(
|
2015-11-22 19:15:43 +00:00
|
|
|
COMMAND ${POWERSHELL_COMMAND} "\"${_win_setup}\"" -Destination "${_ws_lib_dir}" -Platform ${WIRESHARK_TARGET_PLATFORM} -VSVersion ${_vsversion_args}
|
2015-04-07 21:05:52 +00:00
|
|
|
RESULT_VARIABLE _win_setup_failed
|
|
|
|
)
|
|
|
|
if (${_win_setup_failed})
|
|
|
|
message(FATAL_ERROR "Windows setup (win-setup.ps1) failed.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# XXX Add a dependency on ${_ws_lib_dir}/current_tag.txt?
|
2015-10-15 21:45:45 +00:00
|
|
|
|
|
|
|
# Head off any attempts to use Cygwin's Python.
|
|
|
|
include(LocatePythonExecutable)
|
2015-04-07 21:05:52 +00:00
|
|
|
endif(WIN32)
|
2014-06-21 09:10:38 +00:00
|
|
|
|
2014-09-18 06:05:48 +00:00
|
|
|
include(UseCustomIncludes)
|
2016-06-14 15:37:33 +00:00
|
|
|
ADD_CUSTOM_CMAKE_INCLUDE()
|
2014-09-18 06:05:48 +00:00
|
|
|
|
2013-11-04 20:29:29 +00:00
|
|
|
# This cannot be implemented via option(...)
|
|
|
|
if( NOT CMAKE_BUILD_TYPE )
|
2013-11-17 14:03:58 +00:00
|
|
|
set( CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
FORCE)
|
2013-11-04 20:29:29 +00:00
|
|
|
endif()
|
|
|
|
message(STATUS "Configuration types: ${CMAKE_CONFIGURATION_TYPES}")
|
2015-11-25 10:59:37 +00:00
|
|
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type)
|
|
|
|
message(STATUS "CMAKE_C_FLAGS_${_build_type}: ${CMAKE_C_FLAGS_${_build_type}}")
|
|
|
|
message(STATUS "CMAKE_CXX_FLAGS_${_build_type}: ${CMAKE_CXX_FLAGS_${_build_type}}")
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2017-10-14 19:13:52 +00:00
|
|
|
# Ensure that all executables and libraries end up in the same directory. Actual
|
|
|
|
# files might end up in a configuration subdirectory, e.g. run/Debug or
|
|
|
|
# run/Release. We try to set DATAFILE_DIR to actual location below.
|
2014-06-21 09:10:38 +00:00
|
|
|
if(NOT ARCHIVE_OUTPUT_PATH)
|
|
|
|
set(ARCHIVE_OUTPUT_PATH ${Wireshark_BINARY_DIR}/run CACHE INTERNAL
|
|
|
|
"Single output directory for building all archives.")
|
|
|
|
endif()
|
|
|
|
if(NOT EXECUTABLE_OUTPUT_PATH)
|
|
|
|
set(EXECUTABLE_OUTPUT_PATH ${Wireshark_BINARY_DIR}/run CACHE INTERNAL
|
|
|
|
"Single output directory for building all executables.")
|
|
|
|
endif()
|
|
|
|
if(NOT LIBRARY_OUTPUT_PATH)
|
|
|
|
set(LIBRARY_OUTPUT_PATH ${Wireshark_BINARY_DIR}/run CACHE INTERNAL
|
|
|
|
"Single output directory for building all libraries.")
|
|
|
|
endif()
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2017-08-17 21:38:54 +00:00
|
|
|
#
|
|
|
|
# The release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG for
|
|
|
|
# the Unix Makefile generator.
|
|
|
|
#
|
|
|
|
|
2014-06-21 09:10:38 +00:00
|
|
|
#Defines CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_DATADIR, etc ...
|
2017-09-03 15:22:17 +00:00
|
|
|
include(GNUInstallDirs)
|
2017-08-10 16:35:21 +00:00
|
|
|
# Make sure our executables can can load our libraries if we install into
|
2017-08-17 21:38:54 +00:00
|
|
|
# a non-default directory on Unix-like systems other than macOS.
|
2017-08-10 16:35:21 +00:00
|
|
|
# https://cmake.org/Wiki/CMake_RPATH_handling
|
2017-08-13 11:41:55 +00:00
|
|
|
if(NOT CMAKE_INSTALL_RPATH AND NOT (WIN32 OR APPLE))
|
2017-09-11 14:14:01 +00:00
|
|
|
LIST(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" IS_SYSTEM_DIR)
|
2017-08-10 16:35:21 +00:00
|
|
|
if("${IS_SYSTEM_DIR}" STREQUAL "-1")
|
2017-09-11 14:14:01 +00:00
|
|
|
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
2017-08-10 16:35:21 +00:00
|
|
|
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
endif("${IS_SYSTEM_DIR}" STREQUAL "-1")
|
|
|
|
endif()
|
2013-11-04 20:29:29 +00:00
|
|
|
|
2015-02-10 21:48:48 +00:00
|
|
|
# Banner shown at top right of Qt welcome screen.
|
|
|
|
if(DEFINED ENV{WIRESHARK_VERSION_FLAVOR})
|
|
|
|
set(VERSION_FLAVOR "$ENV{WIRESHARK_VERSION_FLAVOR}")
|
|
|
|
else()
|
|
|
|
set(VERSION_FLAVOR "Development Build")
|
|
|
|
endif()
|
|
|
|
|
2015-01-10 21:29:57 +00:00
|
|
|
# These are required in .rc files and manifests
|
|
|
|
set(VERSION_MAJOR ${PROJECT_MAJOR_VERSION})
|
|
|
|
set(VERSION_MINOR ${PROJECT_MINOR_VERSION})
|
|
|
|
set(VERSION_MICRO ${PROJECT_PATCH_VERSION})
|
2015-01-06 23:07:50 +00:00
|
|
|
set(VERSION_BUILD ${PROJECT_BUILD_VERSION})
|
|
|
|
set(RC_VERSION ${PROJECT_MAJOR_VERSION},${PROJECT_MINOR_VERSION},${PROJECT_PATCH_VERSION},${PROJECT_BUILD_VERSION})
|
2015-01-10 21:29:57 +00:00
|
|
|
|
2010-03-07 19:40:25 +00:00
|
|
|
message(STATUS "V: ${PROJECT_VERSION}, MaV: ${PROJECT_MAJOR_VERSION}, MiV: ${PROJECT_MINOR_VERSION}, PL: ${PROJECT_PATCH_VERSION}, EV: ${PROJECT_VERSION_EXTENSION}.")
|
|
|
|
|
2013-12-01 21:55:21 +00:00
|
|
|
include(UseLemon)
|
2017-11-20 19:58:46 +00:00
|
|
|
include(UseMakePluginReg)
|
2017-12-10 17:29:40 +00:00
|
|
|
include(UseMakeTaps)
|
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
|
|
|
|
if (${CMAKE_EXTRA_GENERATOR} MATCHES "Eclipse CDT4" )
|
|
|
|
SET(CXX_ENABLED 0)
|
|
|
|
LIST(LENGTH CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS LIST_LEN)
|
|
|
|
if ( ${LIST_LEN} GREATER 0 )
|
|
|
|
SET(CXX_ENABLED 1)
|
|
|
|
endif()
|
|
|
|
SET(C_ENABLED 0)
|
|
|
|
LIST(LENGTH CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS LIST_LEN)
|
|
|
|
if ( ${LIST_LEN} GREATER 0)
|
|
|
|
SET(C_ENABLED 1)
|
|
|
|
endif()
|
|
|
|
if (${C_ENABLED} EQUAL 1 AND ${CXX_ENABLED} EQUAL 1)
|
|
|
|
# Combined project (C and CXX). This will confuse the indexer. For that reason
|
|
|
|
# we unsert set the __cplusplus variable for the indexer
|
|
|
|
list(FIND CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "__cplusplus" GEN_MACRO_INDEX)
|
|
|
|
if( ${GEN_MACRO_INDEX} GREATER -1 )
|
|
|
|
list(REMOVE_AT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${GEN_MACRO_INDEX})
|
|
|
|
list(REMOVE_AT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${GEN_MACRO_INDEX})
|
|
|
|
endif()
|
|
|
|
SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS} CACHE INTERNAL "")
|
|
|
|
elseif ( (${CXX_ENABLED} EQUAL 1) AND (${CMAKE_CXX_FLAGS} MATCHES ".*-std=c\\+\\+11.*"))
|
|
|
|
#add_definitions (-D__cplusplus=201103L)
|
|
|
|
# CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS
|
|
|
|
list(FIND CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "199711L" GEN_MACRO_INDEX)
|
|
|
|
if( ${GEN_MACRO_INDEX} GREATER -1 )
|
|
|
|
list(REMOVE_AT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${GEN_MACRO_INDEX})
|
|
|
|
list(INSERT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${GEN_MACRO_INDEX} "201103L")
|
|
|
|
SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS ${CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS} CACHE INTERNAL "")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2006-10-26 15:36:50 +00:00
|
|
|
include_directories(
|
2009-09-02 16:33:01 +00:00
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}
|
2006-10-26 15:36:50 +00:00
|
|
|
)
|
2006-09-05 09:27:22 +00:00
|
|
|
|
2014-01-19 00:48:22 +00:00
|
|
|
include( CMakeOptions.txt )
|
|
|
|
if( DUMPCAP_INSTALL_OPTION STREQUAL "suid" )
|
|
|
|
set( DUMPCAP_SETUID "SETUID" )
|
|
|
|
else()
|
|
|
|
set( DUMPCAP_SETUID )
|
|
|
|
endif()
|
|
|
|
if( NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
|
|
|
DUMPCAP_INSTALL_OPTION STREQUAL "capabilities" )
|
|
|
|
message( WARNING "Capabilities are only supported on Linux" )
|
|
|
|
set( DUMPCAP_INSTALL_OPTION )
|
|
|
|
endif()
|
2017-08-27 13:39:50 +00:00
|
|
|
|
|
|
|
if(APPLE AND EXISTS /usr/local/opt/qt5)
|
|
|
|
# Homebrew installs Qt5 (up to at least 5.9.1) in
|
|
|
|
# /usr/local/qt5, ensure it can be found by CMake since
|
|
|
|
# it is not in the default /usr/local prefix.
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
|
|
|
|
endif()
|
2009-09-09 13:20:33 +00:00
|
|
|
|
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.
|
|
|
|
# -pie is added below for non-MSVC.
|
2015-10-21 14:52:47 +00:00
|
|
|
# Needed when either:
|
|
|
|
# - Qt5_POSITION_INDEPENDENT_CODE is set and CMake < 2.8.11
|
|
|
|
# - PIE is wanted (-pie) and you want to add -fPIC/-fPIE automatically.
|
|
|
|
# This option only has an effect on CMake >= 2.8.9
|
2015-10-09 21:43:02 +00:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2013-09-23 21:45:55 +00:00
|
|
|
if( CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
2013-11-29 21:07:23 +00:00
|
|
|
if (MSVC10)
|
|
|
|
set(MSC_VER_REQUIRED 1600)
|
|
|
|
elseif(MSVC11)
|
|
|
|
set(MSC_VER_REQUIRED 1700)
|
|
|
|
elseif(MSVC12)
|
|
|
|
set(MSC_VER_REQUIRED 1800)
|
2015-05-29 08:33:58 +00:00
|
|
|
elseif(MSVC14)
|
|
|
|
set(MSC_VER_REQUIRED 1900)
|
2013-11-29 21:07:23 +00:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "You are using an unsupported version of MSVC")
|
|
|
|
endif()
|
2015-06-15 12:14:01 +00:00
|
|
|
|
|
|
|
add_definitions(
|
2013-11-17 14:03:58 +00:00
|
|
|
/DWIN32_LEAN_AND_MEAN
|
|
|
|
"/DMSC_VER_REQUIRED=${MSC_VER_REQUIRED}"
|
|
|
|
/D_CRT_SECURE_NO_DEPRECATE
|
|
|
|
# NOMINMAX keeps windows.h from defining "min" and "max" via windef.h.
|
|
|
|
# This avoids conflicts with the C++ standard library.
|
|
|
|
/DNOMINMAX
|
2014-06-20 21:59:29 +00:00
|
|
|
# -DPSAPI_VERSION=1 Programs that must run on earlier versions of Windows as well as Windows 7 and later
|
|
|
|
# versions should always call this function as GetProcessMemoryInfo. To ensure correct
|
|
|
|
# resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program
|
|
|
|
# with -DPSAPI_VERSION=1.To use run-time dynamic linking, load Psapi.dll.
|
|
|
|
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms683219(v=vs.85).aspx
|
|
|
|
# -DBUILD_WINDOWS Starting from VS2013, GetVersionEx is deprecated and we are recommended to use
|
|
|
|
# VerifyVersionInfo instead
|
|
|
|
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms724429(v=vs.85).aspx
|
|
|
|
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms725491(v=vs.85).aspx
|
|
|
|
# To continue to use GetVersionEx, we can define BUILD_WINDOWS
|
|
|
|
# -D_ALLOW_KEYWORD_MACROS For VS2012 onwards the, C++ STL does not permit macro redefinitions of keywords
|
|
|
|
# (see http://msdn.microsoft.com/en-us/library/bb531344(v=vs.110).aspx)
|
|
|
|
# This definition prevents the complaint about the redefinition of inline by WinPCap
|
2016-02-10 12:52:58 +00:00
|
|
|
# in pcap-stdinc.h when compiling C++ files, e.g. the Qt UI
|
2014-06-20 21:59:29 +00:00
|
|
|
/DPSAPI_VERSION=1
|
|
|
|
/DBUILD_WINDOWS
|
|
|
|
/D_ALLOW_KEYWORD_MACROS
|
2013-11-17 14:03:58 +00:00
|
|
|
)
|
|
|
|
|
2015-06-15 12:14:01 +00:00
|
|
|
if(NOT "${WIRESHARK_TARGET_PLATFORM}" STREQUAL "win64")
|
|
|
|
add_definitions("/D_BIND_TO_CURRENT_CRT_VERSION=1")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# FIXME: WINPCAP_VERSION cannot be determined from source or executable.
|
2015-11-11 09:05:02 +00:00
|
|
|
set(WINPCAP_VERSION "4_1_3")
|
2015-06-15 12:14:01 +00:00
|
|
|
add_definitions("/DWINPCAP_VERSION=${WINPCAP_VERSION}")
|
|
|
|
|
|
|
|
set(LOCAL_CFLAGS
|
|
|
|
/MP
|
|
|
|
)
|
|
|
|
|
2018-01-16 21:56:58 +00:00
|
|
|
set(WS_LINK_FLAGS "/LARGEADDRESSAWARE /MANIFEST:NO /INCREMENTAL:NO /RELEASE")
|
|
|
|
|
2014-09-27 08:37:11 +00:00
|
|
|
if(MSVC12)
|
2015-06-15 12:14:01 +00:00
|
|
|
# /Zo Enhanced debugging of optimised code for VS2013 Update 3 and beyond,
|
2014-09-27 08:37:11 +00:00
|
|
|
# Assume all VS2013 builds are at least Update 3.
|
|
|
|
# See http://msdn.microsoft.com/en-us/library/dn785163.aspx
|
2018-01-16 21:56:58 +00:00
|
|
|
set(LOCAL_CFLAGS ${LOCAL_CFLAGS} /Zo)
|
2015-05-29 08:33:58 +00:00
|
|
|
elseif(MSVC14)
|
2015-09-02 19:03:39 +00:00
|
|
|
# /Zo Enhanced debugging of optimised code
|
2016-06-10 22:26:57 +00:00
|
|
|
# /utf-8 Set Source and Executable character sets to UTF-8
|
2015-09-02 19:03:39 +00:00
|
|
|
# VS2015(MSVC14): On by default when /Zi or /Z7 used.
|
2018-01-16 21:56:58 +00:00
|
|
|
# /guard:cf Control Flow Guard (compile and link).
|
|
|
|
# See https://msdn.microsoft.com/en-us/library/windows/desktop/mt637065.aspx
|
2018-02-01 23:16:10 +00:00
|
|
|
# Note: This requires CMake 3.9.0 or newer.
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/commit/f973d49ab9d4c59b93f6dac812a94bb130200836
|
2018-01-16 21:56:58 +00:00
|
|
|
# /Qspectre Speculative execution attack mitigation
|
|
|
|
# See https://blogs.msdn.microsoft.com/vcblog/2018/01/15/spectre-mitigations-in-msvc/
|
|
|
|
set(LOCAL_CFLAGS ${LOCAL_CFLAGS} /Zo /utf-8 /guard:cf /Qspectre)
|
|
|
|
set(WS_LINK_FLAGS "${WS_LINK_FLAGS} /guard:cf")
|
2014-09-27 08:37:11 +00:00
|
|
|
endif()
|
|
|
|
|
2015-01-06 18:44:37 +00:00
|
|
|
if(ENABLE_CODE_ANALYSIS)
|
2018-01-16 21:56:58 +00:00
|
|
|
set(LOCAL_CFLAGS ${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"
|
|
|
|
# when compiling Wireshark sources. (Selected from "level 4" warnings).
|
|
|
|
## 4295: array is too small to include a terminating null character
|
2014-08-20 12:31:19 +00:00
|
|
|
## 4189: local variable is initialized but not referenced
|
2016-08-31 13:58:20 +00:00
|
|
|
# Disable warnings about about use of flexible array members:
|
|
|
|
## 4200: nonstandard extension used : zero-sized array in struct/union
|
2018-01-16 21:56:58 +00:00
|
|
|
set(WARNINGS_CFLAGS /w34295 /w34189 /wd4200)
|
2013-11-17 14:03:58 +00:00
|
|
|
|
2014-06-13 15:14:25 +00:00
|
|
|
set(WIRESHARK_COMMON_FLAGS
|
2013-11-17 14:03:58 +00:00
|
|
|
${LOCAL_CFLAGS}
|
|
|
|
${WARNINGS_CFLAGS}
|
|
|
|
)
|
2014-11-18 15:59:44 +00:00
|
|
|
|
2018-01-16 21:56:58 +00:00
|
|
|
else() # ! MSVC
|
2014-08-04 06:39:05 +00:00
|
|
|
if(CMAKE_OSX_DEPLOYMENT_TARGET)
|
2014-08-03 20:07:46 +00:00
|
|
|
if(APPLE)
|
2014-08-04 06:39:05 +00:00
|
|
|
if(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.0")
|
2017-04-05 19:15:27 +00:00
|
|
|
message(FATAL_ERROR "We don't support building for Mac OS X 10.0")
|
2014-08-04 06:39:05 +00:00
|
|
|
elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.1")
|
2017-04-05 19:15:27 +00:00
|
|
|
message(FATAL_ERROR "We don't support building for Mac OS X 10.1")
|
2014-08-04 06:39:05 +00:00
|
|
|
elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.2")
|
2017-04-05 19:15:27 +00:00
|
|
|
message(FATAL_ERROR "We don't support building for Mac OS X 10.2")
|
2014-08-04 06:39:05 +00:00
|
|
|
elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.4" OR ${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.5")
|
2014-08-03 20:07:46 +00:00
|
|
|
#
|
|
|
|
# Only 32-bit builds are supported. 10.5
|
|
|
|
# (and 10.4?) had a bug that causes some BPF
|
|
|
|
# functions not to work with 64-bit userland
|
2015-01-15 11:45:02 +00:00
|
|
|
# code, so capturing won't work.
|
2014-08-03 20:07:46 +00:00
|
|
|
#
|
|
|
|
set(CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
|
|
|
|
set(WS_LINK_FLAGS "-m32 ${WS_LINK_FLAGS}")
|
|
|
|
endif()
|
2017-04-05 19:15:27 +00:00
|
|
|
message(STATUS "Building for Mac OS X/OS X/macOS ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
2014-08-03 20:07:46 +00:00
|
|
|
else()
|
2017-04-05 19:15:27 +00:00
|
|
|
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET only applies when building for macOS")
|
2014-08-03 20:07:46 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-08-31 13:58:20 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS "3.1")
|
|
|
|
# Many modern compilers use c99 by default, but for older ones
|
|
|
|
# (like GCC 4.4.7), -std=gnu99 is required to avoid errors about
|
|
|
|
# use constructs like "for (int i = 0; i < n; i++) ;"
|
2016-09-07 03:51:23 +00:00
|
|
|
#
|
|
|
|
# Older versions of IBM XL C may require -qlanglvl=extc99.
|
|
|
|
# With V7.0, the "xlc" command defaults to C89; with 10.1,
|
|
|
|
# it defaults to C99 (both with IBM syntax extensions).
|
|
|
|
#
|
|
|
|
# HP's manual for HP C/HP-UX B.11.11.04 (the tenth
|
|
|
|
# edition of the manual), for PA-RISC, "documents
|
|
|
|
# new HP C features that support C99 industry standards".
|
|
|
|
# The manual for Version A.06.25 for Itanium mentions an
|
|
|
|
# -AC99 flag to support C99, but says it's the default;
|
|
|
|
# some older versions might require -AC99.
|
|
|
|
#
|
|
|
|
# As of Sun Studio 8, the compiler appears to default
|
|
|
|
# to supporting some C99 language features, but not
|
|
|
|
# C99 library differences from C89; -xc99 will give
|
|
|
|
# you both. The earlier Sun Forte Developer 6 update 2
|
|
|
|
# might or might not support thosee C99 language features
|
|
|
|
# by default, and doesn't speak of library differences;
|
|
|
|
# if it doesn't support the language features by default,
|
|
|
|
# -xc99 will support them.
|
|
|
|
#
|
2016-08-31 13:58:20 +00:00
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
|
|
|
set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
|
|
|
|
endif()
|
|
|
|
else()
|
2016-09-07 03:51:23 +00:00
|
|
|
#
|
|
|
|
# Current versions of CMake do not support options to
|
|
|
|
# request C99 for XL C, HP C, or Oracle C. (They may
|
|
|
|
# not be necessary for current versions.)
|
|
|
|
#
|
2016-08-31 13:58:20 +00:00
|
|
|
set(CMAKE_C_STANDARD 99)
|
|
|
|
endif()
|
|
|
|
|
2016-08-16 21:21:59 +00:00
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
|
|
|
|
# avoid "argument unused during compilation" warnings
|
|
|
|
# (for example, when getting the -gsplit-dwarf option or
|
|
|
|
# when combining -fwrapv with -fno-strict-overflow)
|
|
|
|
-Qunused-arguments
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(WIRESHARK_COMMON_FLAGS ${WIRESHARK_COMMON_FLAGS}
|
|
|
|
-fexcess-precision=fast
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(COMMON_WARN_FLAGS
|
2014-08-02 23:26:50 +00:00
|
|
|
# The following are for C and C++
|
2013-11-17 14:03:58 +00:00
|
|
|
# -O<X> and -g get set by the CMAKE_BUILD_TYPE
|
|
|
|
-Wall
|
|
|
|
-Wextra
|
|
|
|
-Wendif-labels
|
|
|
|
-Wpointer-arith
|
|
|
|
-Wformat-security
|
2014-08-03 00:46:32 +00:00
|
|
|
-fwrapv
|
|
|
|
-fno-strict-overflow
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wvla
|
|
|
|
-Waddress
|
|
|
|
-Wattributes
|
|
|
|
-Wdiv-by-zero
|
|
|
|
-Wignored-qualifiers
|
2014-04-20 22:44:53 +00:00
|
|
|
-Wpragmas
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wno-overlength-strings
|
|
|
|
-Wno-long-long
|
2014-04-20 22:44:53 +00:00
|
|
|
-Wheader-guard
|
2017-07-31 08:43:58 +00:00
|
|
|
)
|
2017-08-06 22:49:13 +00:00
|
|
|
|
2017-08-07 00:34:52 +00:00
|
|
|
#
|
|
|
|
# Code that may be worth looking into (coding practices)
|
|
|
|
#
|
2017-11-20 20:44:17 +00:00
|
|
|
if((NOT ENABLE_ASAN) AND (NOT ENABLE_TSAN) AND (NOT ENABLE_UBSAN) AND (NOT DISABLE_FRAME_LARGER_THAN_WARNING))
|
2017-08-06 22:49:13 +00:00
|
|
|
#
|
2017-11-20 20:44:17 +00:00
|
|
|
# Only do this if none of ASan, TSan, and UBSan are
|
2017-08-07 00:34:52 +00:00
|
|
|
# enabled; the instrumentation they add increases
|
|
|
|
# the stack usage - we only care about stack
|
|
|
|
# usage in normal operation.
|
2017-08-06 22:49:13 +00:00
|
|
|
#
|
|
|
|
set(COMMON_WARN_FLAGS ${COMMON_WARN_FLAGS}
|
|
|
|
-Wframe-larger-than=16384
|
|
|
|
)
|
|
|
|
endif()
|
2013-11-17 14:03:58 +00:00
|
|
|
|
2016-08-16 21:21:59 +00:00
|
|
|
set(C_WARN_FLAGS
|
2013-11-17 14:03:58 +00:00
|
|
|
# The following are C only, not C++
|
|
|
|
-Wc++-compat
|
2017-08-07 00:58:00 +00:00
|
|
|
-Wunused-const-variable
|
|
|
|
#
|
|
|
|
# XXX - some versions of GCC, including the one in at
|
|
|
|
# least some Xcode versions that come with Mac OS X
|
|
|
|
# 10.5, complain about variables in function and
|
|
|
|
# function pointer *declarations* shadowing other
|
|
|
|
# variables. The autoconf script checks for that; we
|
|
|
|
# don't.
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wshadow
|
|
|
|
-Wno-pointer-sign
|
|
|
|
-Wold-style-definition
|
|
|
|
-Wstrict-prototypes
|
2017-08-07 00:58:00 +00:00
|
|
|
#
|
|
|
|
# Some versions of GCC, such as 4.3.2 and 4.4.5,
|
|
|
|
# generate logical-op warnings when strchr() is given a
|
|
|
|
# constant string. The autoconf script checks for that;
|
|
|
|
# we don't.
|
|
|
|
#
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wlogical-op
|
|
|
|
-Wjump-misses-init
|
2017-08-07 00:58:00 +00:00
|
|
|
#
|
|
|
|
# The Qt headers generate a ton of shortening warnings
|
|
|
|
# on 64-bit systems, so we only enable this for C for
|
|
|
|
# now.
|
|
|
|
#
|
2014-01-03 00:14:46 +00:00
|
|
|
-Wshorten-64-to-32
|
2016-12-17 22:12:11 +00:00
|
|
|
#
|
|
|
|
# Implicit function declarations are an error in C++ and most
|
|
|
|
# likely a programming error in C. Turn -Wimplicit-int and
|
|
|
|
# -Wimplicit-function-declaration into an error by default.
|
|
|
|
#
|
|
|
|
-Werror=implicit
|
2017-12-12 08:18:57 +00:00
|
|
|
#
|
|
|
|
# The Qt headers in version 5.10 introduced a lot of
|
|
|
|
# "Possible misuse of comma operator here" warnings.
|
|
|
|
#
|
|
|
|
-Wcomma
|
2013-11-17 14:03:58 +00:00
|
|
|
)
|
|
|
|
|
2016-08-16 21:21:59 +00:00
|
|
|
set(CXX_WARN_FLAGS
|
2014-01-07 23:08:42 +00:00
|
|
|
)
|
|
|
|
|
2017-05-31 13:45:59 +00:00
|
|
|
find_package(Qt5Core) # Needed to check for Qt version
|
|
|
|
if (Qt5Core_VERSION VERSION_GREATER 5.8)
|
|
|
|
# The Qt headers in version 5.8 and older generate a ton of shortening
|
|
|
|
# errors on 64-bit systems so only enable this for version 5.9 and greater.
|
|
|
|
set(CXX_WARN_FLAGS ${CXX_WARN_FLAGS}
|
|
|
|
-Wshorten-64-to-32
|
|
|
|
)
|
|
|
|
endif()
|
2017-12-12 08:18:57 +00:00
|
|
|
if (Qt5Core_VERSION VERSION_LESS 5.10)
|
|
|
|
# The Qt headers in version 5.10 introduced a lot of
|
|
|
|
# "Possible misuse of comma operator here" warnings.
|
|
|
|
set(CXX_WARN_FLAGS ${CXX_WARN_FLAGS}
|
|
|
|
-Wcomma
|
|
|
|
)
|
|
|
|
endif()
|
2017-05-31 13:45:59 +00:00
|
|
|
|
2017-08-07 00:58:00 +00:00
|
|
|
#
|
|
|
|
# These are not enabled by default, because the warnings they
|
|
|
|
# produce are very hard or impossible to eliminate.
|
|
|
|
#
|
2016-08-16 21:21:59 +00:00
|
|
|
set(COMMON_EXTRA_WARN_FLAGS
|
2014-08-02 23:26:50 +00:00
|
|
|
# The following are for C and C++
|
2015-02-14 21:36:45 +00:00
|
|
|
-Wpedantic
|
2015-12-14 22:26:29 +00:00
|
|
|
#
|
|
|
|
# As we use variadic macros, we don't want warnings
|
|
|
|
# about them, even with -Wpedantic.
|
|
|
|
#
|
2015-10-04 14:27:02 +00:00
|
|
|
-Wno-variadic-macros
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
|
|
|
# Various code blocks this one.
|
|
|
|
#
|
Get rid of debugging output, and get CMake to produce verbose makefiles.
On the 32-bit OS X buildbot, automake is old enough that autotools
builds are verbose, printing the command line for each compile step; if
we cause CMake to produce verbose makefiles, they will also print the
command line, so we can see what differences there are.
This means the other debugging output we added isn't necessary; remove
it.
Sort the extra warning options in configure.ac based on whether they're
for C and C++ or just C, just as is the case in CMake, to make it easier
to keep the lists in sync; add comments to configure.ac to mirror the
ones in CMakeLists.txt.
Get rid of -Wno-deprecated-declarations; the CMake build doesn't use it,
and it doesn't appear to be necessary - if we ever have problems with OS
X complaining about using OpenSSL, for example, we should do as tcpdump
does and wrap uses of the "deprecated"-but-cross-platform APIs in
the appropriate pragmas.
Change-Id: I0b8b45f00481ac2b67da5c7dd028a029b130dcc4
Reviewed-on: https://code.wireshark.org/review/3377
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-03 10:40:11 +00:00
|
|
|
-Woverflow
|
2013-11-17 14:03:58 +00:00
|
|
|
-fstrict-overflow -Wstrict-overflow=4
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wcast-qual
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
|
|
|
# Some generated ASN.1 dissectors block this one;
|
|
|
|
# multiple function declarations for the same
|
|
|
|
# function are being generated.
|
|
|
|
#
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wredundant-decls
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
|
|
|
# Some loops are safe, but it's hard to convince the
|
|
|
|
# compiler of that.
|
|
|
|
#
|
|
|
|
-Wunsafe-loop-optimizations
|
|
|
|
#
|
Get rid of debugging output, and get CMake to produce verbose makefiles.
On the 32-bit OS X buildbot, automake is old enough that autotools
builds are verbose, printing the command line for each compile step; if
we cause CMake to produce verbose makefiles, they will also print the
command line, so we can see what differences there are.
This means the other debugging output we added isn't necessary; remove
it.
Sort the extra warning options in configure.ac based on whether they're
for C and C++ or just C, just as is the case in CMake, to make it easier
to keep the lists in sync; add comments to configure.ac to mirror the
ones in CMakeLists.txt.
Get rid of -Wno-deprecated-declarations; the CMake build doesn't use it,
and it doesn't appear to be necessary - if we ever have problems with OS
X complaining about using OpenSSL, for example, we should do as tcpdump
does and wrap uses of the "deprecated"-but-cross-platform APIs in
the appropriate pragmas.
Change-Id: I0b8b45f00481ac2b67da5c7dd028a029b130dcc4
Reviewed-on: https://code.wireshark.org/review/3377
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-03 10:40:11 +00:00
|
|
|
# All the registration functions block these for now.
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
Get rid of debugging output, and get CMake to produce verbose makefiles.
On the 32-bit OS X buildbot, automake is old enough that autotools
builds are verbose, printing the command line for each compile step; if
we cause CMake to produce verbose makefiles, they will also print the
command line, so we can see what differences there are.
This means the other debugging output we added isn't necessary; remove
it.
Sort the extra warning options in configure.ac based on whether they're
for C and C++ or just C, just as is the case in CMake, to make it easier
to keep the lists in sync; add comments to configure.ac to mirror the
ones in CMakeLists.txt.
Get rid of -Wno-deprecated-declarations; the CMake build doesn't use it,
and it doesn't appear to be necessary - if we ever have problems with OS
X complaining about using OpenSSL, for example, we should do as tcpdump
does and wrap uses of the "deprecated"-but-cross-platform APIs in
the appropriate pragmas.
Change-Id: I0b8b45f00481ac2b67da5c7dd028a029b130dcc4
Reviewed-on: https://code.wireshark.org/review/3377
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-03 10:40:11 +00:00
|
|
|
-Wmissing-prototypes
|
2014-04-20 22:44:53 +00:00
|
|
|
-Wmissing-declarations
|
|
|
|
#
|
|
|
|
# A bunch of "that might not work on SPARC" code blocks
|
2017-08-07 01:20:40 +00:00
|
|
|
# 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().
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
|
|
|
-Wcast-align
|
|
|
|
#
|
2014-05-22 17:23:22 +00:00
|
|
|
# Works only with Clang
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
|
|
|
-Wunreachable-code
|
|
|
|
#
|
2014-05-22 17:23:22 +00:00
|
|
|
# Works only with Clang but generates a lot of warnings
|
|
|
|
# (about glib library not using Doxygen)
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
|
|
|
-Wdocumentation
|
2017-08-07 01:04:43 +00:00
|
|
|
#
|
2017-08-07 00:58:00 +00:00
|
|
|
# Works only with GCC 7
|
2017-08-07 01:04:43 +00:00
|
|
|
#
|
2017-08-07 00:58:00 +00:00
|
|
|
-Wduplicated-branches
|
2015-11-04 19:11:49 +00:00
|
|
|
#
|
|
|
|
# No longer supported by El Capitan clang on C++
|
2017-08-07 00:58:00 +00:00
|
|
|
# XXX - is this one of those where CMake's check
|
|
|
|
# doesn't fail, so it won't reject this?
|
2015-11-04 19:11:49 +00:00
|
|
|
#
|
|
|
|
-fno-delete-null-pointer-checks
|
2013-11-17 14:03:58 +00:00
|
|
|
)
|
|
|
|
|
2016-08-16 21:21:59 +00:00
|
|
|
set(C_EXTRA_WARN_FLAGS
|
2013-11-17 14:03:58 +00:00
|
|
|
# The following are C only, not C++
|
2014-04-20 22:44:53 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2013-11-17 14:03:58 +00:00
|
|
|
-Wbad-function-cast
|
|
|
|
)
|
|
|
|
|
2016-08-16 21:21:59 +00:00
|
|
|
set(CXX_EXTRA_WARN_FLAGS
|
2014-01-07 23:08:42 +00:00
|
|
|
)
|
|
|
|
|
2014-04-20 23:54:21 +00:00
|
|
|
if(ENABLE_EXTRA_COMPILER_WARNINGS) # This overrides -Werror
|
2016-08-16 21:21:59 +00:00
|
|
|
set(COMMON_WARN_FLAGS ${COMMON_WARN_FLAGS} ${COMMON_EXTRA_WARN_FLAGS})
|
|
|
|
set(C_WARN_FLAGS ${C_WARN_FLAGS} ${C_EXTRA_WARN_FLAGS})
|
|
|
|
set(CXX_WARN_FLAGS ${CXX_WARN_FLAGS} ${CXX_EXTRA_WARN_FLAGS})
|
2014-03-15 11:52:29 +00:00
|
|
|
endif()
|
|
|
|
|
2013-11-17 14:03:58 +00:00
|
|
|
add_definitions(
|
|
|
|
-DG_DISABLE_DEPRECATED
|
|
|
|
-DG_DISABLE_SINGLE_INCLUDES
|
|
|
|
)
|
2018-01-16 21:56:58 +00:00
|
|
|
|
|
|
|
set(WIRESHARK_LD_FLAGS
|
|
|
|
-Wl,--as-needed
|
|
|
|
# -flto
|
|
|
|
# -fwhopr
|
|
|
|
# -fwhole-program
|
|
|
|
)
|
|
|
|
# CMAKE_POSITION_INDEPENDENT_CODE is only supported starting with CMake
|
|
|
|
# 2.8.9. Do not add -pie automatically for older versions.
|
|
|
|
#
|
|
|
|
# XXX - are there other compilers that don't support -pie? It's
|
|
|
|
# not as if the only platforms we support are Windows and Linux....
|
|
|
|
#
|
|
|
|
if(NOT CMAKE_VERSION VERSION_LESS "2.8.9")
|
|
|
|
set(WIRESHARK_LD_FLAGS ${WIRESHARK_LD_FLAGS}
|
|
|
|
-pie
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif() # ! MSVC
|
2006-10-26 15:36:50 +00:00
|
|
|
|
2014-06-13 15:14:25 +00:00
|
|
|
set( C_FLAG_TESTS ${WIRESHARK_COMMON_FLAGS} ${WIRESHARK_C_ONLY_FLAGS} )
|
2016-02-10 12:52:58 +00:00
|
|
|
set( CXX_FLAG_TESTS ${WIRESHARK_COMMON_FLAGS} ${WIRESHARK_CXX_ONLY_FLAGS} )
|
2014-01-07 23:08:42 +00:00
|
|
|
|
2016-08-16 21:21:59 +00:00
|
|
|
set( C_WARN_TESTS ${COMMON_WARN_FLAGS} ${C_WARN_FLAGS} )
|
|
|
|
set( CXX_WARN_TESTS ${COMMON_WARN_FLAGS} ${CXX_WARN_FLAGS} )
|
|
|
|
|
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()
|
|
|
|
|
2009-09-24 20:42:08 +00:00
|
|
|
# Sigh: Have to use THIS_FLAG instead of ${F} for some reason
|
2014-01-07 23:08:42 +00:00
|
|
|
foreach(THIS_FLAG ${C_FLAG_TESTS})
|
|
|
|
string( REGEX REPLACE "[^a-zA-Z0-9_]+" "_" F ${THIS_FLAG} )
|
2009-09-24 20:42:08 +00:00
|
|
|
set(${F} ${THIS_FLAG})
|
2014-01-07 23:08:42 +00:00
|
|
|
set(V C_${F}_VALID)
|
|
|
|
message(STATUS "Checking for c-compiler flag: ${THIS_FLAG}")
|
2014-08-02 22:43:36 +00:00
|
|
|
check_c_compiler_flag("${ADDED_CMAKE_C_FLAGS} ${${F}}" ${V})
|
2009-09-24 20:42:08 +00:00
|
|
|
if (${${V}})
|
2014-06-30 15:56:28 +00:00
|
|
|
set(ADDED_CMAKE_C_FLAGS "${ADDED_CMAKE_C_FLAGS} ${${F}}")
|
2014-01-03 00:40:21 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2014-06-30 15:56:28 +00:00
|
|
|
set(CMAKE_C_FLAGS "${ADDED_CMAKE_C_FLAGS} ${CMAKE_C_FLAGS}")
|
|
|
|
|
2016-02-10 12:52:58 +00:00
|
|
|
foreach(THIS_FLAG ${CXX_FLAG_TESTS})
|
2014-01-07 23:08:42 +00:00
|
|
|
string( REGEX REPLACE "[^a-zA-Z0-9_]+" "_" F ${THIS_FLAG} )
|
2014-01-03 00:40:21 +00:00
|
|
|
set(${F} ${THIS_FLAG})
|
2016-02-10 12:52:58 +00:00
|
|
|
set(V CXX_${F}_VALID)
|
2014-01-07 23:08:42 +00:00
|
|
|
message(STATUS "Checking for c++-compiler flag: ${THIS_FLAG}")
|
2014-08-02 22:43:36 +00:00
|
|
|
check_cxx_compiler_flag("${ADDED_CMAKE_CXX_FLAGS} ${${F}}" ${V})
|
2014-01-03 00:40:21 +00:00
|
|
|
if (${${V}})
|
2014-06-30 15:56:28 +00:00
|
|
|
set(ADDED_CMAKE_CXX_FLAGS "${ADDED_CMAKE_CXX_FLAGS} ${${F}}")
|
2012-08-23 12:30:16 +00:00
|
|
|
endif()
|
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
|
|
|
foreach(THIS_FLAG ${C_WARN_TESTS})
|
|
|
|
string( REGEX REPLACE "[^a-zA-Z0-9_]+" "_" F ${THIS_FLAG} )
|
|
|
|
set(${F} ${THIS_FLAG})
|
|
|
|
set(V C_${F}_VALID)
|
|
|
|
message(STATUS "Checking for c-compiler flag: ${THIS_FLAG}")
|
|
|
|
check_c_compiler_flag("${C_FLAG_TESTS} ${${F}}" ${V})
|
|
|
|
if (${${V}})
|
2017-09-24 01:30:08 +00:00
|
|
|
set(ADDED_WARN_C_FLAGS "${ADDED_WARN_C_FLAGS} ${${F}}")
|
2016-08-16 21:21:59 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2017-09-24 01:30:08 +00:00
|
|
|
set(CMAKE_C_FLAGS "${ADDED_WARN_C_FLAGS} ${CMAKE_C_FLAGS}")
|
2016-08-16 21:21:59 +00:00
|
|
|
|
|
|
|
foreach(THIS_FLAG ${CXX_WARN_TESTS})
|
|
|
|
string( REGEX REPLACE "[^a-zA-Z0-9_]+" "_" F ${THIS_FLAG} )
|
|
|
|
set(${F} ${THIS_FLAG})
|
|
|
|
set(V CXX_${F}_VALID)
|
|
|
|
message(STATUS "Checking for c++-compiler flag: ${THIS_FLAG}")
|
|
|
|
check_cxx_compiler_flag("${CXX_FLAG_TESTS} ${${F}}" ${V})
|
|
|
|
if (${${V}})
|
2017-09-24 01:30:08 +00:00
|
|
|
set(ADDED_WARN_CXX_FLAGS "${ADDED_WARN_CXX_FLAGS} ${${F}}")
|
2016-08-16 21:21:59 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2017-09-24 01:30:08 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${ADDED_WARN_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
|
2016-08-16 21:21:59 +00:00
|
|
|
|
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()
|
|
|
|
|
2016-09-30 14:06:15 +00:00
|
|
|
set(WERROR_COMMON_FLAGS "")
|
|
|
|
set(NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS "")
|
CMake: Add /WX
Add "/WX" to the Visual C++ compiler flags if DISABLE_WERROR is off,
similar to config.nmake.
We haven't compiled C++ code with -Wshorten-64-to-32 for quite
some time so there's no need to add -Wno-shorten-64-to-32 in
ui/qt/CMakeLists.txt.
Additionally, squelch
----
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3050) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3065) : see reference to function template instantiation 'void std::_Median<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3127) : see reference to function template instantiation 'std::pair<_RanIt,_RanIt> std::_Unguarded_partition<_RanIt,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3157) : see reference to function template instantiation 'void std::_Sort<_Iter,int,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Diff,_Pr)' being compiled
with
[
_Iter=QList<QString>::iterator
, _RanIt=QList<QString>::iterator
, _Diff=int
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
.\rpc_service_response_time_dialog.cpp(130) : see reference to function template instantiation 'void std::sort<QList<QString>::iterator,bool(__cdecl *)(const QString &,const QString &)>(_RanIt,_RanIt,_Pr)' being compiled
with
[
_RanIt=QList<QString>::iterator
, _Pr=bool (__cdecl *)(const QString &,const QString &)
]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3051) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3052) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\algorithm(3053) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data (.\rpc_service_response_time_dialog.cpp)
----
in both rpc_service_response_time_dialog.cpp and wireshark_application.cpp
so that we'll compile successfully.
Change-Id: I457bcede99dcb1f3c1001f1f559c4901bb000357
Reviewed-on: https://code.wireshark.org/review/10533
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-09-15 00:19:02 +00:00
|
|
|
if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_COMPILER_WARNINGS)
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|
|
|
set(WERROR_COMMON_FLAGS "/WX")
|
|
|
|
else()
|
|
|
|
check_c_compiler_flag(-Werror WERROR)
|
|
|
|
if (WERROR)
|
|
|
|
set(WERROR_COMMON_FLAGS "-Werror")
|
|
|
|
set(NO_ERROR_DEPRECATED_DECLARATIONS_COMPILE_FLAGS "-Wno-error=deprecated-declarations")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2015-01-21 09:00:43 +00:00
|
|
|
#
|
|
|
|
# Try to have the compiler default to hiding symbols, so that only
|
|
|
|
# symbols explicitly exported with WS_DLL_PUBLIC will be visible
|
|
|
|
# outside (shared) libraries; that way, more UN*X builds will catch
|
|
|
|
# failures to export symbols, rather than having that fail only on
|
|
|
|
# Windows.
|
|
|
|
#
|
|
|
|
# We don't need that with MSVC, as that's the default.
|
|
|
|
#
|
|
|
|
if( NOT CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|
|
|
#
|
2015-12-23 03:49:01 +00:00
|
|
|
# Try the GCC-and-compatible -fvisibility-hidden first.
|
2015-01-21 09:00:43 +00:00
|
|
|
#
|
|
|
|
check_c_compiler_flag(-fvisibility=hidden FVHIDDEN)
|
|
|
|
if(FVHIDDEN)
|
2017-09-24 01:30:08 +00:00
|
|
|
set(CMAKE_C_FLAGS "-fvisibility=hidden ${CMAKE_C_FLAGS}")
|
2015-01-21 09:00:43 +00:00
|
|
|
else()
|
|
|
|
#
|
|
|
|
# OK, try the Sun^WOracle C -xldscope=hidden
|
|
|
|
#
|
|
|
|
check_c_compiler_flag(-xldscope=hidden XLDSCOPEHIDDEN)
|
|
|
|
if(XLDSCOPEHIDDEN)
|
2017-09-24 01:30:08 +00:00
|
|
|
set(CMAKE_C_FLAGS "-xldscope=hidden ${CMAKE_C_FLAGS}")
|
2015-01-21 09:00:43 +00:00
|
|
|
else()
|
|
|
|
#
|
|
|
|
# Anything else?
|
|
|
|
# If there is anything else, we might want to
|
|
|
|
# make a list of options to try, and try them
|
|
|
|
# in a loop.
|
|
|
|
#
|
|
|
|
message(WARNING "Hiding shared library symbols is not supported by the compiler."
|
|
|
|
" All shared library symbols will be exported.")
|
|
|
|
endif()
|
2014-06-16 19:12:30 +00:00
|
|
|
endif()
|
2013-02-28 14:09:46 +00:00
|
|
|
endif()
|
|
|
|
|
2010-03-18 10:27:17 +00:00
|
|
|
include(CheckCLinkerFlag)
|
2015-05-18 14:31:24 +00:00
|
|
|
set(_C 0)
|
2010-03-18 10:27:17 +00:00
|
|
|
# Sigh: Have to use THIS_FLAG instead of ${F} for some reason
|
|
|
|
foreach(THIS_FLAG ${WIRESHARK_LD_FLAGS})
|
2015-05-18 14:31:24 +00:00
|
|
|
set(F WS_LD_FLAG_${_C})
|
2010-03-18 10:27:17 +00:00
|
|
|
set(${F} ${THIS_FLAG})
|
2015-05-18 14:31:24 +00:00
|
|
|
set(V WS_LD_FLAG_VALID${_C})
|
2010-03-18 10:27:17 +00:00
|
|
|
check_c_linker_flag(${${F}} ${V})
|
|
|
|
if (${${V}})
|
2014-07-02 15:43:17 +00:00
|
|
|
set(WS_LINK_FLAGS "${WS_LINK_FLAGS} ${${F}}")
|
2010-03-18 10:27:17 +00:00
|
|
|
endif()
|
2015-05-18 14:31:24 +00:00
|
|
|
math(EXPR _C "${_C} + 1")
|
2010-03-18 10:27:17 +00:00
|
|
|
endforeach()
|
2009-11-07 10:08:36 +00:00
|
|
|
|
2013-09-10 21:24:52 +00:00
|
|
|
if(APPLE AND EXISTS /usr/local/opt/gettext)
|
2017-04-05 19:15:27 +00:00
|
|
|
# GLib on macOS requires libintl. Homebrew installs gettext (and
|
2013-09-10 21:24:52 +00:00
|
|
|
# libintl) in /usr/local/opt/gettext
|
|
|
|
include_directories(/usr/local/opt/gettext/include)
|
|
|
|
link_directories(/usr/local/opt/gettext/lib)
|
|
|
|
endif()
|
|
|
|
|
2017-08-25 17:20:59 +00:00
|
|
|
# The packagelist is doing some magic: If we add XXX to the packagelist, we
|
2010-05-24 21:59:29 +00:00
|
|
|
# - may optionally set XXX_OPTIONS to pass to the find_package command
|
2017-08-25 17:20:59 +00:00
|
|
|
# - will call FindXXX.cmake or find_package
|
2010-05-24 21:59:29 +00:00
|
|
|
# - return found libraries in XXX_LIBRARIES
|
|
|
|
# - return found include in XXX_INCLUDE_DIRS
|
|
|
|
# - set HAVE_XXX
|
|
|
|
|
2017-08-25 17:20:59 +00:00
|
|
|
# The minimum package list
|
2017-11-18 20:16:32 +00:00
|
|
|
set(PACKAGELIST Git GLIB2 GMODULE2 GTHREAD2 GCRYPT LEX YACC Perl SH PythonInterp)
|
2017-08-25 17:20:59 +00:00
|
|
|
set(LEX_OPTIONS REQUIRED)
|
|
|
|
set(GLIB2_OPTIONS REQUIRED)
|
|
|
|
set(GLIB2_FIND_OPTIONS REQUIRED)
|
2016-08-04 11:11:09 +00:00
|
|
|
set(GLIB2_MIN_VERSION 2.22.0)
|
2017-08-25 17:20:59 +00:00
|
|
|
set(GTHREAD2_OPTIONS REQUIRED)
|
|
|
|
set(GCRYPT_OPTIONS "1.4.2" REQUIRED)
|
2013-05-01 00:53:59 +00:00
|
|
|
set(PythonInterp_FIND_VERSION 2)
|
2013-08-03 00:39:27 +00:00
|
|
|
set(Python_ADDITIONAL_VERSIONS 3)
|
2017-08-25 17:20:59 +00:00
|
|
|
set(YACC_OPTIONS REQUIRED)
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2015-04-07 21:05:52 +00:00
|
|
|
if (NOT WIN32)
|
2017-11-18 20:16:32 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} Gettext M)
|
2017-08-25 17:20:59 +00:00
|
|
|
set(M_OPTIONS REQUIRED)
|
2014-06-08 14:35:29 +00:00
|
|
|
endif()
|
2010-10-01 08:40:52 +00:00
|
|
|
|
2015-11-19 10:30:44 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} LIBSSH)
|
|
|
|
set(LIBSSH_OPTIONS "0.6")
|
|
|
|
|
2011-08-30 11:44:21 +00:00
|
|
|
if(ENABLE_PCAP)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} PCAP)
|
|
|
|
endif()
|
|
|
|
|
2013-10-10 20:35:32 +00:00
|
|
|
if(ENABLE_AIRPCAP)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} AIRPCAP)
|
|
|
|
endif()
|
|
|
|
|
2012-02-02 00:46:02 +00:00
|
|
|
# Build the GTK-GUI?
|
2014-08-28 23:48:53 +00:00
|
|
|
if(BUILD_wireshark_gtk)
|
2011-06-08 18:10:03 +00:00
|
|
|
if(ENABLE_GTK3)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} GTK3)
|
|
|
|
else()
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} GTK2)
|
|
|
|
set(GTK2_OPTIONS COMPONENTS gtk)
|
2011-07-12 21:24:15 +00:00
|
|
|
set(GTK2_FIND_VERSION 2.12)
|
2011-06-08 18:10:03 +00:00
|
|
|
set(GTK2_DEBUG false)
|
|
|
|
endif()
|
2011-05-12 21:13:00 +00:00
|
|
|
endif()
|
|
|
|
|
2012-02-02 00:46:02 +00:00
|
|
|
# Build the Qt GUI?
|
2014-08-28 23:48:53 +00:00
|
|
|
if(BUILD_wireshark)
|
2013-04-25 23:04:19 +00:00
|
|
|
if(ENABLE_QT5)
|
2013-10-10 09:10:53 +00:00
|
|
|
# Untested, may not work if CMAKE_PREFIX_PATH gets overwritten
|
|
|
|
# somewhere. The if WIN32 in this place is annoying as well.
|
|
|
|
if( WIN32 )
|
2013-10-11 11:43:37 +00:00
|
|
|
set( QT5_BASE_PATH "$ENV{QT5_BASE_DIR}" )
|
2013-12-02 09:50:30 +00:00
|
|
|
set( CMAKE_PREFIX_PATH "${QT5_BASE_PATH}" )
|
2013-10-10 09:10:53 +00:00
|
|
|
endif()
|
2014-11-19 00:21:42 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST}
|
2015-01-13 21:32:12 +00:00
|
|
|
Qt5Core
|
2014-11-19 00:21:42 +00:00
|
|
|
Qt5LinguistTools
|
2014-12-13 00:51:40 +00:00
|
|
|
Qt5Multimedia
|
2014-11-19 00:21:42 +00:00
|
|
|
Qt5PrintSupport
|
2015-11-17 20:33:47 +00:00
|
|
|
Qt5Svg
|
2014-11-19 00:21:42 +00:00
|
|
|
Qt5Widgets
|
|
|
|
)
|
2017-11-14 15:36:57 +00:00
|
|
|
set(Qt5Core_OPTIONS REQUIRED)
|
|
|
|
set(Qt5LinguistTools_OPTIONS REQUIRED)
|
|
|
|
set(Qt5Multimedia_OPTIONS REQUIRED)
|
|
|
|
set(Qt5PrintSupport_OPTIONS REQUIRED)
|
|
|
|
set(Qt5Svg_OPTIONS REQUIRED)
|
|
|
|
set(Qt5Widgets_OPTIONS REQUIRED)
|
2014-05-16 19:43:17 +00:00
|
|
|
if (APPLE)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} Qt5MacExtras)
|
2017-11-14 15:36:57 +00:00
|
|
|
set(Qt5MacExtras_OPTIONS REQUIRED)
|
2014-05-16 19:43:17 +00:00
|
|
|
endif()
|
2014-08-13 15:10:44 +00:00
|
|
|
if( WIN32 )
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} Qt5WinExtras)
|
2017-11-14 15:36:57 +00:00
|
|
|
set(Qt5WinExtras_OPTIONS REQUIRED)
|
2014-08-13 15:10:44 +00:00
|
|
|
endif()
|
2014-05-16 19:43:17 +00:00
|
|
|
set(QT_VERSION 5)
|
2013-04-25 23:04:19 +00:00
|
|
|
else()
|
2013-05-01 09:20:59 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} Qt4)
|
2016-10-19 10:27:11 +00:00
|
|
|
set(Qt4_OPTIONS 4.8 REQUIRED QtCore QtGui)
|
2013-04-28 01:09:00 +00:00
|
|
|
set(QT_VERSION 4)
|
2013-04-25 23:04:19 +00:00
|
|
|
endif()
|
2012-02-02 00:46:02 +00:00
|
|
|
endif()
|
|
|
|
|
2009-09-09 13:20:33 +00:00
|
|
|
# SMI SNMP
|
|
|
|
if(ENABLE_SMI)
|
2010-10-01 08:40:52 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} SMI)
|
2009-09-09 13:20:33 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# GNU SSL/TLS support
|
|
|
|
if(ENABLE_GNUTLS)
|
2010-10-01 08:40:52 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} GNUTLS)
|
2015-10-14 18:23:46 +00:00
|
|
|
# Minimum version needed.
|
|
|
|
set(GNUTLS_OPTIONS "2.12.0")
|
2009-09-09 13:20:33 +00:00
|
|
|
endif()
|
|
|
|
|
2009-09-10 07:04:54 +00:00
|
|
|
# Kerberos
|
|
|
|
if(ENABLE_KERBEROS)
|
2010-10-01 08:40:52 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} KERBEROS)
|
2009-09-10 07:04:54 +00:00
|
|
|
endif()
|
|
|
|
|
2014-12-13 00:51:40 +00:00
|
|
|
# Portable audio (GTK+ only)
|
2014-08-28 23:48:53 +00:00
|
|
|
if(ENABLE_PORTAUDIO AND BUILD_wireshark_gtk)
|
2010-10-01 08:40:52 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} PORTAUDIO)
|
2009-09-09 13:20:33 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2016-03-16 22:11:17 +00:00
|
|
|
# C Asynchronous resolver
|
|
|
|
if(ENABLE_CARES)
|
2010-10-01 08:40:52 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} CARES)
|
2017-07-21 10:11:14 +00:00
|
|
|
# Minimum version needed.
|
2017-07-22 03:14:47 +00:00
|
|
|
set(CARES_OPTIONS "1.5.0")
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2006-10-24 17:39:32 +00:00
|
|
|
|
2009-09-09 13:20:33 +00:00
|
|
|
# Zlib compression
|
2010-04-01 10:10:48 +00:00
|
|
|
if(ENABLE_ZLIB)
|
2015-03-30 13:03:22 +00:00
|
|
|
if (WIN32)
|
|
|
|
# On Windows we build our own version of zlib, so add the paths
|
2017-06-28 07:33:55 +00:00
|
|
|
set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.11-ws")
|
2015-12-04 19:12:45 +00:00
|
|
|
set(SKIP_INSTALL_ALL True) # We copy the DLL ourselves.
|
2015-03-30 13:03:22 +00:00
|
|
|
add_subdirectory("${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
|
2015-12-04 19:12:45 +00:00
|
|
|
unset(SKIP_INSTALL_ALL)
|
2015-03-30 13:03:22 +00:00
|
|
|
set(ZLIB_INCLUDE_DIR "${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
|
|
|
|
set(ZLIB_LIBRARY zlib)
|
2015-06-15 19:33:46 +00:00
|
|
|
set(ZLIB_DLL "zlib1.dll")
|
2015-04-08 22:19:31 +00:00
|
|
|
set_target_properties(zlib PROPERTIES FOLDER "Libs/zlib")
|
2015-05-16 21:26:53 +00:00
|
|
|
# Annoyingly zlib also builds some other stuff we aren't interested in
|
2015-04-08 22:19:31 +00:00
|
|
|
set_target_properties(zlibstatic PROPERTIES FOLDER "Libs/zlib")
|
2015-03-30 13:03:22 +00:00
|
|
|
endif()
|
2010-10-01 08:40:52 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} ZLIB)
|
2009-09-09 13:20:33 +00:00
|
|
|
endif()
|
|
|
|
|
2016-09-26 14:25:11 +00:00
|
|
|
# LZ4 compression
|
|
|
|
if(ENABLE_LZ4)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} LZ4)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Snappy compression
|
|
|
|
if(ENABLE_SNAPPY)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} SNAPPY)
|
|
|
|
endif()
|
|
|
|
|
2017-08-27 21:07:55 +00:00
|
|
|
# Enhanced HTTP/2 dissection
|
|
|
|
if(ENABLE_NGHTTP2)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} NGHTTP2)
|
|
|
|
endif()
|
|
|
|
|
2014-07-31 21:00:33 +00:00
|
|
|
# Embedded Lua interpreter
|
2009-09-09 13:20:33 +00:00
|
|
|
if(ENABLE_LUA)
|
2010-10-01 08:40:52 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} LUA)
|
2009-09-09 13:20:33 +00:00
|
|
|
endif()
|
|
|
|
|
2009-09-10 07:04:54 +00:00
|
|
|
# GeoIP address resolving
|
|
|
|
if(ENABLE_GEOIP)
|
2010-10-01 08:40:52 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} GEOIP)
|
2009-09-10 07:04:54 +00:00
|
|
|
endif()
|
|
|
|
|
2012-06-20 20:59:43 +00:00
|
|
|
if(ENABLE_NETLINK)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} NL)
|
|
|
|
endif()
|
|
|
|
|
2014-02-16 10:12:35 +00:00
|
|
|
if(ENABLE_SBC)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} SBC)
|
|
|
|
endif()
|
|
|
|
|
2016-11-23 23:27:14 +00:00
|
|
|
if(ENABLE_SPANDSP)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} SPANDSP)
|
|
|
|
endif()
|
|
|
|
|
2017-07-26 21:23:12 +00:00
|
|
|
if(ENABLE_BCG729)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} BCG729)
|
|
|
|
endif()
|
|
|
|
|
2017-04-04 21:23:59 +00:00
|
|
|
if(ENABLE_LIBXML2)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} LibXml2)
|
|
|
|
endif()
|
|
|
|
|
2009-09-10 07:04:54 +00:00
|
|
|
# Capabilities
|
|
|
|
if(ENABLE_CAP)
|
2014-01-19 00:48:22 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} CAP SETCAP)
|
2009-09-10 07:04:54 +00:00
|
|
|
endif()
|
|
|
|
|
2014-08-20 21:29:33 +00:00
|
|
|
# Windows version updates
|
|
|
|
if(ENABLE_WINSPARKLE)
|
|
|
|
set(PACKAGELIST ${PACKAGELIST} WINSPARKLE)
|
|
|
|
endif()
|
|
|
|
|
2010-10-02 06:45:49 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} POD)
|
2009-09-12 17:20:08 +00:00
|
|
|
|
2014-12-11 00:50:56 +00:00
|
|
|
if(ENABLE_HTML_GUIDES)
|
2013-12-22 01:21:56 +00:00
|
|
|
set(PACKAGELIST ${PACKAGELIST} DOXYGEN)
|
|
|
|
endif()
|
|
|
|
|
2015-02-01 21:56:39 +00:00
|
|
|
set(PROGLIST)
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2015-10-15 21:45:45 +00:00
|
|
|
# Sort the package list
|
2013-05-01 10:40:12 +00:00
|
|
|
list(SORT PACKAGELIST)
|
2017-09-24 08:31:12 +00:00
|
|
|
string(REPLACE ";" " " _package_list "${PACKAGELIST}")
|
|
|
|
message(STATUS "Package List: ${_package_list}")
|
2015-10-15 21:45:45 +00:00
|
|
|
# Let's loop the package list
|
2006-09-06 22:28:19 +00:00
|
|
|
foreach(PACKAGE ${PACKAGELIST})
|
2013-05-01 09:20:59 +00:00
|
|
|
if(${PACKAGE} STREQUAL "Qt4")
|
|
|
|
set(PACKAGE_VAR "QT")
|
|
|
|
elseif(${PACKAGE} STREQUAL "PythonInterp")
|
2014-04-28 13:52:15 +00:00
|
|
|
set(PACKAGE_VAR "PYTHONINTERP")
|
|
|
|
elseif(${PACKAGE} STREQUAL "Gettext")
|
|
|
|
set(PACKAGE_VAR "GETTEXT")
|
|
|
|
elseif(${PACKAGE} STREQUAL "Perl")
|
|
|
|
set(PACKAGE_VAR "PERL")
|
2017-04-04 21:23:59 +00:00
|
|
|
elseif(${PACKAGE} STREQUAL "LibXml2")
|
|
|
|
set(PACKAGE_VAR "LIBXML2")
|
2012-02-02 00:46:02 +00:00
|
|
|
else()
|
2013-05-01 09:20:59 +00:00
|
|
|
set(PACKAGE_VAR ${PACKAGE})
|
2012-02-02 00:46:02 +00:00
|
|
|
endif()
|
2010-03-04 23:35:43 +00:00
|
|
|
if(${PACKAGE}_OPTIONS)
|
2013-05-01 09:20:59 +00:00
|
|
|
find_package(${PACKAGE} ${${PACKAGE}_OPTIONS})
|
2010-10-01 08:40:52 +00:00
|
|
|
else()
|
2013-05-01 09:20:59 +00:00
|
|
|
find_package(${PACKAGE})
|
2010-03-04 23:35:43 +00:00
|
|
|
endif()
|
2017-04-26 18:03:05 +00:00
|
|
|
# FindPackageHandleStandardArgs before CMake 3.2 always uses uppercase
|
|
|
|
# for the FOUND variables (e.g. GIT_FOUND is set, but not Git_FOUND).
|
|
|
|
string(TOUPPER "${PACKAGE_VAR}" PACKAGE_VAR_UPPER)
|
|
|
|
if (${PACKAGE_VAR}_FOUND OR ${PACKAGE_VAR_UPPER}_FOUND)
|
2015-04-20 15:36:06 +00:00
|
|
|
message(STATUS "${PACKAGE_VAR} FOUND")
|
2013-05-01 09:20:59 +00:00
|
|
|
set(HAVE_LIB${PACKAGE_VAR} 1)
|
2017-04-26 18:12:21 +00:00
|
|
|
if (NOT DEFINED ${PACKAGE_VAR}_INCLUDE_DIRS AND ${PACKAGE_VAR}_INCLUDE_DIR)
|
2017-04-15 11:21:48 +00:00
|
|
|
set(${PACKAGE_VAR}_INCLUDE_DIRS ${${PACKAGE_VAR}_INCLUDE_DIR})
|
|
|
|
endif()
|
2017-04-26 18:12:21 +00:00
|
|
|
if (${PACKAGE_VAR}_INCLUDE_DIRS)
|
|
|
|
include_directories(SYSTEM ${${PACKAGE_VAR}_INCLUDE_DIRS})
|
|
|
|
message(STATUS "${PACKAGE} includes: ${${PACKAGE_VAR}_INCLUDE_DIRS}")
|
|
|
|
endif()
|
|
|
|
if (${PACKAGE_VAR}_LIBRARIES)
|
|
|
|
list(APPEND WS_ALL_LIBS ${${PACKAGE_VAR}_LIBRARIES})
|
|
|
|
message(STATUS "${PACKAGE} libs: ${${PACKAGE_VAR}_LIBRARIES}")
|
|
|
|
endif()
|
|
|
|
if (${PACKAGE_VAR}_DEFINITIONS)
|
2013-05-01 09:20:59 +00:00
|
|
|
message(STATUS "${PACKAGE} definitions: ${${PACKAGE_VAR}_DEFINITIONS}")
|
2013-04-25 23:04:19 +00:00
|
|
|
endif()
|
2013-05-01 09:20:59 +00:00
|
|
|
if (${PACKAGE_VAR}_EXECUTABLE)
|
|
|
|
message(STATUS "${PACKAGE} executable: ${${PACKAGE_VAR}_EXECUTABLE}")
|
2013-05-01 00:53:59 +00:00
|
|
|
endif()
|
2014-04-28 13:52:15 +00:00
|
|
|
else()
|
2014-05-05 03:11:45 +00:00
|
|
|
#
|
|
|
|
# Not finding a package is only a fatal error if the
|
|
|
|
# package is required; if it's required, then its
|
2017-08-25 17:20:59 +00:00
|
|
|
# XXX_OPTIONS variable contains REQUIRED, and the above
|
2014-05-05 03:11:45 +00:00
|
|
|
# code will pass REQUIRED to find_package, and the
|
|
|
|
# configure will fail if the package isn't found.
|
|
|
|
#
|
|
|
|
# Do *NOT* report this as an error!
|
|
|
|
#
|
2015-04-20 15:36:06 +00:00
|
|
|
message(STATUS "${PACKAGE_VAR} NOT FOUND")
|
2009-09-02 16:33:01 +00:00
|
|
|
endif()
|
2009-08-27 16:11:16 +00:00
|
|
|
endforeach()
|
2006-09-06 22:28:19 +00:00
|
|
|
|
2013-10-05 10:17:21 +00:00
|
|
|
# Provide Windows system lib names
|
|
|
|
include( UseWinLibs )
|
|
|
|
|
2017-06-19 14:37:29 +00:00
|
|
|
# dist target that prepares source dir
|
|
|
|
add_custom_target(dist
|
|
|
|
COMMAND "${CMAKE_COMMAND}"
|
|
|
|
-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}"
|
|
|
|
-DGIT_EXECUTABLE="${GIT_EXECUTABLE}"
|
|
|
|
-DWS_SOURCE_DIR="${WS_SOURCE_DIR}"
|
|
|
|
-P "${CMAKE_SOURCE_DIR}/cmake/modules/Dist.cmake"
|
|
|
|
COMMAND "${CMAKE_MAKE_PROGRAM}" package_source
|
|
|
|
)
|
|
|
|
|
2009-12-29 12:12:26 +00:00
|
|
|
|
2014-08-22 10:53:27 +00:00
|
|
|
if(HAVE_LIBAIRPCAP)
|
|
|
|
set(HAVE_AIRPCAP 1)
|
|
|
|
endif()
|
2009-09-09 13:20:33 +00:00
|
|
|
if(HAVE_LIBLUA)
|
|
|
|
set(HAVE_LUA_H 1)
|
2012-06-25 20:42:07 +00:00
|
|
|
set(HAVE_LUA 1)
|
2009-09-09 13:20:33 +00:00
|
|
|
endif()
|
2009-09-10 07:04:54 +00:00
|
|
|
if(HAVE_LIBKERBEROS)
|
|
|
|
set(HAVE_KERBEROS 1)
|
|
|
|
endif()
|
2009-09-12 17:20:08 +00:00
|
|
|
if(HAVE_LIBGEOIP)
|
|
|
|
set(HAVE_GEOIP 1)
|
|
|
|
endif()
|
2015-11-19 10:30:44 +00:00
|
|
|
if(LIBSSH_FOUND)
|
|
|
|
set(HAVE_LIBSSH 1)
|
|
|
|
endif()
|
2016-08-26 13:18:29 +00:00
|
|
|
if(NGHTTP2_FOUND)
|
|
|
|
set(HAVE_NGHTTP2 1)
|
|
|
|
endif()
|
2009-09-09 13:20:33 +00:00
|
|
|
if(HAVE_LIBCARES)
|
|
|
|
set(HAVE_C_ARES 1)
|
2009-09-12 17:20:08 +00:00
|
|
|
endif()
|
2016-03-16 22:11:17 +00:00
|
|
|
if(NOT HAVE_LIBCARES)
|
|
|
|
message(WARNING "Not using c-ares.")
|
2016-03-26 03:16:17 +00:00
|
|
|
message(WARNING "DNS name resolution for captures will be disabled.")
|
2016-01-06 18:48:53 +00:00
|
|
|
endif()
|
2013-10-10 20:35:32 +00:00
|
|
|
if(HAVE_LIBNL AND HAVE_AIRPCAP)
|
2012-06-20 20:59:43 +00:00
|
|
|
message(ERROR "Airpcap and Libnl support are mutually exclusive")
|
|
|
|
endif()
|
2014-02-16 10:12:35 +00:00
|
|
|
if(HAVE_LIBSBC)
|
2014-05-20 20:47:08 +00:00
|
|
|
set(HAVE_SBC 1)
|
2014-02-16 10:12:35 +00:00
|
|
|
endif()
|
2016-11-23 23:27:14 +00:00
|
|
|
if(SPANDSP_FOUND)
|
|
|
|
set(HAVE_SPANDSP 1)
|
|
|
|
endif()
|
2017-07-26 21:23:12 +00:00
|
|
|
if(BCG729_FOUND)
|
|
|
|
set(HAVE_BCG729 1)
|
|
|
|
endif()
|
2017-04-04 21:23:59 +00:00
|
|
|
if(LIBXML2_FOUND)
|
|
|
|
set(HAVE_LIBXML2 1)
|
2017-04-24 21:20:39 +00:00
|
|
|
else()
|
|
|
|
# The (official) FindLibXml2.cmake file sets this cache variable to a
|
|
|
|
# non-empty value, be sure to clear it when not found.
|
|
|
|
set(LIBXML2_LIBRARIES "")
|
2017-04-04 21:23:59 +00:00
|
|
|
endif()
|
2015-02-14 18:10:21 +00:00
|
|
|
if(EXTCAP_ANDROIDDUMP_LIBPCAP)
|
|
|
|
set(ANDROIDDUMP_USE_LIBPCAP 1)
|
|
|
|
endif()
|
2014-08-20 21:29:33 +00:00
|
|
|
|
|
|
|
if (HAVE_LIBWINSPARKLE)
|
|
|
|
set(HAVE_SOFTWARE_UPDATE 1)
|
|
|
|
endif()
|
|
|
|
|
2011-06-08 18:10:03 +00:00
|
|
|
# No matter which version of GTK is present
|
|
|
|
if(GTK2_FOUND OR GTK3_FOUND)
|
2017-10-20 23:10:34 +00:00
|
|
|
message(WARNING "The GTK+ UI is deprecated and will be removed in a future release.")
|
2011-06-08 18:10:03 +00:00
|
|
|
set(GTK_FOUND ON)
|
|
|
|
endif()
|
2016-04-01 00:32:56 +00:00
|
|
|
|
2010-05-19 13:05:35 +00:00
|
|
|
if(HAVE_LIBZLIB)
|
2016-04-01 00:32:56 +00:00
|
|
|
set(HAVE_ZLIB 1)
|
2013-11-29 15:40:04 +00:00
|
|
|
# Always include the "true" zlib includes first. This works around a
|
|
|
|
# bug in the Windows setup of GTK[23] which has a faulty zconf.h.
|
|
|
|
include_directories(BEFORE ${ZLIB_INCLUDE_DIRS})
|
2010-05-19 13:05:35 +00:00
|
|
|
endif()
|
2016-09-26 14:25:11 +00:00
|
|
|
if(HAVE_LIBLZ4)
|
|
|
|
set(HAVE_LZ4 1)
|
|
|
|
endif()
|
|
|
|
if(SNAPPY_FOUND)
|
|
|
|
set(HAVE_SNAPPY 1)
|
|
|
|
endif()
|
2013-04-25 23:04:19 +00:00
|
|
|
if (Qt5Widgets_FOUND)
|
2016-06-25 16:44:28 +00:00
|
|
|
if (Qt5Widgets_VERSION VERSION_GREATER 5.6
|
|
|
|
AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
|
|
|
# Qt 5.7 and later require C++ 11. If our minmimu required CMake version
|
|
|
|
# is ever >= 3.1 we can use CXX_STANDARD + CXX_STANDARD_REQUIRED.
|
|
|
|
message(STATUS "Checking for C++ 11 support (Required by Qt 5.7 and later)")
|
|
|
|
check_cxx_compiler_flag(-std=c++11 CXX__std_c__11_VALID)
|
|
|
|
if(NOT CXX__std_c__11_VALID)
|
|
|
|
message(FATAL_ERROR "Qt ${Qt5Widgets_VERSION} requires C++ 11")
|
|
|
|
endif()
|
2017-09-24 01:30:08 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
|
2016-06-25 16:44:28 +00:00
|
|
|
endif()
|
2013-04-25 23:04:19 +00:00
|
|
|
set (QT_FOUND ON)
|
|
|
|
set (QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5PrintSupport_LIBRARIES})
|
2014-12-13 00:51:40 +00:00
|
|
|
if(Qt5Multimedia_FOUND)
|
|
|
|
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Multimedia_LIBRARIES})
|
2014-11-19 00:21:42 +00:00
|
|
|
# That's the name autofoo uses
|
2014-12-13 00:51:40 +00:00
|
|
|
set(QT_MULTIMEDIA_LIB 1)
|
2014-11-19 00:21:42 +00:00
|
|
|
endif()
|
2015-11-17 20:33:47 +00:00
|
|
|
if(Qt5Svg_FOUND)
|
|
|
|
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Svg_LIBRARIES})
|
|
|
|
# That's the name autofoo uses
|
|
|
|
set(QT_SVG_LIB 1)
|
|
|
|
endif()
|
2013-10-10 23:11:19 +00:00
|
|
|
if(Qt5MacExtras_FOUND)
|
|
|
|
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5MacExtras_LIBRARIES})
|
|
|
|
# That's the name autofoo uses
|
|
|
|
set(QT_MACEXTRAS_LIB 1)
|
|
|
|
endif()
|
2014-08-14 00:27:26 +00:00
|
|
|
if(Qt5WinExtras_FOUND)
|
|
|
|
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5WinExtras_LIBRARIES})
|
|
|
|
# set(QT_WINEXTRAS_LIB 1) # Not needed?
|
|
|
|
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()
|
2013-04-25 23:04:19 +00:00
|
|
|
# If Qt4: QT_LIBRARIES and QT_INCLUDES are not set above. They require extra magic
|
2016-10-22 16:26:47 +00:00
|
|
|
elseif(QT4_FOUND)
|
2012-02-02 12:04:22 +00:00
|
|
|
include(${QT_USE_FILE})
|
|
|
|
include_directories(${QT_INCLUDE_DIR})
|
2015-07-13 23:20:59 +00:00
|
|
|
message(STATUS "Qt includes: ${QT_INCLUDE_DIR}")
|
|
|
|
message(STATUS "Qt libs: ${QT_LIBRARIES}")
|
2015-10-14 04:07:33 +00:00
|
|
|
if(QT_QTMULTIMEDIA_FOUND)
|
2015-10-14 07:49:43 +00:00
|
|
|
include_directories(${QT_QTMULTIMEDIA_INCLUDE_DIR})
|
|
|
|
message(STATUS "QtMultimedia includes: ${QT_INCLUDE_DIR}")
|
2015-10-14 09:10:05 +00:00
|
|
|
set (QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMULTIMEDIA_LIBRARY})
|
|
|
|
message(STATUS "QtMultimedia libs: ${QT_QTMULTIMEDIA_LIBRARY}")
|
2015-10-14 04:07:33 +00:00
|
|
|
# That's the name autofoo uses
|
|
|
|
set(QT_MULTIMEDIA_LIB 1)
|
|
|
|
endif()
|
2016-02-02 19:00:37 +00:00
|
|
|
if(NOT DEFINED MOC_OPTIONS)
|
|
|
|
if(QT_VERSION_MAJOR EQUAL 4 AND QT_VERSION_MINOR GREATER 7)
|
|
|
|
set(MOC_OPTIONS -nn)
|
|
|
|
endif()
|
|
|
|
endif()
|
2016-10-21 23:05:10 +00:00
|
|
|
if(WIN32 OR APPLE)
|
|
|
|
message(FATAL_ERROR "Windows and macOS builds should use Qt5.")
|
|
|
|
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()
|
|
|
|
|
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)
|
|
|
|
FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation)
|
|
|
|
FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration)
|
|
|
|
endif()
|
|
|
|
|
2009-08-27 15:32:57 +00:00
|
|
|
include(ConfigureChecks.cmake)
|
2006-10-24 17:39:32 +00:00
|
|
|
|
|
|
|
#Big or little endian ?
|
|
|
|
include(TestBigEndian)
|
|
|
|
test_big_endian(WORDS_BIGENDIAN)
|
|
|
|
|
2016-11-08 19:11:14 +00:00
|
|
|
# Global properties
|
2013-12-01 21:55:21 +00:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
2013-10-13 09:21:55 +00:00
|
|
|
|
2016-11-08 19:11:14 +00:00
|
|
|
if(ENABLE_CCACHE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
|
|
|
# http://stackoverflow.com/a/24305849/82195
|
|
|
|
find_program(CCACHE_EXECUTABLE ccache)
|
|
|
|
if(CCACHE_EXECUTABLE)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_EXECUTABLE}")
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_EXECUTABLE}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-03-11 19:51:39 +00:00
|
|
|
# The top level checkAPIs target, add before subdirectory calls so it's avaiable to all
|
|
|
|
add_custom_target(checkAPI)
|
|
|
|
set_target_properties(checkAPI
|
|
|
|
PROPERTIES
|
|
|
|
FOLDER "Auxiliary"
|
|
|
|
EXCLUDE_FROM_ALL True
|
|
|
|
EXCLUDE_FROM_DEFAULT_BUILD True
|
|
|
|
)
|
|
|
|
|
2014-06-23 23:48:41 +00:00
|
|
|
add_subdirectory( capchild )
|
2014-07-04 07:24:02 +00:00
|
|
|
add_subdirectory( caputils )
|
2009-10-10 05:57:25 +00:00
|
|
|
add_subdirectory( codecs )
|
2016-02-29 14:48:57 +00:00
|
|
|
add_subdirectory( doc )
|
2015-01-07 00:59:32 +00:00
|
|
|
add_subdirectory( docbook )
|
2009-10-10 05:57:25 +00:00
|
|
|
add_subdirectory( epan )
|
2016-02-15 01:00:38 +00:00
|
|
|
add_subdirectory( randpkt_core )
|
2009-10-10 05:57:25 +00:00
|
|
|
add_subdirectory( tools/lemon )
|
2013-08-01 23:40:06 +00:00
|
|
|
add_subdirectory( ui )
|
2009-10-10 05:57:25 +00:00
|
|
|
add_subdirectory( wiretap )
|
2016-03-24 20:00:07 +00:00
|
|
|
add_subdirectory( writecap )
|
2017-01-10 13:03:55 +00:00
|
|
|
|
|
|
|
# Location of our data files. This should be set to a value that allows
|
2017-04-05 19:15:27 +00:00
|
|
|
# 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.
|
2017-01-10 13:03:55 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
|
|
|
set(_datafile_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Resources/share/wireshark")
|
2017-10-14 19:13:52 +00:00
|
|
|
elseif(NOT CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
# Visual Studio, Xcode, etc.
|
|
|
|
set(_datafile_dir "${CMAKE_BINARY_DIR}/run/${CMAKE_CFG_INTDIR}")
|
2017-01-10 13:03:55 +00:00
|
|
|
else()
|
2017-10-14 19:13:52 +00:00
|
|
|
# Makefile, Ninja, etc.
|
|
|
|
set(_datafile_dir "${CMAKE_BINARY_DIR}/run")
|
2017-01-10 13:03:55 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(DATAFILE_DIR ${_datafile_dir} CACHE INTERNAL "Build time data file location.")
|
|
|
|
|
|
|
|
# wsutil must be added after DATAFILE_DIR is set such that filesystem.c can
|
|
|
|
# learn about the directory location.
|
2009-10-10 05:57:25 +00:00
|
|
|
add_subdirectory( wsutil )
|
|
|
|
|
2014-04-26 22:18:19 +00:00
|
|
|
if(NOT WIN32)
|
2015-12-22 20:07:00 +00:00
|
|
|
add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil)
|
2014-04-26 22:18:19 +00:00
|
|
|
endif()
|
2013-02-25 18:12:20 +00:00
|
|
|
|
2014-08-28 23:48:53 +00:00
|
|
|
if(BUILD_wireshark_gtk AND GTK_FOUND)
|
2012-01-15 21:59:11 +00:00
|
|
|
add_subdirectory( ui/gtk )
|
2010-10-01 12:17:11 +00:00
|
|
|
endif()
|
|
|
|
|
2014-08-28 23:48:53 +00:00
|
|
|
if(BUILD_wireshark AND QT_FOUND)
|
2012-02-02 00:46:02 +00:00
|
|
|
add_subdirectory( ui/qt )
|
|
|
|
endif()
|
|
|
|
|
2018-01-06 20:39:26 +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
|
|
|
|
if (WIN32)
|
|
|
|
set(EXTCAP_DIR "extcap")
|
|
|
|
else ()
|
|
|
|
set(EXTCAP_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CPACK_PACKAGE_NAME}/extcap")
|
2015-04-21 09:08:19 +00:00
|
|
|
endif()
|
|
|
|
|
2015-11-19 10:30:44 +00:00
|
|
|
if(LIBSSH_FOUND)
|
|
|
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LIBSSH_LIBRARIES})
|
|
|
|
CHECK_FUNCTION_EXISTS(ssh_userauth_agent LIBSSH_USERAUTH_AGENT_FOUND)
|
|
|
|
if(LIBSSH_USERAUTH_AGENT_FOUND)
|
|
|
|
set(HAVE_SSH_USERAUTH_AGENT 1)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-11-28 23:44:56 +00:00
|
|
|
# Directory where plugins and Lua dissectors can be found.
|
2017-09-29 18:49:51 +00:00
|
|
|
set(PLUGIN_VERSION_DIR "plugins/${PROJECT_RELEASE_VERSION}")
|
2017-09-06 10:55:40 +00:00
|
|
|
set(PLUGIN_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME}/${PLUGIN_VERSION_DIR}")
|
2017-09-12 09:51:46 +00:00
|
|
|
# Used by the WiresharkConfig.cmake.in module
|
2016-11-28 23:44:56 +00:00
|
|
|
if (WIN32)
|
2017-09-06 10:55:40 +00:00
|
|
|
set(PLUGIN_INSTALL_DIR "${PLUGIN_VERSION_DIR}")
|
2016-11-28 23:44:56 +00:00
|
|
|
else ()
|
2017-09-06 10:55:40 +00:00
|
|
|
set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_LIBDIR}")
|
2016-11-28 23:44:56 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# 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
|
2015-12-04 19:12:45 +00:00
|
|
|
# Windows: $DESTDIR/wireshark/plubins/$VERSION
|
2017-04-05 19:15:27 +00:00
|
|
|
# macOS app bundle: Wireshark.app/Contents/PlugIns/wireshark
|
2015-01-18 21:27:13 +00:00
|
|
|
set(HAVE_PLUGINS 1)
|
2015-01-06 23:07:50 +00:00
|
|
|
add_custom_target(plugins)
|
|
|
|
set_target_properties(plugins PROPERTIES FOLDER "Plugins")
|
2015-01-18 21:27:13 +00:00
|
|
|
set(PLUGIN_SRC_DIRS
|
2018-01-15 12:40:55 +00:00
|
|
|
plugins/epan/docsis
|
|
|
|
plugins/epan/ethercat
|
|
|
|
plugins/epan/gryphon
|
|
|
|
plugins/epan/irda
|
|
|
|
plugins/epan/mate
|
|
|
|
plugins/epan/opcua
|
|
|
|
plugins/epan/profinet
|
|
|
|
plugins/epan/stats_tree
|
|
|
|
plugins/epan/transum
|
|
|
|
plugins/epan/unistim
|
|
|
|
plugins/epan/wimax
|
|
|
|
plugins/epan/wimaxasncp
|
|
|
|
plugins/epan/wimaxmacphy
|
2018-01-26 23:46:32 +00:00
|
|
|
plugins/wiretap/usbdump
|
2015-01-18 21:27:13 +00:00
|
|
|
${CUSTOM_PLUGIN_SRC_DIR}
|
|
|
|
)
|
2017-01-24 16:34:07 +00:00
|
|
|
|
|
|
|
# Build demo plugin, only if asked explicitly
|
|
|
|
if(ENABLE_PLUGIN_IFDEMO)
|
|
|
|
set(PLUGIN_SRC_DIRS
|
|
|
|
${PLUGIN_SRC_DIRS}
|
2018-01-16 15:59:28 +00:00
|
|
|
plugins/epan/pluginifdemo
|
2017-01-24 16:34:07 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2015-01-18 21:27:13 +00:00
|
|
|
else()
|
|
|
|
set(PLUGIN_SRC_DIRS )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2017-09-29 18:49:51 +00:00
|
|
|
set(_plugin_dir "${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/PlugIns/wireshark/${PROJECT_RELEASE_VERSION}")
|
2015-01-18 21:27:13 +00:00
|
|
|
else()
|
2017-10-14 19:13:52 +00:00
|
|
|
set(_plugin_dir "${DATAFILE_DIR}/${PLUGIN_VERSION_DIR}")
|
2015-01-18 21:27:13 +00:00
|
|
|
endif()
|
|
|
|
set (PLUGIN_DIR ${_plugin_dir} CACHE INTERNAL "Build time plugin location.")
|
|
|
|
|
|
|
|
foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS})
|
|
|
|
add_subdirectory( ${_plugin_src_dir} )
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
2010-09-28 19:23:15 +00:00
|
|
|
# Basedir where to install guides
|
2012-02-07 08:05:11 +00:00
|
|
|
set(DOC_DIR "$ENV{docdir}" CACHE FILEPATH "Installation directory for ug and dg pdfs.")
|
2010-09-28 19:23:15 +00:00
|
|
|
message(STATUS "docdir: ${DOC_DIR}")
|
|
|
|
|
2011-06-17 22:57:02 +00:00
|
|
|
if(ENABLE_PCAP_NG_DEFAULT)
|
|
|
|
set(PCAP_NG_DEFAULT 1)
|
|
|
|
endif()
|
|
|
|
|
2013-07-23 09:41:35 +00:00
|
|
|
# Large file support (e.g. make off_t 64 bit if supported)
|
|
|
|
include(gmxTestLargeFiles)
|
|
|
|
gmx_test_large_files(GMX_LARGEFILES)
|
|
|
|
|
2013-10-29 02:28:16 +00:00
|
|
|
add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" )
|
|
|
|
|
2016-01-06 21:20:10 +00:00
|
|
|
if (${GIT_EXECUTABLE})
|
|
|
|
set(GIT_BIN_PARAM "--git-bin ${GIT_EXECUTABLE}")
|
|
|
|
endif()
|
2014-06-20 23:05:27 +00:00
|
|
|
set( VERSION ${PROJECT_VERSION} )
|
2017-08-31 23:22:26 +00:00
|
|
|
if(NOT CMAKE_VERSION VERSION_LESS "3.2.1")
|
|
|
|
# Prevents unnecessary rebuilds by ensuring that dependents are not
|
|
|
|
# built before make-version.pl finishes (which may touch version.h).
|
|
|
|
set(version_byproducts BYPRODUCTS version.h)
|
|
|
|
else()
|
|
|
|
set(version_byproducts "")
|
|
|
|
endif()
|
2016-04-20 22:51:12 +00:00
|
|
|
add_custom_target(version
|
2017-08-31 23:22:26 +00:00
|
|
|
${version_byproducts}
|
2015-08-26 04:50:09 +00:00
|
|
|
COMMAND ${PERL_EXECUTABLE}
|
2016-04-20 22:51:12 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/make-version.pl
|
|
|
|
--set-vcs ${GIT_BIN_PARAM}
|
|
|
|
${CMAKE_SOURCE_DIR}
|
2015-08-26 04:50:09 +00:00
|
|
|
)
|
2016-04-20 22:51:12 +00:00
|
|
|
set_target_properties(version PROPERTIES FOLDER "Auxiliary")
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2015-01-10 21:29:57 +00:00
|
|
|
set(ICON_PATH "${CMAKE_SOURCE_DIR}/image/")
|
2014-06-20 22:38:07 +00:00
|
|
|
set( IN_FILES
|
2014-06-24 03:18:37 +00:00
|
|
|
capchild/doxygen.cfg.in
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils/doxygen.cfg.in
|
2014-06-20 23:05:27 +00:00
|
|
|
doxygen.cfg.in
|
|
|
|
doxygen_global.cfg
|
|
|
|
epan/doxygen.cfg.in
|
2014-06-20 22:38:07 +00:00
|
|
|
image/libwireshark.rc.in
|
|
|
|
image/text2pcap.rc.in
|
|
|
|
image/capinfos.rc.in
|
|
|
|
image/wireshark.rc.in
|
|
|
|
image/mergecap.rc.in
|
|
|
|
image/tshark.rc.in
|
|
|
|
image/dumpcap.rc.in
|
|
|
|
image/reordercap.rc.in
|
|
|
|
image/rawshark.rc.in
|
|
|
|
image/file_dlg_win32.rc
|
|
|
|
image/tfshark.rc.in
|
|
|
|
image/editcap.rc.in
|
|
|
|
image/captype.rc.in
|
2015-12-03 20:32:25 +00:00
|
|
|
image/libwscodecs.rc.in
|
2014-06-20 22:38:07 +00:00
|
|
|
image/libwsutil.rc.in
|
|
|
|
image/wiretap.rc.in
|
2015-01-10 21:29:57 +00:00
|
|
|
image/wireshark.exe.manifest.in
|
2014-06-20 23:05:27 +00:00
|
|
|
packaging/macosx/Info.plist.in
|
2017-10-04 23:27:08 +00:00
|
|
|
packaging/macosx/osx-app.sh.in
|
2014-10-23 17:57:45 +00:00
|
|
|
packaging/macosx/osx-dmg.sh.in
|
|
|
|
packaging/macosx/Wireshark_package.pmdoc/index.xml.in
|
2016-02-15 01:00:38 +00:00
|
|
|
randpkt_core/doxygen.cfg.in
|
2014-06-20 23:05:27 +00:00
|
|
|
ui/doxygen.cfg.in
|
|
|
|
ui/gtk/doxygen.cfg.in
|
|
|
|
ui/qt/doxygen.cfg.in
|
2014-06-20 22:38:07 +00:00
|
|
|
wireshark.pc.in
|
2016-03-24 20:00:07 +00:00
|
|
|
writecap/doxygen.cfg.in
|
2014-06-20 22:38:07 +00:00
|
|
|
)
|
|
|
|
foreach( _in_file ${IN_FILES} )
|
|
|
|
get_filename_component( _path ${_in_file} PATH )
|
|
|
|
string( REGEX REPLACE "(.*)\\.in" "\\1" _outfile ${_in_file} )
|
|
|
|
configure_file( ${CMAKE_SOURCE_DIR}/${_in_file} ${CMAKE_BINARY_DIR}/${_outfile} @ONLY )
|
|
|
|
endforeach()
|
|
|
|
|
2009-09-24 20:42:08 +00:00
|
|
|
include(FeatureSummary)
|
2017-06-25 22:34:41 +00:00
|
|
|
set_package_properties(SBC PROPERTIES
|
|
|
|
DESCRIPTION "Bluetooth low-complexity, subband codec (SBC) decoder"
|
|
|
|
URL "https://git.kernel.org/pub/scm/bluetooth/sbc.git"
|
|
|
|
PURPOSE "Support for playing SBC codec in RTP player"
|
|
|
|
)
|
|
|
|
set_package_properties(SPANDSP PROPERTIES
|
|
|
|
DESCRIPTION "a library of many DSP functions for telephony"
|
|
|
|
URL "http://www.soft-switch.org/"
|
|
|
|
PURPOSE "Support for G.722 and G.726 codecs in RTP player"
|
|
|
|
)
|
2017-07-26 21:23:12 +00:00
|
|
|
set_package_properties(BCG729 PROPERTIES
|
|
|
|
DESCRIPTION "G.729 decoder"
|
|
|
|
URL "https://www.linphone.org/technical-corner/bcg729/overview"
|
|
|
|
PURPOSE "Support for G.729 codec in RTP player"
|
|
|
|
)
|
2017-06-25 22:34:41 +00:00
|
|
|
set_package_properties(LIBXML2 PROPERTIES
|
|
|
|
DESCRIPTION "XML parsing library"
|
|
|
|
URL "http://xmlsoft.org/"
|
|
|
|
PURPOSE "Read XML configuration files in EPL dissector"
|
|
|
|
)
|
|
|
|
set_package_properties(LIBSSH PROPERTIES
|
|
|
|
DESCRIPTION "Library for implementing SSH clients"
|
|
|
|
URL "https://www.libssh.org/"
|
|
|
|
PURPOSE "extcap remote SSH interfaces (sshdump, ciscodump)"
|
|
|
|
)
|
|
|
|
set_package_properties(LZ4 PROPERTIES
|
|
|
|
DESCRIPTION "LZ4 is lossless compression algorithm used in some protocol (CQL...)"
|
|
|
|
URL "http://www.lz4.org"
|
|
|
|
PURPOSE "LZ4 decompression in CQL and Kafka dissectors"
|
|
|
|
)
|
|
|
|
set_package_properties(SNAPPY PROPERTIES
|
|
|
|
DESCRIPTION "A fast compressor/decompressor from Google"
|
|
|
|
URL "http://google.github.io/snappy/"
|
|
|
|
PURPOSE "Snappy decompression in CQL and Kafka dissectors"
|
|
|
|
)
|
|
|
|
set_package_properties(NGHTTP2 PROPERTIES
|
|
|
|
DESCRIPTION "HTTP/2 C library and tools"
|
|
|
|
URL "https://nghttp2.org"
|
|
|
|
PURPOSE "Header decompression in HTTP2"
|
|
|
|
)
|
2017-09-24 08:19:54 +00:00
|
|
|
|
2017-09-24 01:30:08 +00:00
|
|
|
message(STATUS "C-Flags: ${CMAKE_C_FLAGS}")
|
|
|
|
message(STATUS "CXX-Flags: ${CMAKE_CXX_FLAGS}")
|
2017-09-24 08:19:54 +00:00
|
|
|
message(STATUS "Warnings as errors: ${WERROR_COMMON_FLAGS}")
|
|
|
|
|
2017-06-25 22:34:41 +00:00
|
|
|
feature_summary(WHAT ALL)
|
2009-09-24 20:42:08 +00:00
|
|
|
|
2009-06-15 18:59:33 +00:00
|
|
|
link_directories(
|
2012-09-14 20:23:18 +00:00
|
|
|
${CMAKE_BINARY_DIR}/ui
|
2012-01-15 21:59:11 +00:00
|
|
|
${CMAKE_BINARY_DIR}/ui/gtk
|
2012-02-02 00:46:02 +00:00
|
|
|
${CMAKE_BINARY_DIR}/ui/qt
|
2014-06-23 23:48:41 +00:00
|
|
|
${CMAKE_BINARY_DIR}/capchild
|
2014-07-04 07:24:02 +00:00
|
|
|
${CMAKE_BINARY_DIR}/caputils
|
2010-09-10 16:50:12 +00:00
|
|
|
${CMAKE_BINARY_DIR}/codecs
|
|
|
|
${CMAKE_BINARY_DIR}/epan
|
2016-02-15 01:00:38 +00:00
|
|
|
${CMAKE_BINARY_DIR}/randpkt_core
|
2010-09-10 16:50:12 +00:00
|
|
|
${CMAKE_BINARY_DIR}/wiretap
|
2016-03-24 20:00:07 +00:00
|
|
|
${CMAKE_BINARY_DIR}/writecap
|
2010-09-10 16:50:12 +00:00
|
|
|
${CMAKE_BINARY_DIR}/wsutil
|
2009-06-15 18:59:33 +00:00
|
|
|
)
|
2006-10-24 17:39:32 +00:00
|
|
|
|
2009-08-30 06:24:44 +00:00
|
|
|
if(WIN32)
|
2013-10-11 10:32:11 +00:00
|
|
|
set(PLATFORM_UI_SRC
|
2013-10-10 20:35:32 +00:00
|
|
|
ui/win32/console_win32.c
|
|
|
|
ui/win32/file_dlg_win32.c
|
2013-10-11 10:32:11 +00:00
|
|
|
ui/win32/print_win32.c
|
2015-01-07 10:17:14 +00:00
|
|
|
)
|
|
|
|
set(PLATFORM_UI_RC_FILES
|
2014-06-20 23:33:57 +00:00
|
|
|
image/file_dlg_win32.rc
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
2009-08-30 06:24:44 +00:00
|
|
|
endif()
|
2009-06-16 04:12:30 +00:00
|
|
|
|
2016-10-15 18:48:17 +00:00
|
|
|
# sources common for wireshark, tshark, rawshark and sharkd
|
2014-01-08 20:10:17 +00:00
|
|
|
set(SHARK_COMMON_SRC
|
2014-01-09 11:02:29 +00:00
|
|
|
cfile.c
|
2017-12-08 03:31:43 +00:00
|
|
|
file_packet_provider.c
|
2013-07-11 05:47:02 +00:00
|
|
|
frame_tvbuff.c
|
2009-09-08 07:03:57 +00:00
|
|
|
sync_pipe_write.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2018-01-06 20:39:26 +00:00
|
|
|
extcap.c
|
|
|
|
extcap_parser.c
|
|
|
|
extcap_spawn.c
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(TSHARK_TAP_SRC
|
2017-12-10 17:29:40 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-camelsrt.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-comparestat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-diameter-avp.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-expert.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-exportobject.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-endpoints.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-flow.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-follow.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-funnel.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-gsm_astat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-hosts.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-httpstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-icmpstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-icmpv6stat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-iostat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-iousers.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-macltestat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-protocolinfo.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-protohierstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rlcltestat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rpcprogs.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rtd.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rtp.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-rtspstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-sctpchunkstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-simple_stattable.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-sipstat.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-smbsids.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-srt.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-stats_tree.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-sv.c
|
|
|
|
${CMAKE_SOURCE_DIR}/ui/cli/tap-wspstat.c
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
|
2009-09-21 00:19:07 +00:00
|
|
|
set(INSTALL_DIRS
|
|
|
|
diameter
|
|
|
|
dtds
|
2017-08-10 17:20:30 +00:00
|
|
|
${DATAFILE_DIR}/help
|
2016-11-08 17:04:59 +00:00
|
|
|
profiles
|
2009-09-21 00:19:07 +00:00
|
|
|
radius
|
|
|
|
tpncp
|
|
|
|
wimaxasncp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(INSTALL_FILES
|
2009-09-25 02:50:48 +00:00
|
|
|
cfilters
|
|
|
|
colorfilters
|
|
|
|
dfilters
|
2017-07-13 20:03:13 +00:00
|
|
|
enterprises.tsv
|
2009-11-11 16:20:37 +00:00
|
|
|
ipmap.html
|
2009-09-25 02:50:48 +00:00
|
|
|
manuf
|
2011-05-19 18:10:21 +00:00
|
|
|
pdml2html.xsl
|
2009-09-25 02:50:48 +00:00
|
|
|
services
|
|
|
|
smi_modules
|
2017-07-20 01:32:40 +00:00
|
|
|
wka
|
2009-11-11 16:20:37 +00:00
|
|
|
docbook/ws.css
|
2016-03-10 15:50:39 +00:00
|
|
|
${CMAKE_BINARY_DIR}/doc/AUTHORS-SHORT
|
|
|
|
${CMAKE_BINARY_DIR}/doc/androiddump.html
|
2016-02-10 14:45:45 +00:00
|
|
|
${CMAKE_BINARY_DIR}/doc/udpdump.html
|
2016-03-10 15:50:39 +00:00
|
|
|
${CMAKE_BINARY_DIR}/doc/capinfos.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/captype.html
|
2015-11-24 22:03:13 +00:00
|
|
|
${CMAKE_BINARY_DIR}/doc/ciscodump.html
|
2016-03-10 15:50:39 +00:00
|
|
|
${CMAKE_BINARY_DIR}/doc/dftest.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/dumpcap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/editcap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/extcap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/mergecap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/randpkt.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/randpktdump.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/rawshark.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/reordercap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/sshdump.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/text2pcap.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/tshark.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/wireshark.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/wireshark-filter.html
|
2009-09-21 00:19:07 +00:00
|
|
|
)
|
|
|
|
|
2017-08-10 17:20:30 +00:00
|
|
|
if (BUILD_corbaidl2wrs)
|
|
|
|
list(APPEND INSTALL_FILES ${CMAKE_BINARY_DIR}/doc/idl2wrs.html)
|
|
|
|
endif()
|
|
|
|
if (BUILD_xxx2deb)
|
|
|
|
list(APPEND INSTALL_FILES
|
|
|
|
${CMAKE_BINARY_DIR}/doc/asn2deb.html
|
|
|
|
${CMAKE_BINARY_DIR}/doc/idl2deb.html
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2015-01-15 21:07:48 +00:00
|
|
|
if(WIN32)
|
2017-08-11 19:43:48 +00:00
|
|
|
set(TEXTIFY_FILES COPYING NEWS README.windows)
|
2017-08-16 19:26:42 +00:00
|
|
|
set(TEXTIFY_MD_FILES README.md)
|
|
|
|
foreach(_text_file ${TEXTIFY_FILES} ${TEXTIFY_MD_FILES})
|
|
|
|
string(REGEX REPLACE ".md$" "" _out_file ${_text_file})
|
|
|
|
set(INSTALL_FILES ${CMAKE_BINARY_DIR}/${_out_file}.txt ${INSTALL_FILES})
|
2015-01-06 23:07:50 +00:00
|
|
|
endforeach()
|
2015-01-15 21:07:48 +00:00
|
|
|
else()
|
|
|
|
set(INSTALL_FILES COPYING ${INSTALL_FILES})
|
|
|
|
endif()
|
|
|
|
|
2009-09-08 15:56:16 +00:00
|
|
|
set(LIBEPAN_LIBS
|
|
|
|
epan
|
2013-10-10 20:35:32 +00:00
|
|
|
${AIRPCAP_LIBRARIES}
|
2009-09-08 07:03:57 +00:00
|
|
|
${PCAP_LIBRARIES}
|
2009-09-09 13:20:33 +00:00
|
|
|
${CARES_LIBRARIES}
|
2009-09-10 07:04:54 +00:00
|
|
|
${KERBEROS_LIBRARIES}
|
2009-09-09 13:20:33 +00:00
|
|
|
${LUA_LIBRARIES}
|
2009-09-10 07:04:54 +00:00
|
|
|
${PYTHON_LIBRARIES}
|
|
|
|
${GEOIP_LIBRARIES}
|
2009-09-09 13:20:33 +00:00
|
|
|
${GCRYPT_LIBRARIES}
|
|
|
|
${GNUTLS_LIBRARIES}
|
|
|
|
${SMI_LIBRARIES}
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2016-09-26 14:25:11 +00:00
|
|
|
${LZ4_LIBRARIES}
|
|
|
|
${SNAPPY_LIBRARIES}
|
2009-09-10 07:04:54 +00:00
|
|
|
${M_LIBRARIES}
|
2014-08-20 21:29:33 +00:00
|
|
|
${WINSPARKLE_LIBRARIES}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
|
2015-01-12 22:44:42 +00:00
|
|
|
if(WIN32)
|
2017-10-14 19:13:52 +00:00
|
|
|
set(_dll_output_dir "${DATAFILE_DIR}")
|
2015-01-12 22:44:42 +00:00
|
|
|
add_custom_target(copy_cli_dlls)
|
2015-01-15 21:07:48 +00:00
|
|
|
set_target_properties(copy_cli_dlls PROPERTIES FOLDER "Copy Tasks")
|
2015-01-12 22:44:42 +00:00
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${_dll_output_dir}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# XXX Can (and should) we iterate over these similar to the way
|
|
|
|
# the top-level CMakeLists.txt iterates over the package list?
|
|
|
|
|
2015-04-13 17:31:00 +00:00
|
|
|
# Required DLLs.
|
|
|
|
# The cairo, freetype, gio, gnutls, png, and other OBS-generated DLLs
|
|
|
|
# depend on zlib1.dll. We compile zlib locally but the Debug
|
|
|
|
# configuration (the default) creates zlibd1.dll.
|
2018-01-20 00:02:20 +00:00
|
|
|
# Note: Passing multiple files to copy_if_different requires
|
|
|
|
# CMake 3.5 or later.
|
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
${GLIB2_DLLS} $<$<CONFIG:Debug>:zlib1.dll>
|
|
|
|
"${_dll_output_dir}"
|
|
|
|
WORKING_DIRECTORY "${GLIB2_DLL_DIR}"
|
|
|
|
)
|
2015-04-13 20:44:23 +00:00
|
|
|
|
2018-01-20 00:02:20 +00:00
|
|
|
# Optional DLLs.
|
|
|
|
set (OPTIONAL_DLLS)
|
2015-01-12 22:44:42 +00:00
|
|
|
if (AIRPCAP_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${AIRPCAP_DLL_DIR}/${AIRPCAP_DLL}")
|
2015-01-12 22:44:42 +00:00
|
|
|
endif(AIRPCAP_FOUND)
|
|
|
|
if (CARES_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${CARES_DLL_DIR}/${CARES_DLL}")
|
2015-01-12 22:44:42 +00:00
|
|
|
endif(CARES_FOUND)
|
|
|
|
if (GEOIP_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${GEOIP_DLL_DIR}/${GEOIP_DLL}")
|
2015-01-12 22:44:42 +00:00
|
|
|
endif(GEOIP_FOUND)
|
2015-11-19 10:30:44 +00:00
|
|
|
if (LIBSSH_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${LIBSSH_DLL_DIR}/${LIBSSH_DLL}")
|
2015-11-19 10:30:44 +00:00
|
|
|
endif(LIBSSH_FOUND)
|
2017-02-09 14:00:19 +00:00
|
|
|
foreach( _dll ${GCRYPT_DLLS} )
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${GCRYPT_DLL_DIR}/${_dll}")
|
|
|
|
endforeach(_dll)
|
|
|
|
foreach( _dll ${GNUTLS_DLLS} )
|
|
|
|
list (APPEND OPTIONAL_DLLS "${GNUTLS_DLL_DIR}/${_dll}")
|
|
|
|
endforeach(_dll)
|
|
|
|
foreach( _dll ${KERBEROS_DLLS} )
|
|
|
|
list (APPEND OPTIONAL_DLLS "${KERBEROS_DLL_DIR}/${_dll}")
|
2017-02-09 14:00:19 +00:00
|
|
|
endforeach(_dll)
|
2015-01-12 22:44:42 +00:00
|
|
|
if (LUA_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${LUA_DLL_DIR}/${LUA_DLL}")
|
2015-01-12 22:44:42 +00:00
|
|
|
endif(LUA_FOUND)
|
2016-10-17 19:04:49 +00:00
|
|
|
if (LZ4_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${LZ4_DLL_DIR}/${LZ4_DLL}")
|
2016-10-17 19:04:49 +00:00
|
|
|
endif(LZ4_FOUND)
|
2016-08-26 13:18:29 +00:00
|
|
|
if (NGHTTP2_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${NGHTTP2_DLL_DIR}/${NGHTTP2_DLL}")
|
2016-08-26 13:18:29 +00:00
|
|
|
endif(NGHTTP2_FOUND)
|
2016-10-22 16:15:51 +00:00
|
|
|
if (SBC_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${SBC_DLL_DIR}/${SBC_DLL}")
|
2016-10-22 16:15:51 +00:00
|
|
|
endif(SBC_FOUND)
|
2016-11-23 23:27:14 +00:00
|
|
|
if (SPANDSP_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${SPANDSP_DLL_DIR}/${SPANDSP_DLL}")
|
2016-11-23 23:27:14 +00:00
|
|
|
endif(SPANDSP_FOUND)
|
2017-07-26 21:23:12 +00:00
|
|
|
if (BCG729_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${BCG729_DLL_DIR}/${BCG729_DLL}")
|
2017-07-26 21:23:12 +00:00
|
|
|
endif(BCG729_FOUND)
|
2017-04-04 21:23:59 +00:00
|
|
|
if (LIBXML2_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${LIBXML2_DLL_DIR}/${LIBXML2_DLL}")
|
2017-04-04 21:23:59 +00:00
|
|
|
endif(LIBXML2_FOUND)
|
2015-01-12 22:44:42 +00:00
|
|
|
if (SMI_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${SMI_DLL_DIR}/${SMI_DLL}")
|
2015-07-05 11:47:15 +00:00
|
|
|
# Wireshark.nsi wants SMI_DIR which is the base SMI directory
|
|
|
|
get_filename_component(SMI_DIR ${SMI_DLL_DIR} DIRECTORY)
|
2015-01-12 22:44:42 +00:00
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory
|
|
|
|
"${_dll_output_dir}/snmp"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/iana"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/ietf"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/irtf"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/site"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/mibs/tubs"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/pibs"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
2016-05-08 20:46:48 +00:00
|
|
|
"${SMI_SHARE_DIR}/yang"
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}/snmp/mibs"
|
2016-04-07 23:03:51 +00:00
|
|
|
#remove the extra directories copied (shallow copying the above would remove the need for this)
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs/iana"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs/ietf"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs/site"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory
|
|
|
|
"${_dll_output_dir}/snmp/mibs/tubs"
|
2015-01-12 22:44:42 +00:00
|
|
|
)
|
|
|
|
endif(SMI_FOUND)
|
2016-10-17 19:04:49 +00:00
|
|
|
if (SNAPPY_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${SNAPPY_DLL_DIR}/${SNAPPY_DLL}")
|
2016-10-17 19:04:49 +00:00
|
|
|
endif(SNAPPY_FOUND)
|
2015-01-12 22:44:42 +00:00
|
|
|
if (WINSPARKLE_FOUND)
|
2018-01-20 00:02:20 +00:00
|
|
|
list (APPEND OPTIONAL_DLLS "${WINSPARKLE_DLL_DIR}/${WINSPARKLE_DLL}")
|
|
|
|
endif(WINSPARKLE_FOUND)
|
|
|
|
|
|
|
|
# With libs downloaded to c:/wireshark-win64-libs this currently
|
|
|
|
# (early 2018) expands to about 1900 characters.
|
|
|
|
if (OPTIONAL_DLLS)
|
2015-01-12 22:44:42 +00:00
|
|
|
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2018-01-20 00:02:20 +00:00
|
|
|
${OPTIONAL_DLLS}
|
2015-01-12 22:44:42 +00:00
|
|
|
"${_dll_output_dir}"
|
2018-01-20 00:02:20 +00:00
|
|
|
VERBATIM
|
2015-01-12 22:44:42 +00:00
|
|
|
)
|
2018-01-20 00:02:20 +00:00
|
|
|
endif(OPTIONAL_DLLS)
|
2015-01-12 22:44:42 +00:00
|
|
|
|
2018-01-12 23:46:38 +00:00
|
|
|
# This might not be needed since make-dissectors has the same dependency.
|
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.
|
|
|
|
# - Cygwin's zip, which requires Cygwin.
|
|
|
|
# - "CMake -E tar cz", which creates a tar file.
|
|
|
|
# - CPack, which requires a CPack configuration.
|
|
|
|
# - PowerShell via PSCX or System.IO.Compression.FileSystem.
|
|
|
|
# - Python via zipfile.
|
|
|
|
# For now, just look for 7z. It's installed on the Windows builders,
|
|
|
|
# which might be the only systems that use this target.
|
|
|
|
find_program(ZIP_EXECUTABLE 7z
|
|
|
|
PATH "$ENV{PROGRAMFILES}/7-Zip" "$ENV{PROGRAMW6432}/7-Zip"
|
|
|
|
DOC "Path to the 7z utility."
|
|
|
|
)
|
2015-01-19 21:33:01 +00:00
|
|
|
# XXX "if(ZIP_EXECUTABLE)" doesn't work here. It looks like the
|
|
|
|
# absence of "-NOTFOUND" doesn't equal "true".
|
2015-01-19 21:33:01 +00:00
|
|
|
if (NOT "${ZIP_EXECUTABLE}" STREQUAL "ZIP_EXECUTABLE-NOTFOUND")
|
|
|
|
add_custom_target(pdb_zip_package)
|
|
|
|
set_target_properties(pdb_zip_package PROPERTIES FOLDER "Packaging")
|
|
|
|
set(_pdb_zip "${CMAKE_BINARY_DIR}/Wireshark-pdb-${WIRESHARK_TARGET_PLATFORM}-${VERSION}.zip")
|
|
|
|
file(TO_NATIVE_PATH "${_pdb_zip}" _pdb_zip_win)
|
|
|
|
add_custom_command(TARGET pdb_zip_package POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove -f "${_pdb_zip}"
|
2015-01-19 21:33:01 +00:00
|
|
|
COMMAND ${ZIP_EXECUTABLE} a -tzip -mmt=on "${_pdb_zip_win}" *.pdb *.lib
|
2015-01-19 21:33:01 +00:00
|
|
|
WORKING_DIRECTORY "${_dll_output_dir}"
|
|
|
|
)
|
|
|
|
add_dependencies(pdb_zip_package epan)
|
|
|
|
endif()
|
2015-01-15 21:07:48 +00:00
|
|
|
endif(WIN32)
|
|
|
|
|
2015-11-25 10:08:16 +00:00
|
|
|
# List of extra dependencies for the "copy_data_files" target
|
2015-11-21 23:16:08 +00:00
|
|
|
set(copy_data_files_depends)
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2015-11-21 23:16:08 +00:00
|
|
|
# glob patterns relative to the source directory that should be copied to
|
|
|
|
# ${DATAFILE_DIR} (including directory prefixes)
|
|
|
|
set(DATA_FILES_SRC
|
|
|
|
"help/toc"
|
|
|
|
)
|
|
|
|
|
2015-01-15 21:07:48 +00:00
|
|
|
if(WIN32)
|
2015-01-06 23:07:50 +00:00
|
|
|
foreach(_text_file ${TEXTIFY_FILES})
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${_text_file}.txt
|
|
|
|
COMMAND ${POWERSHELL_COMMAND} "${CMAKE_SOURCE_DIR}/tools/textify.ps1"
|
|
|
|
-Destination ${CMAKE_BINARY_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}/${_text_file}
|
|
|
|
DEPENDS
|
|
|
|
${CMAKE_SOURCE_DIR}/${_text_file}
|
|
|
|
)
|
|
|
|
endforeach()
|
2017-08-16 19:26:42 +00:00
|
|
|
foreach(_md_file ${TEXTIFY_MD_FILES})
|
|
|
|
string(REGEX REPLACE ".md$" ".txt" _text_file ${_md_file})
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${_text_file}
|
|
|
|
COMMAND ${POWERSHELL_COMMAND} "${CMAKE_SOURCE_DIR}/tools/textify.ps1"
|
|
|
|
-Destination ${CMAKE_BINARY_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}/${_md_file}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E rename
|
|
|
|
${CMAKE_BINARY_DIR}/${_md_file}.txt
|
|
|
|
${CMAKE_BINARY_DIR}/${_text_file}
|
|
|
|
DEPENDS
|
|
|
|
${CMAKE_SOURCE_DIR}/${_text_file}
|
|
|
|
)
|
|
|
|
endforeach()
|
2015-01-12 22:44:42 +00:00
|
|
|
endif()
|
|
|
|
|
2015-01-15 21:07:48 +00:00
|
|
|
foreach(_install_file ${INSTALL_FILES})
|
2017-06-17 07:42:14 +00:00
|
|
|
get_filename_component(_install_file_src "${_install_file}" ABSOLUTE)
|
2015-01-15 21:07:48 +00:00
|
|
|
get_filename_component(_install_basename "${_install_file}" NAME)
|
2015-11-21 23:16:08 +00:00
|
|
|
set(_output_file "${DATAFILE_DIR}/${_install_basename}")
|
|
|
|
add_custom_command(OUTPUT "${_output_file}"
|
2018-01-20 00:02:20 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2017-06-17 07:42:14 +00:00
|
|
|
"${_install_file_src}"
|
2015-11-21 23:16:08 +00:00
|
|
|
"${_output_file}"
|
|
|
|
DEPENDS
|
2016-03-10 15:50:39 +00:00
|
|
|
docs
|
2015-11-21 23:16:08 +00:00
|
|
|
"${_install_file}"
|
2015-01-15 21:07:48 +00:00
|
|
|
)
|
2015-11-21 23:16:08 +00:00
|
|
|
list(APPEND copy_data_files_depends "${_output_file}")
|
2015-01-15 21:07:48 +00:00
|
|
|
endforeach()
|
|
|
|
|
2018-01-06 20:39:26 +00:00
|
|
|
# Ensure "run/extcap" exists
|
|
|
|
add_custom_command(OUTPUT "${DATAFILE_DIR}/extcap"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory
|
|
|
|
"${DATAFILE_DIR}/extcap"
|
|
|
|
)
|
|
|
|
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/extcap")
|
2017-08-10 17:20:30 +00:00
|
|
|
|
|
|
|
# faq.txt is handled separately below.
|
|
|
|
set(_help_source_files
|
2015-12-29 22:50:57 +00:00
|
|
|
help/capture_filters.txt
|
|
|
|
help/capturing.txt
|
|
|
|
help/display_filters.txt
|
|
|
|
help/getting_started.txt
|
|
|
|
help/overview.txt
|
|
|
|
)
|
2017-08-10 17:20:30 +00:00
|
|
|
|
2015-01-15 21:07:48 +00:00
|
|
|
if(WIN32)
|
2015-11-25 10:08:16 +00:00
|
|
|
file(TO_NATIVE_PATH "${DATAFILE_DIR}/help" _help_dest_dir)
|
2017-08-10 17:20:30 +00:00
|
|
|
foreach(_help_file IN LISTS _help_source_files)
|
2015-11-25 10:08:16 +00:00
|
|
|
add_custom_command(OUTPUT "${DATAFILE_DIR}/${_help_file}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/help"
|
|
|
|
COMMAND ${POWERSHELL_COMMAND} "${CMAKE_SOURCE_DIR}/tools/textify.ps1"
|
|
|
|
-Destination "${_help_dest_dir}"
|
|
|
|
"${CMAKE_SOURCE_DIR}/${_help_file}"
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/${_help_file}"
|
|
|
|
)
|
|
|
|
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/${_help_file}")
|
|
|
|
endforeach()
|
2015-01-15 21:07:48 +00:00
|
|
|
else()
|
2017-08-10 17:20:30 +00:00
|
|
|
list(APPEND DATA_FILES_SRC ${_help_source_files})
|
2015-01-15 21:07:48 +00:00
|
|
|
endif(WIN32)
|
2015-11-21 23:16:08 +00:00
|
|
|
|
|
|
|
# Create help/faq.txt when missing
|
2015-12-05 17:12:50 +00:00
|
|
|
add_custom_command(OUTPUT "${DATAFILE_DIR}/help/faq.txt"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/help"
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/help/faq.py -b > faq.tmp.html
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
|
|
|
|
faq.tmp.html > "${DATAFILE_DIR}/help/faq.txt"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove faq.tmp.html
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/help/faq.py"
|
|
|
|
"${CMAKE_SOURCE_DIR}/tools/html2text.py"
|
|
|
|
)
|
|
|
|
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/help/faq.txt")
|
2015-01-06 23:07:50 +00:00
|
|
|
|
2015-11-21 23:16:08 +00:00
|
|
|
# Install LUA files in staging directory such that LUA can used when Wireshark
|
|
|
|
# is ran from the build directory. For install targets, see
|
|
|
|
# epan/wslua/CMakeLists.txt
|
2015-12-30 18:26:59 +00:00
|
|
|
if(LUA_FOUND AND ENABLE_LUA)
|
2015-11-21 23:16:08 +00:00
|
|
|
set(_lua_files
|
|
|
|
"${CMAKE_BINARY_DIR}/epan/wslua/init.lua"
|
|
|
|
"${CMAKE_SOURCE_DIR}/epan/wslua/console.lua"
|
|
|
|
"${CMAKE_SOURCE_DIR}/epan/wslua/dtd_gen.lua"
|
2015-01-15 21:07:48 +00:00
|
|
|
)
|
2015-11-21 23:16:08 +00:00
|
|
|
foreach(_lua_file ${_lua_files})
|
|
|
|
get_filename_component(_lua_filename "${_lua_file}" NAME)
|
|
|
|
list(APPEND copy_data_files_depends
|
|
|
|
"${DATAFILE_DIR}/${_lua_filename}")
|
|
|
|
add_custom_command(OUTPUT "${DATAFILE_DIR}/${_lua_filename}"
|
2018-01-20 00:02:20 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2015-11-21 23:16:08 +00:00
|
|
|
"${_lua_file}"
|
|
|
|
"${DATAFILE_DIR}/${_lua_filename}"
|
|
|
|
DEPENDS
|
2015-11-25 10:08:16 +00:00
|
|
|
wsluaauxiliary
|
2015-11-21 23:16:08 +00:00
|
|
|
"${_lua_file}"
|
|
|
|
)
|
|
|
|
endforeach()
|
2016-01-18 21:50:42 +00:00
|
|
|
endif(LUA_FOUND AND ENABLE_LUA)
|
2015-01-15 21:07:48 +00:00
|
|
|
# doc/*.html handled elsewhere.
|
2015-11-21 23:16:08 +00:00
|
|
|
|
|
|
|
# TODO shouldn't this use full (relative) paths instead of glob patterns?
|
|
|
|
list(APPEND DATA_FILES_SRC
|
|
|
|
"tpncp/tpncp.dat"
|
2015-11-24 09:16:48 +00:00
|
|
|
"wimaxasncp/*.dtd"
|
2015-11-21 23:16:08 +00:00
|
|
|
"wimaxasncp/*.xml"
|
2015-01-15 21:07:48 +00:00
|
|
|
)
|
2015-11-21 23:16:08 +00:00
|
|
|
|
|
|
|
# Copy all paths from the source tree to the data directory. Directories are
|
|
|
|
# automatically created if missing as the filename is given.
|
2018-01-20 00:02:20 +00:00
|
|
|
# TODO Switch to cmake -E copy_if_different when our minimum CMake version
|
|
|
|
# is >= 3.5 everywhere.
|
2015-11-21 23:16:08 +00:00
|
|
|
file(GLOB _data_files RELATIVE "${CMAKE_SOURCE_DIR}" ${DATA_FILES_SRC})
|
|
|
|
foreach(_data_file ${_data_files})
|
|
|
|
add_custom_command(OUTPUT "${DATAFILE_DIR}/${_data_file}"
|
2018-01-20 00:02:20 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
2015-11-21 23:16:08 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/${_data_file}"
|
|
|
|
"${DATAFILE_DIR}/${_data_file}"
|
|
|
|
DEPENDS
|
|
|
|
"${CMAKE_SOURCE_DIR}/${_data_file}"
|
2015-01-15 21:07:48 +00:00
|
|
|
)
|
2015-11-21 23:16:08 +00:00
|
|
|
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/${_data_file}")
|
2015-01-15 21:07:48 +00:00
|
|
|
endforeach()
|
2015-11-21 23:16:08 +00:00
|
|
|
|
2018-01-24 21:01:17 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.5)
|
|
|
|
# To bad -u / --update is a GNU extension.
|
|
|
|
set (MULTI_COPY_COMMAND cp)
|
2018-01-23 20:05:10 +00:00
|
|
|
else()
|
2018-01-24 21:01:17 +00:00
|
|
|
set (MULTI_COPY_COMMAND ${CMAKE_COMMAND} -E copy_if_different)
|
2018-01-23 20:05:10 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT "${DATAFILE_DIR}/dtds" "${DATAFILE_DIR}/diameter" "${DATAFILE_DIR}/radius"
|
2018-01-24 21:01:17 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/dtds"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/diameter"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/radius"
|
2018-01-23 20:05:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB _dtds_src_files RELATIVE "${CMAKE_SOURCE_DIR}" "dtds/*.dtd")
|
|
|
|
|
|
|
|
set (_dtds_data_files)
|
|
|
|
foreach(_data_file ${_dtds_src_files})
|
|
|
|
list(APPEND _dtds_data_files "${DATAFILE_DIR}/${_data_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_dtds_data_files}
|
|
|
|
COMMAND ${MULTI_COPY_COMMAND}
|
|
|
|
${_dtds_src_files}
|
|
|
|
"${DATAFILE_DIR}/dtds"
|
|
|
|
VERBATIM
|
|
|
|
DEPENDS "${DATAFILE_DIR}/dtds"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB _diameter_src_files RELATIVE "${CMAKE_SOURCE_DIR}"
|
|
|
|
diameter/*.dtd
|
|
|
|
diameter/*.xml
|
|
|
|
)
|
|
|
|
|
|
|
|
set (_diameter_data_files)
|
|
|
|
foreach(_data_file ${_diameter_src_files})
|
|
|
|
list(APPEND _diameter_data_files "${DATAFILE_DIR}/${_data_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_diameter_data_files}
|
|
|
|
COMMAND ${MULTI_COPY_COMMAND}
|
|
|
|
${_diameter_src_files}
|
|
|
|
"${DATAFILE_DIR}/diameter"
|
|
|
|
VERBATIM
|
|
|
|
DEPENDS "${DATAFILE_DIR}/diameter"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB _radius_src_files RELATIVE "${CMAKE_SOURCE_DIR}"
|
|
|
|
radius/README.radius_dictionary
|
|
|
|
radius/custom.includes
|
|
|
|
radius/dictionary
|
|
|
|
radius/dictionary.*
|
|
|
|
)
|
|
|
|
|
|
|
|
set (_radius_data_files)
|
|
|
|
foreach(_data_file ${_radius_src_files})
|
|
|
|
list(APPEND _radius_data_files "${DATAFILE_DIR}/${_data_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_radius_data_files}
|
|
|
|
COMMAND ${MULTI_COPY_COMMAND}
|
|
|
|
${_radius_src_files}
|
|
|
|
"${DATAFILE_DIR}/radius"
|
|
|
|
VERBATIM
|
|
|
|
DEPENDS "${DATAFILE_DIR}/radius"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB _profiles_src_files RELATIVE "${CMAKE_SOURCE_DIR}" profiles/*/*)
|
|
|
|
set (_profiles_data_files)
|
|
|
|
foreach(_data_file ${_profiles_src_files})
|
|
|
|
list(APPEND _profiles_data_files "${DATAFILE_DIR}/${_data_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_profiles_data_files}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
"${CMAKE_SOURCE_DIR}/profiles" "${DATAFILE_DIR}/profiles"
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND copy_data_files_depends
|
|
|
|
${_dtds_data_files}
|
|
|
|
${_diameter_data_files}
|
|
|
|
${_radius_data_files}
|
|
|
|
${_profiles_data_files}
|
|
|
|
)
|
|
|
|
|
2015-11-25 10:08:16 +00:00
|
|
|
# Copy files including ${INSTALL_FILES} and ${INSTALL_DIRS} to ${DATAFILE_DIR}
|
2018-01-23 20:05:10 +00:00
|
|
|
add_custom_target(copy_data_files ALL DEPENDS ${copy_data_files_depends} )
|
2015-11-25 10:08:16 +00:00
|
|
|
set_target_properties(copy_data_files PROPERTIES FOLDER "Copy Tasks")
|
2015-01-15 21:07:48 +00:00
|
|
|
|
2014-09-05 18:17:17 +00:00
|
|
|
if( (BUILD_wireshark AND QT_FOUND) OR (BUILD_wireshark_gtk AND GTK_FOUND) )
|
2014-07-31 21:17:07 +00:00
|
|
|
set(WIRESHARK_SRC
|
2009-09-08 07:03:57 +00:00
|
|
|
capture_info.c
|
|
|
|
capture_opts.c
|
|
|
|
file.c
|
|
|
|
fileset.c
|
|
|
|
summary.c
|
2014-01-08 20:10:17 +00:00
|
|
|
${SHARK_COMMON_SRC}
|
2013-10-11 10:32:11 +00:00
|
|
|
${PLATFORM_UI_SRC}
|
2014-07-31 21:17:07 +00:00
|
|
|
)
|
|
|
|
set(wireshark_FILES
|
|
|
|
${WIRESHARK_SRC}
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/wireshark.rc
|
2015-01-07 10:17:14 +00:00
|
|
|
${PLATFORM_UI_RC_FILES}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
2012-02-02 00:46:02 +00:00
|
|
|
endif()
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2014-10-23 15:41:39 +00:00
|
|
|
#
|
|
|
|
# Add -Wl,-single_module to the LDFLAGS used with shared
|
|
|
|
# libraries, to fix some error that show up in some cases;
|
|
|
|
# some Apple documentation recommends it for most shared
|
|
|
|
# libraries.
|
|
|
|
#
|
|
|
|
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-single_module ${CMAKE_SHARED_LINKER_FLAGS}" )
|
|
|
|
#
|
|
|
|
# Add -Wl,-headerpad_max_install_names to the LDFLAGS, as
|
|
|
|
# code-signing issues is running out of padding space.
|
|
|
|
#
|
|
|
|
# Add -Wl,-search_paths_first to make sure that if we search
|
|
|
|
# directories A and B, in that order, for a given library, a
|
|
|
|
# non-shared version in directory A, rather than a shared
|
|
|
|
# version in directory B, is chosen (so we can use
|
|
|
|
# --with-pcap=/usr/local to force all programs to be linked
|
|
|
|
# with a static version installed in /usr/local/lib rather than
|
|
|
|
# the system version in /usr/lib).
|
|
|
|
#
|
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS
|
2015-07-13 02:54:15 +00:00
|
|
|
"-Wl,-headerpad_max_install_names -Wl,-search_paths_first ${CMAKE_EXE_LINKER_FLAGS}"
|
2014-10-23 15:41:39 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Add files to the app bundle
|
2014-10-09 18:37:27 +00:00
|
|
|
# Wireshark.app/Contents
|
2015-02-01 21:56:39 +00:00
|
|
|
file(WRITE ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo "APPLWshk\n")
|
2014-10-09 18:37:27 +00:00
|
|
|
set(BUNDLE_CONTENTS_FILES
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo
|
|
|
|
)
|
|
|
|
set_source_files_properties(${BUNDLE_CONTENTS_FILES} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION .
|
|
|
|
)
|
|
|
|
|
|
|
|
# Wireshark.app/Contents/Resources
|
|
|
|
set(BUNDLE_RESOURCE_FILES
|
2016-03-11 21:45:54 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/Wireshark.icns
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/Wiresharkdoc.icns
|
2014-10-09 18:37:27 +00:00
|
|
|
)
|
|
|
|
set_source_files_properties(${BUNDLE_RESOURCE_FILES} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources
|
|
|
|
)
|
|
|
|
|
2014-10-10 15:32:51 +00:00
|
|
|
# Wireshark.app/Contents/Resources/share/man/man1
|
|
|
|
set_source_files_properties(${BUNDLE_RESOURCE_SHARE_MAN1_FILES} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources/share/man/man1
|
2016-10-12 19:55:54 +00:00
|
|
|
GENERATED 1
|
2014-10-10 15:32:51 +00:00
|
|
|
)
|
|
|
|
|
2016-10-27 15:54:41 +00:00
|
|
|
# Wireshark.app/Contents/Resources/share/man/man4
|
2014-10-10 15:32:51 +00:00
|
|
|
set_source_files_properties(${BUNDLE_RESOURCE_SHARE_MAN4_FILES} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources/share/man/man4
|
2016-10-12 19:55:54 +00:00
|
|
|
GENERATED 1
|
2014-10-10 15:32:51 +00:00
|
|
|
)
|
|
|
|
|
2015-01-15 21:07:48 +00:00
|
|
|
# INSTALL_FILES and INSTALL_DIRS are handled by copy_data_files
|
2014-10-10 15:32:51 +00:00
|
|
|
|
|
|
|
set(EXTRA_BUNDLE_FILES
|
|
|
|
${BUNDLE_CONTENTS_FILES}
|
|
|
|
${BUNDLE_RESOURCE_FILES}
|
|
|
|
${BUNDLE_RESOURCE_SHARE_MAN1_FILES}
|
|
|
|
${BUNDLE_RESOURCE_SHARE_MAN4_FILES}
|
|
|
|
)
|
2014-10-09 18:37:27 +00:00
|
|
|
else()
|
|
|
|
set(EXTRA_BUNDLE_FILES)
|
|
|
|
endif()
|
|
|
|
|
2014-08-28 23:48:53 +00:00
|
|
|
if(BUILD_wireshark AND QT_FOUND)
|
|
|
|
set(wireshark_LIBS
|
2012-02-02 00:46:02 +00:00
|
|
|
qtui
|
2012-09-15 02:52:29 +00:00
|
|
|
ui
|
2014-06-23 23:48:41 +00:00
|
|
|
capchild
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils
|
2012-02-02 00:46:02 +00:00
|
|
|
${QT_LIBRARIES}
|
|
|
|
${GTHREAD2_LIBRARIES}
|
2015-12-04 01:47:27 +00:00
|
|
|
wscodecs
|
2012-02-02 00:46:02 +00:00
|
|
|
${LIBEPAN_LIBS}
|
2012-11-22 18:19:37 +00:00
|
|
|
${APPLE_APPLICATION_SERVICES_LIBRARY}
|
2012-11-22 16:49:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2012-09-06 10:37:17 +00:00
|
|
|
${NL_LIBRARIES}
|
2016-08-03 19:14:23 +00:00
|
|
|
${WIN_VERSION_LIBRARY}
|
2012-02-02 00:46:02 +00:00
|
|
|
)
|
|
|
|
|
2015-04-16 16:39:51 +00:00
|
|
|
add_executable(wireshark WIN32 MACOSX_BUNDLE wireshark-qt.cpp ${wireshark_FILES} ${EXTRA_BUNDLE_FILES})
|
2018-01-25 13:11:57 +00:00
|
|
|
if(QT_VERSION EQUAL 4)
|
|
|
|
target_compile_definitions(wireshark PRIVATE Q_NULLPTR=NULL)
|
|
|
|
endif()
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(wireshark version)
|
2015-02-01 21:56:39 +00:00
|
|
|
set(PROGLIST ${PROGLIST} wireshark)
|
2017-10-17 02:34:35 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS "2.8.12"
|
|
|
|
AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
|
|
|
AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
|
|
|
|
#
|
|
|
|
# https://doc.qt.io/qt-5/cmake-manual.html says that for CMake
|
|
|
|
# versions older than 2.8.12,
|
|
|
|
# Qt5<Module>_EXECUTABLE_COMPILE_FLAGS must be added such that
|
|
|
|
# -fPIC is included. We should not do add this to
|
|
|
|
# CMAKE_CXX_FLAGS though since it may end up before the -fPIE
|
|
|
|
# option. Instead, add it to the target COMPILE_FLAGS. This
|
|
|
|
# option is deprecated in newer CMake versions and not necessary
|
|
|
|
# either since Qt uses the INTERFACE_COMPILE_OPTIONS property.
|
|
|
|
#
|
|
|
|
set_target_properties(wireshark PROPERTIES COMPILE_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
|
|
|
endif()
|
2017-09-24 01:30:08 +00:00
|
|
|
set_target_properties(wireshark PROPERTIES
|
|
|
|
LINK_FLAGS "${WS_LINK_FLAGS}"
|
|
|
|
FOLDER "Executables"
|
|
|
|
)
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE OR WIN32)
|
|
|
|
set_target_properties(wireshark PROPERTIES OUTPUT_NAME Wireshark)
|
|
|
|
endif()
|
2015-02-01 21:56:39 +00:00
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2016-10-19 13:54:32 +00:00
|
|
|
add_dependencies(wireshark manpages)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_target_properties(
|
|
|
|
wireshark PROPERTIES
|
|
|
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/packaging/macosx/Info.plist
|
|
|
|
)
|
2015-01-20 17:43:33 +00:00
|
|
|
# Add a wrapper script which opens the bundle. This adds
|
|
|
|
# convenience but makes debugging more difficult.
|
|
|
|
file(REMOVE ${CMAKE_BINARY_DIR}/run/wireshark)
|
|
|
|
file(WRITE ${CMAKE_BINARY_DIR}/run/wireshark "#!/bin/sh\n")
|
2016-06-28 17:35:27 +00:00
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "# Generated by ${CMAKE_CURRENT_LIST_FILE}\n")
|
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/run/wireshark "exec ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/MacOS/Wireshark \"\$\@\"\n")
|
2015-01-20 17:43:33 +00:00
|
|
|
execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/wireshark)
|
2014-10-09 18:37:27 +00:00
|
|
|
endif()
|
|
|
|
|
2015-07-15 23:46:51 +00:00
|
|
|
target_link_libraries(wireshark ${wireshark_LIBS})
|
2014-10-09 18:37:27 +00:00
|
|
|
install(
|
|
|
|
TARGETS wireshark
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
)
|
2014-09-05 18:17:17 +00:00
|
|
|
|
2014-10-10 15:32:51 +00:00
|
|
|
if(NOT ENABLE_APPLICATION_BUNDLE)
|
|
|
|
# Map for endpoints dialog
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
TARGET wireshark
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
"${PROJECT_SOURCE_DIR}/ipmap.html"
|
|
|
|
$<TARGET_FILE_DIR:wireshark>
|
|
|
|
)
|
|
|
|
endif()
|
2015-01-13 21:32:12 +00:00
|
|
|
|
|
|
|
if(WIN32 AND Qt5Core_FOUND)
|
|
|
|
# Use windeployqt to copy our required DLLs to the run path.
|
2015-01-13 21:32:12 +00:00
|
|
|
# Ideally one of the modules in ${QTDIR}/lib/cmake would expose
|
|
|
|
# the path to windeployqt. For that matter having a reliable
|
|
|
|
# path to qmake would be *amazingly convenient*. We don't have
|
|
|
|
# either of those so we try to discover the path via Qt5Core.
|
|
|
|
# http://stackoverflow.com/questions/24650936/qt5-with-cmake-how-to-find-qt-translations-dir
|
|
|
|
|
2015-01-13 21:32:12 +00:00
|
|
|
get_target_property(_qmake_location Qt5::qmake IMPORTED_LOCATION)
|
2015-01-06 23:07:50 +00:00
|
|
|
get_filename_component(_qt_bin_path "${_qmake_location}" DIRECTORY)
|
2015-01-15 16:34:52 +00:00
|
|
|
find_program(QT_WINDEPLOYQT_EXECUTABLE windeployqt
|
|
|
|
HINTS "${_qmake_location}"
|
|
|
|
DOC "Path to the windeployqt utility."
|
|
|
|
)
|
|
|
|
if (NOT "${QT_WINDEPLOYQT_EXECUTABLE}" STREQUAL "QT_WINDEPLOYQT_EXECUTABLE-NOTFOUND")
|
2015-01-06 23:07:50 +00:00
|
|
|
set(QT_BIN_PATH "${_qt_bin_path}" CACHE INTERNAL
|
|
|
|
"Path to qmake, windeployqt, and other Qt utilities."
|
|
|
|
)
|
2015-01-13 21:32:12 +00:00
|
|
|
add_custom_target(copy_qt_dlls ALL)
|
2015-01-15 21:07:48 +00:00
|
|
|
set_target_properties(copy_qt_dlls PROPERTIES FOLDER "Copy Tasks")
|
2015-01-13 21:32:12 +00:00
|
|
|
# Will we ever need to use --debug? Windeployqt seems to
|
|
|
|
# be smart enough to copy debug DLLs when needed.
|
2015-01-14 22:59:21 +00:00
|
|
|
add_custom_command(TARGET copy_qt_dlls
|
|
|
|
POST_BUILD
|
2016-11-29 23:11:06 +00:00
|
|
|
COMMAND set "PATH=${QT_BIN_PATH};%PATH%"
|
2015-01-15 16:34:52 +00:00
|
|
|
COMMAND "${QT_WINDEPLOYQT_EXECUTABLE}"
|
2015-01-14 22:59:21 +00:00
|
|
|
$<$<CONFIG:Debug>:--debug>
|
|
|
|
$<$<NOT:$<CONFIG:Debug>>:--release>
|
|
|
|
--no-compiler-runtime
|
2015-10-22 20:03:14 +00:00
|
|
|
--verbose 10
|
2015-01-13 21:32:12 +00:00
|
|
|
"$<TARGET_FILE:wireshark>"
|
|
|
|
)
|
|
|
|
add_dependencies(copy_qt_dlls wireshark)
|
|
|
|
endif()
|
2015-01-15 21:07:48 +00:00
|
|
|
endif(WIN32 AND Qt5Core_FOUND)
|
2014-09-05 18:17:17 +00:00
|
|
|
endif()
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
# Common properties for CLI executables
|
|
|
|
macro(set_extra_executable_properties _executable _folder)
|
|
|
|
set_target_properties(${_executable} PROPERTIES
|
|
|
|
LINK_FLAGS "${WS_LINK_FLAGS}"
|
|
|
|
FOLDER ${_folder}
|
|
|
|
)
|
|
|
|
|
2015-02-01 21:56:39 +00:00
|
|
|
set(PROGLIST ${PROGLIST} ${_executable})
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
|
|
|
set_target_properties(${_executable} PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY run/Wireshark.app/Contents/MacOS
|
|
|
|
)
|
2015-01-20 17:43:33 +00:00
|
|
|
# Add a wrapper script which runs each executable from the
|
|
|
|
# correct location. This adds convenience but makes debugging
|
|
|
|
# more difficult.
|
|
|
|
file(REMOVE ${CMAKE_BINARY_DIR}/run/${_executable})
|
|
|
|
file(WRITE ${CMAKE_BINARY_DIR}/run/${_executable} "#!/bin/sh\n")
|
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/run/${_executable} "exec ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/MacOS/${_executable} \"\$\@\"\n")
|
|
|
|
execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/${_executable})
|
2014-10-09 18:37:27 +00:00
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
2015-04-15 23:22:26 +00:00
|
|
|
macro(set_extcap_executable_properties _executable)
|
2015-11-19 10:30:44 +00:00
|
|
|
set_target_properties(${_executable} PROPERTIES FOLDER "Executables/Extcaps")
|
2015-04-15 23:22:26 +00:00
|
|
|
|
|
|
|
set(PROGLIST ${PROGLIST} ${_executable})
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set_target_properties(${_executable} PROPERTIES
|
2015-04-16 16:39:51 +00:00
|
|
|
LINK_FLAGS "${WS_LINK_FLAGS}"
|
2015-04-15 23:22:26 +00:00
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/extcap
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/run/Debug/extcap
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/run/Release/extcap
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/run/MinSizeRel/extcap
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/run/RelWithDebInfo/extcap
|
|
|
|
)
|
|
|
|
else()
|
2015-04-16 06:04:58 +00:00
|
|
|
set_target_properties(${_executable} PROPERTIES
|
|
|
|
LINK_FLAGS "${WS_LINK_FLAGS}"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/extcap
|
|
|
|
)
|
2015-04-16 18:38:04 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
|
|
|
set_target_properties(${_executable} PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY run/Wireshark.app/Contents/MacOS/extcap
|
|
|
|
)
|
|
|
|
# Add a wrapper script which runs each executable from the
|
|
|
|
# correct location. This adds convenience but makes debugging
|
|
|
|
# more difficult.
|
|
|
|
file(REMOVE ${CMAKE_BINARY_DIR}/run/${_executable})
|
|
|
|
file(WRITE ${CMAKE_BINARY_DIR}/run/${_executable} "#!/bin/sh\n")
|
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/run/${_executable} "exec ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/MacOS/extcap/${_executable} \"\$\@\"\n")
|
|
|
|
execute_process(COMMAND chmod a+x ${CMAKE_BINARY_DIR}/run/${_executable})
|
|
|
|
endif()
|
2015-04-15 23:22:26 +00:00
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
2014-09-05 18:17:17 +00:00
|
|
|
if(BUILD_wireshark_gtk AND GTK_FOUND)
|
|
|
|
set(wireshark_gtk_LIBS
|
|
|
|
gtkui
|
|
|
|
ui
|
|
|
|
capchild
|
|
|
|
caputils
|
|
|
|
${GTK2_LIBRARIES}
|
|
|
|
${GTK3_LIBRARIES}
|
|
|
|
${GTHREAD2_LIBRARIES}
|
2015-12-04 01:47:27 +00:00
|
|
|
wscodecs
|
2014-09-05 18:17:17 +00:00
|
|
|
${PORTAUDIO_LIBRARIES}
|
|
|
|
${LIBEPAN_LIBS}
|
|
|
|
${APPLE_APPLICATION_SERVICES_LIBRARY}
|
|
|
|
${APPLE_CORE_SERVICES_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
|
|
|
${NL_LIBRARIES}
|
|
|
|
${WIN_COMCTL32_LIBRARY}
|
|
|
|
)
|
|
|
|
# wireshark and wireshark-gtk share wireshark_FILES
|
|
|
|
|
2015-04-16 16:39:51 +00:00
|
|
|
add_executable(wireshark-gtk WIN32 ${wireshark_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(wireshark-gtk version)
|
2015-02-01 21:56:39 +00:00
|
|
|
set(PROGLIST ${PROGLIST} wireshark-gtk)
|
2017-09-24 01:30:08 +00:00
|
|
|
set_target_properties(wireshark-gtk PROPERTIES
|
|
|
|
LINK_FLAGS "${WS_LINK_FLAGS}"
|
|
|
|
FOLDER "Executables"
|
|
|
|
)
|
2014-09-05 18:17:17 +00:00
|
|
|
target_link_libraries(wireshark-gtk ${wireshark_gtk_LIBS})
|
|
|
|
install(TARGETS wireshark-gtk RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
|
|
|
# Map for endpoints dialog
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
TARGET wireshark-gtk
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
"${PROJECT_SOURCE_DIR}/ipmap.html"
|
|
|
|
$<TARGET_FILE_DIR:wireshark-gtk>
|
|
|
|
)
|
2015-01-13 18:15:18 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
add_custom_target(copy_gtk_dlls)
|
2015-01-15 21:07:48 +00:00
|
|
|
set_target_properties(copy_gtk_dlls PROPERTIES FOLDER "Copy Tasks")
|
2015-01-13 18:15:18 +00:00
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${_dll_output_dir}"
|
|
|
|
)
|
|
|
|
|
|
|
|
if(GTK2_FOUND)
|
|
|
|
set(_gtk_dll_dir "${GTK2_DLL_DIR}")
|
|
|
|
set(_gtk_etc_dir "${GTK2_ETC_DIR}")
|
|
|
|
set(_gtk_dlls "${GTK2_DLLS}")
|
|
|
|
set(_gtk_etc_dir "${GTK2_ETC_DIR}")
|
|
|
|
else()
|
|
|
|
set(_gtk_dll_dir "${GTK3_DLL_DIR}")
|
|
|
|
set(_gtk_dlls "${GTK3_DLLS}")
|
|
|
|
set(_gtk_etc_dir "${GTK3_ETC_DIR}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
foreach(_dll ${_gtk_dlls})
|
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
"${_gtk_dll_dir}/${_dll}" "${_dll_output_dir}"
|
|
|
|
)
|
|
|
|
endforeach(_dll)
|
|
|
|
|
|
|
|
# /etc
|
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${_dll_output_dir}/etc"
|
|
|
|
)
|
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
"${_gtk_etc_dir}" "${_dll_output_dir}/etc"
|
|
|
|
)
|
|
|
|
|
|
|
|
# XXX - Omitting ${GTK2_LIB_DIR}\loaders copying from Makefile.nmake
|
|
|
|
if(GTK2_FOUND)
|
|
|
|
# Engines
|
|
|
|
set (_engines_output_dir "${_dll_output_dir}/lib/gtk-2.0/2.10.0/engines")
|
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${_engines_output_dir}"
|
|
|
|
)
|
|
|
|
foreach(_dll ${GTK2_ENGINES_DLLS})
|
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
"${GTK2_ENGINES_DLL_DIR}/${_dll}" "${_engines_output_dir}"
|
|
|
|
)
|
|
|
|
endforeach(_dll)
|
|
|
|
|
|
|
|
# Themes
|
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
"${GTK2_THEMES_DIR}/gtkrc" "${_dll_output_dir}/etc/gtk-2.0"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Modules
|
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
"${GTK2_LIB_DIR}" "${_dll_output_dir}/lib/gtk-2.0"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
add_custom_command(TARGET copy_gtk_dlls PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
"${CMAKE_SOURCE_DIR}/ui/win32/settings.ini" "${_dll_output_dir}/etc"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_dependencies(wireshark-gtk copy_gtk_dlls copy_cli_dlls)
|
|
|
|
endif(WIN32)
|
2012-02-02 00:46:02 +00:00
|
|
|
endif()
|
|
|
|
|
2012-01-12 19:16:15 +00:00
|
|
|
register_tap_files(tshark-tap-register.c
|
|
|
|
${TSHARK_TAP_SRC}
|
|
|
|
)
|
|
|
|
|
2009-08-29 09:13:28 +00:00
|
|
|
if(BUILD_tshark)
|
2009-09-08 07:03:57 +00:00
|
|
|
set(tshark_LIBS
|
2013-06-26 02:12:12 +00:00
|
|
|
ui
|
2014-06-23 23:48:41 +00:00
|
|
|
capchild
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils
|
2009-09-08 15:56:16 +00:00
|
|
|
${LIBEPAN_LIBS}
|
2012-11-22 16:49:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
set(tshark_FILES
|
|
|
|
capture_opts.c
|
|
|
|
tshark-tap-register.c
|
|
|
|
tshark.c
|
|
|
|
${TSHARK_TAP_SRC}
|
2014-01-08 20:10:17 +00:00
|
|
|
${SHARK_COMMON_SRC}
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/tshark.rc
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
add_executable(tshark ${tshark_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(tshark version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(tshark "Executables")
|
2009-09-08 07:03:57 +00:00
|
|
|
target_link_libraries(tshark ${tshark_LIBS})
|
|
|
|
install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2006-10-24 17:39:32 +00:00
|
|
|
|
2014-01-08 04:35:28 +00:00
|
|
|
if(BUILD_tfshark)
|
|
|
|
set(tfshark_LIBS
|
|
|
|
ui
|
|
|
|
${LIBEPAN_LIBS}
|
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
|
|
|
)
|
|
|
|
set(tfshark_FILES
|
|
|
|
tfshark.c
|
|
|
|
${TSHARK_TAP_SRC}
|
2014-01-08 20:10:17 +00:00
|
|
|
${SHARK_COMMON_SRC}
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/tfshark.rc
|
2014-01-08 04:35:28 +00:00
|
|
|
)
|
|
|
|
add_executable(tfshark ${tfshark_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(tfshark version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(tfshark "Executables")
|
2014-01-08 04:35:28 +00:00
|
|
|
target_link_libraries(tfshark ${tfshark_LIBS})
|
|
|
|
install(TARGETS tfshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2011-08-29 19:18:28 +00:00
|
|
|
if(BUILD_rawshark AND PCAP_FOUND)
|
2009-09-08 07:03:57 +00:00
|
|
|
set(rawshark_LIBS
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils
|
2017-04-08 21:44:00 +00:00
|
|
|
ui
|
2009-09-08 15:56:16 +00:00
|
|
|
${LIBEPAN_LIBS}
|
2012-11-22 16:49:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
set(rawshark_FILES
|
2014-01-08 20:10:17 +00:00
|
|
|
${SHARK_COMMON_SRC}
|
2009-09-08 07:03:57 +00:00
|
|
|
rawshark.c
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/rawshark.rc
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
add_executable(rawshark ${rawshark_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(rawshark version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(rawshark "Executables")
|
2009-09-08 07:03:57 +00:00
|
|
|
target_link_libraries(rawshark ${rawshark_LIBS})
|
|
|
|
install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-29 09:13:28 +00:00
|
|
|
endif()
|
|
|
|
|
2016-10-15 18:48:17 +00:00
|
|
|
if(BUILD_sharkd)
|
|
|
|
set(sharkd_LIBS
|
|
|
|
ui
|
2017-04-08 08:15:11 +00:00
|
|
|
wscodecs
|
2016-10-15 18:48:17 +00:00
|
|
|
${LIBEPAN_LIBS}
|
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
|
|
|
)
|
|
|
|
set(sharkd_FILES
|
|
|
|
sharkd.c
|
|
|
|
sharkd_daemon.c
|
|
|
|
sharkd_session.c
|
|
|
|
${SHARK_COMMON_SRC}
|
|
|
|
)
|
|
|
|
add_executable(sharkd ${sharkd_FILES})
|
|
|
|
add_dependencies(sharkd version)
|
|
|
|
set_extra_executable_properties(sharkd "Executables")
|
|
|
|
target_link_libraries(sharkd ${sharkd_LIBS})
|
|
|
|
install(TARGETS sharkd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2009-09-08 07:03:57 +00:00
|
|
|
if(BUILD_dftest)
|
|
|
|
set(dftest_LIBS
|
2017-04-08 21:59:31 +00:00
|
|
|
ui
|
2009-09-08 15:56:16 +00:00
|
|
|
${LIBEPAN_LIBS}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
set(dftest_FILES
|
2012-02-19 08:59:17 +00:00
|
|
|
dftest.c
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
add_executable(dftest ${dftest_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(dftest version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(dftest "Tests")
|
2009-09-08 07:03:57 +00:00
|
|
|
target_link_libraries(dftest ${dftest_LIBS})
|
2009-08-29 09:13:28 +00:00
|
|
|
endif()
|
|
|
|
|
2009-09-08 07:03:57 +00:00
|
|
|
if(BUILD_randpkt)
|
|
|
|
set(randpkt_LIBS
|
2016-02-15 01:00:38 +00:00
|
|
|
randpkt_core
|
2017-04-20 21:07:06 +00:00
|
|
|
ui
|
2009-09-08 07:03:57 +00:00
|
|
|
wiretap
|
2013-10-13 09:21:55 +00:00
|
|
|
wsutil
|
2009-09-10 07:04:54 +00:00
|
|
|
${M_LIBRARIES}
|
2009-09-08 07:03:57 +00:00
|
|
|
${PCAP_LIBRARIES}
|
2009-09-09 13:20:33 +00:00
|
|
|
${CARES_LIBRARIES}
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
set(randpkt_FILES
|
|
|
|
randpkt.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2009-09-08 07:03:57 +00:00
|
|
|
)
|
|
|
|
add_executable(randpkt ${randpkt_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(randpkt version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(randpkt "Executables")
|
2009-09-08 07:03:57 +00:00
|
|
|
target_link_libraries(randpkt ${randpkt_LIBS})
|
|
|
|
install(TARGETS randpkt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2017-12-06 20:10:29 +00:00
|
|
|
if(BUILD_fuzzshark)
|
|
|
|
set(fuzzshark_LIBS
|
|
|
|
${LIBEPAN_LIBS}
|
|
|
|
)
|
|
|
|
set(fuzzshark_FILES
|
|
|
|
tools/oss-fuzzshark/fuzzshark.c
|
|
|
|
tools/oss-fuzzshark/StandaloneFuzzTargetMain.c
|
|
|
|
version_info.c
|
|
|
|
)
|
|
|
|
add_executable(fuzzshark ${fuzzshark_FILES})
|
|
|
|
add_dependencies(fuzzshark version)
|
|
|
|
set_extra_executable_properties(fuzzshark "Executables")
|
|
|
|
target_link_libraries(fuzzshark ${fuzzshark_LIBS})
|
|
|
|
endif()
|
|
|
|
|
2009-06-16 05:52:16 +00:00
|
|
|
if(BUILD_text2pcap)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(text2pcap_LIBS
|
2016-03-24 20:00:07 +00:00
|
|
|
writecap
|
2012-12-18 22:56:06 +00:00
|
|
|
wsutil
|
2009-09-10 07:04:54 +00:00
|
|
|
${M_LIBRARIES}
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
2010-05-15 21:40:25 +00:00
|
|
|
set(text2pcap_CLEAN_FILES
|
2009-09-02 16:33:01 +00:00
|
|
|
text2pcap.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
2010-05-15 21:40:25 +00:00
|
|
|
set(text2pcap_FILES
|
|
|
|
${text2pcap_CLEAN_FILES}
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/text2pcap.rc
|
2010-05-15 21:40:25 +00:00
|
|
|
)
|
2016-03-11 19:51:39 +00:00
|
|
|
add_lex_files(text2pcap_LEX_FILES text2pcap_GENERATED_FILES
|
2009-09-02 16:33:01 +00:00
|
|
|
text2pcap-scanner.l
|
|
|
|
)
|
2016-03-11 19:51:39 +00:00
|
|
|
add_executable(text2pcap ${text2pcap_FILES} ${text2pcap_GENERATED_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(text2pcap version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(text2pcap "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(text2pcap ${text2pcap_LIBS})
|
|
|
|
install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2009-06-16 05:52:16 +00:00
|
|
|
if(BUILD_mergecap)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(mergecap_LIBS
|
2017-04-20 20:25:21 +00:00
|
|
|
ui
|
2009-09-02 16:33:01 +00:00
|
|
|
wiretap
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2013-08-13 09:58:09 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
set(mergecap_FILES
|
|
|
|
mergecap.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/mergecap.rc
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
add_executable(mergecap ${mergecap_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(mergecap version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(mergecap "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(mergecap ${mergecap_LIBS})
|
|
|
|
install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2012-09-24 10:23:20 +00:00
|
|
|
if(BUILD_reordercap)
|
|
|
|
set(reordercap_LIBS
|
2017-04-20 07:19:01 +00:00
|
|
|
ui
|
2012-09-24 10:23:20 +00:00
|
|
|
wiretap
|
|
|
|
${ZLIB_LIBRARIES}
|
2013-08-13 09:58:09 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2012-09-24 10:23:20 +00:00
|
|
|
)
|
|
|
|
set(reordercap_FILES
|
|
|
|
reordercap.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/reordercap.rc
|
2012-09-24 10:23:20 +00:00
|
|
|
)
|
|
|
|
add_executable(reordercap ${reordercap_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(reordercap version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(reordercap "Executables")
|
2012-09-24 10:23:20 +00:00
|
|
|
target_link_libraries(reordercap ${reordercap_LIBS})
|
|
|
|
install(TARGETS reordercap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2009-06-16 05:52:16 +00:00
|
|
|
if(BUILD_capinfos)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(capinfos_LIBS
|
2017-04-20 07:19:01 +00:00
|
|
|
ui
|
2009-09-02 16:33:01 +00:00
|
|
|
wiretap
|
2012-10-03 17:31:23 +00:00
|
|
|
wsutil
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2009-12-08 11:04:52 +00:00
|
|
|
${GCRYPT_LIBRARIES}
|
2013-08-13 09:58:09 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
set(capinfos_FILES
|
|
|
|
capinfos.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/capinfos.rc
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
add_executable(capinfos ${capinfos_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(capinfos version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(capinfos "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(capinfos ${capinfos_LIBS})
|
|
|
|
install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2013-12-13 02:59:16 +00:00
|
|
|
if(BUILD_captype)
|
|
|
|
set(captype_LIBS
|
2017-04-20 07:19:01 +00:00
|
|
|
ui
|
2013-12-13 02:59:16 +00:00
|
|
|
wiretap
|
|
|
|
wsutil
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
)
|
|
|
|
set(captype_FILES
|
|
|
|
captype.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/captype.rc
|
2013-12-13 02:59:16 +00:00
|
|
|
)
|
|
|
|
add_executable(captype ${captype_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(captype version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(captype "Executables")
|
2013-12-13 02:59:16 +00:00
|
|
|
target_link_libraries(captype ${captype_LIBS})
|
|
|
|
install(TARGETS captype RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2009-06-16 05:52:16 +00:00
|
|
|
if(BUILD_editcap)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(editcap_LIBS
|
2017-04-20 03:25:59 +00:00
|
|
|
ui
|
2009-09-02 16:33:01 +00:00
|
|
|
wiretap
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2017-02-13 18:31:26 +00:00
|
|
|
${GCRYPT_LIBRARIES}
|
2013-08-13 09:58:09 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
set(editcap_FILES
|
|
|
|
editcap.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/editcap.rc
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
add_executable(editcap ${editcap_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(editcap version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(editcap "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(editcap ${editcap_LIBS})
|
|
|
|
install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-06-16 05:37:46 +00:00
|
|
|
|
2011-08-29 19:18:28 +00:00
|
|
|
if(BUILD_dumpcap AND PCAP_FOUND)
|
2009-09-02 16:33:01 +00:00
|
|
|
set(dumpcap_LIBS
|
2016-03-24 20:00:07 +00:00
|
|
|
writecap
|
2011-01-18 17:49:41 +00:00
|
|
|
wsutil
|
2014-07-04 07:24:02 +00:00
|
|
|
caputils
|
2017-04-09 04:24:45 +00:00
|
|
|
ui
|
2009-09-02 16:33:01 +00:00
|
|
|
${PCAP_LIBRARIES}
|
2009-09-12 17:20:08 +00:00
|
|
|
${CAP_LIBRARIES}
|
2011-01-18 17:49:41 +00:00
|
|
|
${GLIB2_LIBRARIES}
|
2011-05-12 21:13:00 +00:00
|
|
|
${GTHREAD2_LIBRARIES}
|
2010-05-19 13:05:35 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2012-11-22 16:49:17 +00:00
|
|
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
|
|
|
${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
|
2012-09-06 10:37:17 +00:00
|
|
|
${NL_LIBRARIES}
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
set(dumpcap_FILES
|
|
|
|
capture_opts.c
|
|
|
|
capture_stop_conditions.c
|
|
|
|
conditions.c
|
|
|
|
dumpcap.c
|
|
|
|
ringbuffer.c
|
|
|
|
sync_pipe_write.c
|
2017-09-26 14:04:56 +00:00
|
|
|
version_info.c
|
2015-01-10 21:29:57 +00:00
|
|
|
${CMAKE_BINARY_DIR}/image/dumpcap.rc
|
2009-09-02 16:33:01 +00:00
|
|
|
)
|
|
|
|
add_executable(dumpcap ${dumpcap_FILES})
|
2016-04-20 22:51:12 +00:00
|
|
|
add_dependencies(dumpcap version)
|
2014-10-09 18:37:27 +00:00
|
|
|
set_extra_executable_properties(dumpcap "Executables")
|
2009-09-02 16:33:01 +00:00
|
|
|
target_link_libraries(dumpcap ${dumpcap_LIBS})
|
2014-01-19 00:48:22 +00:00
|
|
|
install(TARGETS dumpcap
|
2014-10-09 18:37:27 +00:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
2014-01-19 00:48:22 +00:00
|
|
|
PERMISSIONS ${DUMPCAP_SETUID}
|
|
|
|
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
|
|
|
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
|
)
|
|
|
|
if(DUMPCAP_INSTALL_OPTION STREQUAL "capabilities")
|
|
|
|
install( CODE "execute_process(
|
|
|
|
COMMAND
|
|
|
|
${SETCAP_EXECUTABLE}
|
|
|
|
cap_net_raw,cap_net_admin+ep
|
|
|
|
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/dumpcap${CMAKE_EXECUTABLE_SUFFIX}
|
|
|
|
RESULT_VARIABLE
|
|
|
|
_SETCAP_RESULT
|
|
|
|
)
|
|
|
|
if( _SETCAP_RESULT )
|
2014-01-19 01:08:52 +00:00
|
|
|
message( WARNING \"setcap failed (${_SETCAP_RESULT}).\")
|
2014-01-19 00:48:22 +00:00
|
|
|
endif()"
|
|
|
|
)
|
|
|
|
endif()
|
2009-08-27 16:11:16 +00:00
|
|
|
endif()
|
2009-09-21 00:19:07 +00:00
|
|
|
|
2017-08-10 17:20:30 +00:00
|
|
|
# We have two idl2wrs utilities: this and the CORBA version in tools.
|
|
|
|
# We probably shouldn't do that.
|
|
|
|
if(BUILD_dcerpcidl2wrs)
|
|
|
|
set(idl2wrs_LIBS
|
|
|
|
${GLIB2_LIBRARIES}
|
|
|
|
wsutil
|
|
|
|
)
|
|
|
|
set(idl2wrs_FILES
|
|
|
|
epan/dissectors/dcerpc/idl2wrs.c
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(idl2wrs ${idl2wrs_FILES})
|
|
|
|
set_target_properties(idl2wrs PROPERTIES FOLDER "Executables")
|
|
|
|
set_extra_executable_properties(idl2wrs "Executables")
|
|
|
|
target_link_libraries(idl2wrs ${idl2wrs_LIBS})
|
|
|
|
install(TARGETS idl2wrs RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2015-01-06 23:07:50 +00:00
|
|
|
if (WIN32)
|
2015-12-04 17:02:35 +00:00
|
|
|
find_package( MSVC_REDIST )
|
|
|
|
|
2015-01-06 23:07:50 +00:00
|
|
|
# Must come after executable targets are defined.
|
|
|
|
find_package( NSIS )
|
|
|
|
|
|
|
|
if (NOT "${MAKENSIS_EXECUTABLE}" STREQUAL "MAKENSIS_EXECUTABLE-NOTFOUND")
|
|
|
|
add_subdirectory( packaging/nsis EXCLUDE_FROM_ALL )
|
|
|
|
ADD_NSIS_UNINSTALLER_TARGET()
|
|
|
|
ADD_NSIS_PACKAGE_TARGET()
|
|
|
|
endif()
|
2015-04-07 19:55:42 +00:00
|
|
|
|
2016-04-07 23:03:51 +00:00
|
|
|
find_package( WiX )
|
|
|
|
|
|
|
|
if (NOT "${WIX_CANDLE_EXECUTABLE}" STREQUAL "WIX_CANDLE_EXECUTABLE-NOTFOUND")
|
|
|
|
add_subdirectory( packaging/wix EXCLUDE_FROM_ALL )
|
|
|
|
ADD_WIX_PACKAGE_TARGET()
|
|
|
|
endif()
|
|
|
|
|
2015-04-07 19:55:42 +00:00
|
|
|
find_package( PortableApps )
|
|
|
|
if (
|
|
|
|
NOT "${PORTABLEAPPS_LAUNCHER_GENERATOR_EXECUTABLE}" STREQUAL "PORTABLEAPPS_LAUNCHER_GENERATOR_EXECUTABLE-NOTFOUND"
|
|
|
|
AND
|
|
|
|
NOT "${PORTABLEAPPS_INSTALLER_EXECUTABLE}" STREQUAL "PORTABLEAPPS_INSTALLER_EXECUTABLE-NOTFOUND"
|
|
|
|
)
|
|
|
|
add_subdirectory( packaging/portableapps EXCLUDE_FROM_ALL )
|
|
|
|
ADD_PORTABLEAPPS_PACKAGE_TARGET()
|
|
|
|
endif()
|
2015-01-06 23:07:50 +00:00
|
|
|
endif()
|
|
|
|
|
2017-08-30 21:20:21 +00:00
|
|
|
add_custom_target(extcaps)
|
|
|
|
|
2018-01-06 20:39:26 +00:00
|
|
|
if(BUILD_androiddump)
|
2015-02-14 18:10:21 +00:00
|
|
|
if(EXTCAP_ANDROIDDUMP_LIBPCAP)
|
|
|
|
if(HAVE_LIBPCAP)
|
|
|
|
set(androiddump_LIBS
|
2017-04-21 02:08:00 +00:00
|
|
|
ui
|
2015-02-14 18:10:21 +00:00
|
|
|
${GLIB2_LIBRARIES}
|
|
|
|
${PCAP_LIBRARIES}
|
|
|
|
)
|
|
|
|
else()
|
2017-11-12 18:55:58 +00:00
|
|
|
message(FATAL_ERROR "You are trying to build androiddump with libpcap but do not have it")
|
2015-02-14 18:10:21 +00:00
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(androiddump_LIBS
|
2017-04-21 02:08:00 +00:00
|
|
|
ui
|
2015-02-14 18:10:21 +00:00
|
|
|
wiretap
|
|
|
|
${GLIB2_LIBRARIES}
|
2017-11-12 18:55:58 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2015-02-14 18:10:21 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
set(androiddump_FILES
|
|
|
|
extcap/androiddump.c
|
2016-02-22 15:28:15 +00:00
|
|
|
extcap/extcap-base.c
|
2015-02-14 18:10:21 +00:00
|
|
|
)
|
|
|
|
|
2015-04-16 16:39:51 +00:00
|
|
|
add_executable(androiddump WIN32 ${androiddump_FILES})
|
2015-05-05 16:56:55 +00:00
|
|
|
# XXX Shouldn't we add wsutil to androiddump_LIBS instead?
|
2015-04-15 23:22:26 +00:00
|
|
|
set_extcap_executable_properties(androiddump)
|
2015-02-14 18:10:21 +00:00
|
|
|
target_link_libraries(androiddump ${androiddump_LIBS})
|
|
|
|
install(TARGETS androiddump RUNTIME DESTINATION ${EXTCAP_DIR})
|
2017-08-30 21:20:21 +00:00
|
|
|
add_dependencies(extcaps androiddump)
|
2015-02-14 18:10:21 +00:00
|
|
|
endif()
|
|
|
|
|
2018-01-06 20:39:26 +00:00
|
|
|
if(BUILD_sshdump AND LIBSSH_FOUND)
|
2015-11-19 10:30:44 +00:00
|
|
|
set(sshdump_LIBS
|
2016-02-23 13:33:54 +00:00
|
|
|
wsutil
|
2015-11-19 10:30:44 +00:00
|
|
|
${GLIB2_LIBRARIES}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
${LIBSSH_LIBRARIES}
|
|
|
|
)
|
|
|
|
set(sshdump_FILES
|
|
|
|
extcap/sshdump.c
|
2016-02-22 15:28:15 +00:00
|
|
|
extcap/extcap-base.c
|
2016-03-01 13:13:41 +00:00
|
|
|
extcap/ssh-base.c
|
2015-11-19 10:30:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(sshdump WIN32 ${sshdump_FILES})
|
|
|
|
set_extcap_executable_properties(sshdump)
|
|
|
|
target_link_libraries(sshdump ${sshdump_LIBS})
|
|
|
|
target_include_directories(sshdump PUBLIC ${LIBSSH_INCLUDE_DIR})
|
|
|
|
install(TARGETS sshdump RUNTIME DESTINATION ${EXTCAP_DIR})
|
2017-08-30 21:20:21 +00:00
|
|
|
add_dependencies(extcaps sshdump)
|
2015-11-19 10:30:44 +00:00
|
|
|
elseif (BUILD_sshdump)
|
|
|
|
#message( WARNING "Cannot find libssh, cannot build sshdump" )
|
|
|
|
endif()
|
|
|
|
|
2018-01-06 20:39:26 +00:00
|
|
|
if(BUILD_ciscodump AND LIBSSH_FOUND)
|
2016-03-04 09:53:56 +00:00
|
|
|
set(ciscodump_LIBS
|
2016-03-24 20:00:07 +00:00
|
|
|
writecap
|
2016-03-04 09:53:56 +00:00
|
|
|
wsutil
|
|
|
|
${GLIB2_LIBRARIES}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
${LIBSSH_LIBRARIES}
|
|
|
|
)
|
|
|
|
set(ciscodump_FILES
|
|
|
|
extcap/ciscodump.c
|
|
|
|
extcap/extcap-base.c
|
|
|
|
extcap/ssh-base.c
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(ciscodump WIN32 ${ciscodump_FILES})
|
|
|
|
set_extcap_executable_properties(ciscodump)
|
|
|
|
target_link_libraries(ciscodump ${ciscodump_LIBS})
|
|
|
|
target_include_directories(ciscodump PUBLIC ${LIBSSH_INCLUDE_DIR})
|
|
|
|
install(TARGETS ciscodump RUNTIME DESTINATION ${EXTCAP_DIR})
|
2017-08-30 21:20:21 +00:00
|
|
|
add_dependencies(extcaps ciscodump)
|
2016-03-04 09:53:56 +00:00
|
|
|
elseif (BUILD_ciscodump)
|
|
|
|
#message( WARNING "Cannot find libssh, cannot build ciscodump" )
|
|
|
|
endif()
|
|
|
|
|
2018-01-06 20:39:26 +00:00
|
|
|
if(BUILD_udpdump)
|
2016-02-10 14:45:45 +00:00
|
|
|
set(udpdump_LIBS
|
|
|
|
${GLIB2_LIBRARIES}
|
|
|
|
${CMAKE_DL_LIBS}
|
2016-12-22 13:19:30 +00:00
|
|
|
wsutil
|
2016-02-10 14:45:45 +00:00
|
|
|
writecap
|
|
|
|
)
|
|
|
|
set(udpdump_FILES
|
|
|
|
extcap/udpdump.c
|
|
|
|
extcap/extcap-base.c
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(udpdump WIN32 ${udpdump_FILES})
|
|
|
|
set_extcap_executable_properties(udpdump)
|
|
|
|
target_link_libraries(udpdump ${udpdump_LIBS})
|
|
|
|
install(TARGETS udpdump RUNTIME DESTINATION ${EXTCAP_DIR})
|
2017-08-30 21:20:21 +00:00
|
|
|
add_dependencies(extcaps udpdump)
|
2016-02-10 14:45:45 +00:00
|
|
|
endif()
|
|
|
|
|
2018-01-06 20:39:26 +00:00
|
|
|
if(BUILD_randpktdump)
|
2015-11-05 17:31:11 +00:00
|
|
|
set(randpktdump_LIBS
|
2016-02-15 01:00:38 +00:00
|
|
|
randpkt_core
|
2017-04-20 21:07:06 +00:00
|
|
|
ui
|
2015-11-05 17:31:11 +00:00
|
|
|
wiretap
|
|
|
|
${GLIB2_LIBRARIES}
|
2017-11-12 18:55:58 +00:00
|
|
|
${ZLIB_LIBRARIES}
|
2015-11-05 17:31:11 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
)
|
|
|
|
set(randpktdump_FILES
|
2016-02-22 15:28:15 +00:00
|
|
|
extcap/extcap-base.c
|
2016-02-23 10:12:17 +00:00
|
|
|
extcap/randpktdump.c
|
2015-11-05 17:31:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(randpktdump WIN32 ${randpktdump_FILES})
|
|
|
|
# XXX Shouldn't we add wsutil to randpktdump_LIBS instead?
|
|
|
|
set_extcap_executable_properties(randpktdump)
|
|
|
|
target_link_libraries(randpktdump ${randpktdump_LIBS})
|
|
|
|
install(TARGETS randpktdump RUNTIME DESTINATION ${EXTCAP_DIR})
|
2017-08-30 21:20:21 +00:00
|
|
|
add_dependencies(extcaps randpktdump)
|
2015-11-05 17:31:11 +00:00
|
|
|
endif()
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
2015-02-04 00:02:52 +00:00
|
|
|
add_custom_target(app_bundle)
|
2015-02-01 21:56:39 +00:00
|
|
|
set_target_properties(app_bundle PROPERTIES FOLDER "Copy Tasks")
|
|
|
|
add_custom_command(TARGET app_bundle
|
|
|
|
POST_BUILD
|
2017-10-04 23:27:08 +00:00
|
|
|
COMMAND "${CMAKE_BINARY_DIR}/packaging/macosx/osx-app.sh"
|
2015-02-01 21:56:39 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/run"
|
|
|
|
)
|
|
|
|
add_dependencies(app_bundle ${PROGLIST})
|
2014-10-23 17:57:45 +00:00
|
|
|
|
2015-10-01 21:00:51 +00:00
|
|
|
add_custom_target(dmg_package_prep DEPENDS app_bundle)
|
|
|
|
|
2014-10-23 17:57:45 +00:00
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo APPLWshk > ${CMAKE_BINARY_DIR}/packaging/macosx/PkgInfo
|
|
|
|
)
|
|
|
|
|
2015-10-01 21:00:51 +00:00
|
|
|
ADD_CUSTOM_TARGET( dmg_package
|
2014-10-23 17:57:45 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
"${PROJECT_SOURCE_DIR}/ipmap.html"
|
|
|
|
$<TARGET_FILE_DIR:wireshark>
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/ChmodBPF
|
|
|
|
${CMAKE_BINARY_DIR}/run/ChmodBPF
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/Resources
|
|
|
|
${CMAKE_BINARY_DIR}/run/Resources
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/Scripts
|
|
|
|
${CMAKE_BINARY_DIR}/run/Scripts
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/utility-launcher
|
|
|
|
${CMAKE_BINARY_DIR}/run/utility-launcher
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
${CMAKE_SOURCE_DIR}/COPYING
|
|
|
|
${CMAKE_BINARY_DIR}/run/COPYING.txt
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/Wireshark_package.pmdoc
|
|
|
|
${CMAKE_BINARY_DIR}/run/Wireshark_package.pmdoc
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/macosx/Wireshark_package.pmdoc/index.xml
|
|
|
|
${CMAKE_BINARY_DIR}/run/Wireshark_package.pmdoc/index.xml
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/macosx/dmg_background.png
|
|
|
|
${CMAKE_BINARY_DIR}/run/dmg_background.png
|
|
|
|
COMMAND bash -x ${CMAKE_BINARY_DIR}/packaging/macosx/osx-dmg.sh
|
|
|
|
--source-directory ${CMAKE_SOURCE_DIR}/packaging/macosx
|
2015-10-01 21:00:51 +00:00
|
|
|
# Unlike nsis_package_prep + nsis_package, we can add a direct
|
|
|
|
# dependency here.
|
|
|
|
DEPENDS dmg_package_prep
|
2014-10-23 17:57:45 +00:00
|
|
|
# We create Wireshark.app in "run". Do our work there.
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/run
|
|
|
|
)
|
|
|
|
|
2014-10-09 18:37:27 +00:00
|
|
|
endif()
|
|
|
|
|
2017-07-25 20:31:49 +00:00
|
|
|
set(CLEAN_C_FILES
|
2009-11-07 10:07:00 +00:00
|
|
|
${wireshark_FILES}
|
|
|
|
${tshark_FILES}
|
|
|
|
${rawshark_FILES}
|
|
|
|
${dftest_FILES}
|
|
|
|
${randpkt_FILES}
|
2015-11-05 17:31:11 +00:00
|
|
|
${randpktdump_FILES}
|
2016-02-10 14:45:45 +00:00
|
|
|
${udpdump_FILES}
|
2010-05-15 21:40:25 +00:00
|
|
|
${text2pcap_CLEAN_FILES}
|
2009-11-07 10:07:00 +00:00
|
|
|
${mergecap_FILES}
|
|
|
|
${capinfos_FILES}
|
2013-12-13 02:59:16 +00:00
|
|
|
${captype_FILES}
|
2009-11-07 10:07:00 +00:00
|
|
|
${editcap_FILES}
|
2017-08-10 17:20:30 +00:00
|
|
|
${idl2wrs_FILES}
|
2009-11-07 10:07:00 +00:00
|
|
|
${dumpcap_FILES}
|
2015-04-08 14:09:03 +00:00
|
|
|
${androiddump_FILES}
|
2015-11-19 10:30:44 +00:00
|
|
|
${sshdump_FILES}
|
2016-03-04 09:53:56 +00:00
|
|
|
${ciscodump_FILES}
|
2016-02-10 14:45:45 +00:00
|
|
|
${udpdump_FILES}
|
2009-11-07 10:07:00 +00:00
|
|
|
)
|
|
|
|
|
2017-07-25 20:31:49 +00:00
|
|
|
# Make sure we don't pass /WX to rc.exe. Rc doesn't have a /WX flag,
|
|
|
|
# but it does have /W (warn about invalid code pages) and /X (ignore
|
|
|
|
# the INCLUDE environment variable).
|
|
|
|
# This should apparently be handled for us via CMAKE_RC_FLAG_REGEX
|
|
|
|
# in CMakeRCInformation.cmake but that doesn't appear to work.
|
|
|
|
if (WIN32)
|
|
|
|
list(FILTER CLEAN_C_FILES EXCLUDE REGEX ".*\\.rc")
|
|
|
|
endif (WIN32)
|
|
|
|
|
2016-09-30 14:06:15 +00:00
|
|
|
set_source_files_properties(
|
2017-07-25 20:31:49 +00:00
|
|
|
${CLEAN_C_FILES}
|
2016-09-30 14:06:15 +00:00
|
|
|
PROPERTIES
|
|
|
|
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
|
|
|
|
)
|
2009-11-07 10:07:00 +00:00
|
|
|
|
2009-09-21 00:19:07 +00:00
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${INSTALL_FILES}
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
|
|
|
|
)
|
|
|
|
|
2017-09-02 23:42:00 +00:00
|
|
|
set(SHARK_PUBLIC_HEADERS
|
|
|
|
cfile.h
|
|
|
|
file.h
|
|
|
|
globals.h
|
|
|
|
log.h
|
|
|
|
ws_attributes.h
|
2017-10-26 21:59:40 +00:00
|
|
|
ws_compiler_tests.h
|
2017-09-02 23:42:00 +00:00
|
|
|
ws_diag_control.h
|
2017-10-26 21:59:40 +00:00
|
|
|
ws_symbol_export.h
|
2017-09-02 23:42:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${SHARK_PUBLIC_HEADERS}
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_INCLUDEDIR}/${CPACK_PACKAGE_NAME}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2016-11-08 14:20:30 +00:00
|
|
|
# Install icons and other desktop files for Freedesktop.org-compliant desktops.
|
|
|
|
if(((BUILD_wireshark AND QT_FOUND) OR BUILD_wireshark_gtk) AND NOT (WIN32 OR APPLE))
|
|
|
|
install(FILES wireshark-mime-package.xml
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/mime/packages"
|
|
|
|
RENAME wireshark.xml
|
|
|
|
)
|
|
|
|
install(FILES wireshark.appdata.xml
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/appdata"
|
|
|
|
)
|
|
|
|
if(BUILD_wireshark AND QT_FOUND)
|
|
|
|
install(FILES wireshark.desktop
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
|
|
|
|
endif()
|
|
|
|
if(BUILD_wireshark_gtk)
|
|
|
|
install(FILES wireshark-gtk.desktop
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
|
|
|
|
endif()
|
|
|
|
foreach(size 16 24 32 48 64 128 256)
|
|
|
|
install(FILES image/wsicon${size}.png
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${size}x${size}/apps"
|
|
|
|
RENAME wireshark.png)
|
|
|
|
install(FILES image/WiresharkDoc-${size}.png
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${size}x${size}/mimetypes"
|
|
|
|
RENAME application-wireshark-doc.png)
|
|
|
|
endforeach()
|
|
|
|
install(FILES image/wsicon.svg
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps"
|
|
|
|
RENAME wireshark.svg)
|
|
|
|
endif()
|
|
|
|
|
2014-03-04 13:59:39 +00:00
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
"${CMAKE_BINARY_DIR}/wireshark.pc"
|
|
|
|
DESTINATION
|
2014-05-29 12:07:44 +00:00
|
|
|
${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
2014-03-04 13:59:39 +00:00
|
|
|
)
|
|
|
|
|
2009-09-21 00:19:07 +00:00
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
${INSTALL_DIRS}
|
2009-09-25 02:50:48 +00:00
|
|
|
DIRECTORY_PERMISSIONS
|
|
|
|
OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
|
|
|
GROUP_EXECUTE GROUP_READ
|
|
|
|
WORLD_EXECUTE WORLD_READ
|
2009-09-21 00:19:07 +00:00
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
|
2014-02-07 19:14:52 +00:00
|
|
|
PATTERN ".git" EXCLUDE
|
2009-09-21 00:19:07 +00:00
|
|
|
PATTERN ".svn" EXCLUDE
|
|
|
|
PATTERN "Makefile.*" EXCLUDE
|
|
|
|
)
|
2012-02-04 14:19:38 +00:00
|
|
|
|
2015-04-07 20:41:34 +00:00
|
|
|
set(CMAKE_INSTALL_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/${CPACK_PACKAGE_NAME})
|
2014-11-11 13:41:01 +00:00
|
|
|
configure_file("${CMAKE_MODULE_PATH}/WiresharkConfig.cmake.in" "${CMAKE_BINARY_DIR}/WiresharkConfig.cmake" @ONLY)
|
|
|
|
configure_file("${CMAKE_MODULE_PATH}/WiresharkConfigVersion.cmake.in" "${CMAKE_BINARY_DIR}/WiresharkConfigVersion.cmake" @ONLY)
|
|
|
|
install(
|
|
|
|
FILES
|
2014-11-12 12:02:17 +00:00
|
|
|
${CMAKE_MODULE_PATH}/FindGLIB2.cmake
|
2014-11-11 13:41:01 +00:00
|
|
|
${CMAKE_MODULE_PATH}/FindWireshark.cmake
|
2014-11-12 12:02:17 +00:00
|
|
|
${CMAKE_MODULE_PATH}/FindWSWinLibs.cmake
|
2014-11-12 12:43:14 +00:00
|
|
|
${CMAKE_MODULE_PATH}/UseAsn2Wrs.cmake
|
2014-11-16 15:07:45 +00:00
|
|
|
${CMAKE_MODULE_PATH}/LocatePythonModule.cmake
|
2017-11-20 19:58:46 +00:00
|
|
|
${CMAKE_MODULE_PATH}/UseMakePluginReg.cmake
|
2014-11-11 13:41:01 +00:00
|
|
|
${CMAKE_BINARY_DIR}/WiresharkConfig.cmake
|
|
|
|
${CMAKE_BINARY_DIR}/WiresharkConfigVersion.cmake
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_MODULES_DIR}
|
|
|
|
)
|
|
|
|
|
2012-02-05 07:41:53 +00:00
|
|
|
if(DOC_DIR)
|
|
|
|
message(STATUS "Docdir install: ${DOC_DIR}")
|
2012-02-04 14:19:38 +00:00
|
|
|
INSTALL(
|
|
|
|
DIRECTORY
|
|
|
|
${CMAKE_BINARY_DIR}/docbook/
|
|
|
|
DIRECTORY_PERMISSIONS
|
|
|
|
OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
|
|
|
GROUP_EXECUTE GROUP_READ
|
|
|
|
WORLD_EXECUTE WORLD_READ
|
|
|
|
DESTINATION
|
|
|
|
${DOC_DIR}/guides
|
2012-02-08 07:39:51 +00:00
|
|
|
FILES_MATCHING
|
2012-02-05 07:41:53 +00:00
|
|
|
PATTERN "*.pdf"
|
2012-02-04 14:19:38 +00:00
|
|
|
)
|
|
|
|
endif()
|
2015-01-15 11:45:02 +00:00
|
|
|
|
2015-03-07 01:49:24 +00:00
|
|
|
# Test suite wrapper
|
|
|
|
if(ENABLE_APPLICATION_BUNDLE)
|
|
|
|
set(TEST_SH_BIN_DIR ${CMAKE_BINARY_DIR}/run)
|
|
|
|
else()
|
|
|
|
set(TEST_SH_BIN_DIR $<TARGET_FILE_DIR:epan>)
|
|
|
|
endif()
|
|
|
|
|
2015-03-13 16:21:01 +00:00
|
|
|
add_custom_target(test-sh
|
2015-03-07 01:49:24 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2015-03-07 04:41:54 +00:00
|
|
|
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
|
2015-03-10 06:47:28 +00:00
|
|
|
-DTEST_SH_BIN_DIR=${TEST_SH_BIN_DIR}
|
|
|
|
-DTEST_SH_SRC_DIR=${CMAKE_SOURCE_DIR}/test
|
|
|
|
-P ${CMAKE_SOURCE_DIR}/cmake/modules/GenerateTestSh.cmake
|
2015-03-07 01:49:24 +00:00
|
|
|
DEPENDS ${CMAKE_SOURCE_DIR}/cmake/modules/GenerateTestSh.cmake
|
|
|
|
)
|
2016-03-19 23:36:22 +00:00
|
|
|
set_target_properties(test-sh PROPERTIES FOLDER "Tests")
|
2016-02-28 22:32:13 +00:00
|
|
|
|
2016-03-04 17:55:40 +00:00
|
|
|
if (GIT_EXECUTABLE)
|
2016-03-27 21:31:36 +00:00
|
|
|
# Update AUTHORS file with entries from git shortlog
|
|
|
|
add_custom_target(
|
2016-03-04 17:55:40 +00:00
|
|
|
gen-authors
|
2016-03-27 21:31:36 +00:00
|
|
|
COMMAND ${PERL_EXECUTABLE} tools/generate_authors.pl AUTHORS.src > AUTHORS
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
2016-03-04 17:55:40 +00:00
|
|
|
)
|
|
|
|
else (GIT_EXECUTABLE)
|
2016-03-27 21:31:36 +00:00
|
|
|
add_custom_target( gen-authors COMMAND ${CMAKE_COMMAND} -E echo "Git not found." )
|
2016-03-04 17:55:40 +00:00
|
|
|
endif (GIT_EXECUTABLE)
|
2016-03-19 23:36:22 +00:00
|
|
|
set_target_properties(gen-authors PROPERTIES FOLDER "Docs")
|
2015-03-07 01:49:24 +00:00
|
|
|
|
2015-03-13 16:21:01 +00:00
|
|
|
add_custom_target(test-programs
|
|
|
|
DEPENDS test-sh
|
|
|
|
exntest
|
|
|
|
oids_test
|
|
|
|
reassemble_test
|
|
|
|
tvbtest
|
|
|
|
wmem_test
|
|
|
|
COMMENT "Building unit test programs and wrapper"
|
|
|
|
)
|
2015-03-19 16:51:02 +00:00
|
|
|
set_target_properties(test-programs PROPERTIES FOLDER "Tests")
|
2015-03-13 16:21:01 +00:00
|
|
|
|
2015-09-24 17:42:46 +00:00
|
|
|
if (WIN32)
|
|
|
|
file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/tools/Get-HardenFlags.ps1 _win_harden_flags)
|
|
|
|
add_custom_target(hardening-check
|
2015-11-21 18:09:33 +00:00
|
|
|
COMMAND ${POWERSHELL_COMMAND} "${_win_harden_flags}" "${_dll_output_dir_win}"
|
2015-09-24 17:42:46 +00:00
|
|
|
DEPENDS ${PROGLIST}
|
|
|
|
COMMENT "Checking binaries for security features"
|
|
|
|
)
|
|
|
|
set_target_properties(hardening-check PROPERTIES FOLDER "Tests")
|
|
|
|
else ()
|
|
|
|
find_program(HARDENING_CHECK_EXECUTABLE hardening-check
|
|
|
|
DOC "Path to the hardening-check utility."
|
|
|
|
)
|
|
|
|
if (NOT "${HARDENING_CHECK_EXECUTABLE}" STREQUAL "HARDENING_CHECK_EXECUTABLE-NOTFOUND")
|
|
|
|
foreach(_prog ${PROGLIST})
|
|
|
|
get_target_property(_prog_dir ${_prog} RUNTIME_OUTPUT_DIRECTORY)
|
2015-11-30 08:19:03 +00:00
|
|
|
if ("${_prog_dir}" STREQUAL "_prog_dir-NOTFOUND")
|
2015-09-24 17:42:46 +00:00
|
|
|
set(_prog_dir "${CMAKE_BINARY_DIR}/run")
|
|
|
|
endif()
|
|
|
|
set(_prog_paths ${_prog_paths} "${_prog_dir}/${_prog}")
|
|
|
|
endforeach()
|
|
|
|
add_custom_target(hardening-check
|
|
|
|
COMMAND ${HARDENING_CHECK_EXECUTABLE} ${_prog_paths}
|
|
|
|
DEPENDS ${PROGLIST}
|
|
|
|
COMMENT "Checking binaries for security features"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
2015-03-13 16:21:01 +00:00
|
|
|
|
2016-03-11 19:51:39 +00:00
|
|
|
include( UseCheckAPI )
|
|
|
|
CHECKAPI(
|
|
|
|
NAME
|
|
|
|
main
|
|
|
|
SWITCHES
|
|
|
|
-build
|
|
|
|
SOURCES
|
|
|
|
${WIRESHARK_SRC}
|
|
|
|
${TSHARK_TAP_SRC}
|
|
|
|
)
|
|
|
|
|
2016-09-26 17:34:04 +00:00
|
|
|
find_program(SHELLCHECK_EXECUTABLE shellcheck
|
|
|
|
DOC "Path to the shellcheck utility."
|
|
|
|
)
|
|
|
|
if (NOT "${SHELLCHECK_EXECUTABLE}" STREQUAL "SHELLCHECK_EXECUTABLE-NOTFOUND")
|
|
|
|
add_custom_target(shellcheck)
|
|
|
|
set_target_properties(shellcheck PROPERTIES FOLDER "Tests")
|
|
|
|
# --external-sources requires 0.4.0 or later.
|
|
|
|
add_custom_command(TARGET shellcheck POST_BUILD
|
|
|
|
COMMAND shellcheck --external-sources
|
|
|
|
tools/fuzz-test.sh
|
|
|
|
tools/randpkt-test.sh
|
|
|
|
tools/runa2x.sh
|
|
|
|
tools/test-captures.sh
|
|
|
|
tools/valgrind-wireshark.sh
|
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2015-01-15 11:45:02 +00:00
|
|
|
#
|
|
|
|
# Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
#
|
|
|
|
# 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:
|
|
|
|
#
|