Add cmake helper files for finding wireshark

These files make it possible to use the cmake command find_package(Wirehark) to obtain information about the wireshark installation.

Change-Id: I5af7c4e7b53b99cd473e04905a92bac267cd9b83
Reviewed-on: https://code.wireshark.org/review/5235
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Maarten Bezemer 2014-11-11 14:41:01 +01:00 committed by Michael Mann
parent ec28d8755b
commit ce687075f0
5 changed files with 60 additions and 0 deletions

View File

@ -1789,6 +1789,18 @@ CHECKAPI(
${WIRESHARK_SRC}
)
set(CMAKE_INSTALL_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@)
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
${CMAKE_MODULE_PATH}/FindWireshark.cmake
${CMAKE_BINARY_DIR}/WiresharkConfig.cmake
${CMAKE_BINARY_DIR}/WiresharkConfigVersion.cmake
DESTINATION
${CMAKE_INSTALL_MODULES_DIR}
)
if(DOC_DIR)
message(STATUS "Docdir install: ${DOC_DIR}")
INSTALL(

View File

@ -0,0 +1,25 @@
# Locate the Wireshark library.
#
# This file is meant to be copied into projects that want to use Wireshark.
# It will search for WiresharkConfig.cmake, which ships with Wireshark
# and will provide up-to-date buildsystem changes. Thus there should not be
# any need to update FindWiresharkVc.cmake again after you integrated it into
# your project.
#
# This module defines the following variables:
# Wireshark_FOUND
# Wireshark_VERSION_MAJOR
# Wireshark_VERSION_MINOR
# Wireshark_VERSION_PATCH
# Wireshark_VERSION
# Wireshark_VERSION_STRING
# Wireshark_INSTALL_DIR
# Wireshark_PLUGIN_INSTALL_DIR
# Wireshark_LIB_DIR
# Wireshark_INCLUDE_DIR
# Wireshark_CMAKE_MODULES_DIR
find_package(Wireshark ${Wireshark_FIND_VERSION} QUIET NO_MODULE PATHS $ENV{HOME} /opt/Wireshark)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WiresharkCONFIG_MODE)

View File

@ -0,0 +1,12 @@
set(Wireshark_MAJOR_VERSION "@PROJECT_MAJOR_VERSION@" )
set(Wireshark_MINOR_VERSION "@PROJECT_MINOR_VERSION@" )
set(Wireshark_PATCH_VERSION "@PROJECT_PATCH_VERSION@" )
set(Wireshark_VERSION @PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@)
set(Wireshark_VERSION_STRING "@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@")
set(Wireshark_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@")
set(Wireshark_PLUGIN_INSTALL_DIR "@PLUGIN_INSTALL_DIR@")
set(Wireshark_LIB_DIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@")
set(Wireshark_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/wireshark")
set(Wireshark_CMAKE_MODULES_DIR "@CMAKE_INSTALL_MODULES_DIR@")

View File

@ -0,0 +1,10 @@
set(PACKAGE_VERSION @PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@)
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if("${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

View File

@ -4,3 +4,4 @@ tools/asn2deb usr/bin
tools/wireshark_be.py usr/share/pyshared
tools/wireshark_gen.py usr/share/pyshared
tools/asn2wrs.py usr/share/pyshared
usr/lib/*/wireshark/*.cmake