diff options
author | Maarten Bezemer <maarten.bezemer@gmail.com> | 2014-11-11 14:41:01 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-12-16 14:18:02 +0000 |
commit | ce687075f04a950f8fd95d6b517c11eb2ee9fa62 (patch) | |
tree | dc8c1ad29bc90842546dc31b7d0c660b72f236ef /cmake/modules | |
parent | ec28d8755ba1b0fff1b07ac13c3264465e0eb635 (diff) |
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>
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/FindWireshark.cmake | 25 | ||||
-rw-r--r-- | cmake/modules/WiresharkConfig.cmake.in | 12 | ||||
-rw-r--r-- | cmake/modules/WiresharkConfigVersion.cmake.in | 10 |
3 files changed, 47 insertions, 0 deletions
diff --git a/cmake/modules/FindWireshark.cmake b/cmake/modules/FindWireshark.cmake new file mode 100644 index 0000000000..27259d3c3d --- /dev/null +++ b/cmake/modules/FindWireshark.cmake @@ -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) diff --git a/cmake/modules/WiresharkConfig.cmake.in b/cmake/modules/WiresharkConfig.cmake.in new file mode 100644 index 0000000000..a10baad960 --- /dev/null +++ b/cmake/modules/WiresharkConfig.cmake.in @@ -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@") diff --git a/cmake/modules/WiresharkConfigVersion.cmake.in b/cmake/modules/WiresharkConfigVersion.cmake.in new file mode 100644 index 0000000000..0aa3286904 --- /dev/null +++ b/cmake/modules/WiresharkConfigVersion.cmake.in @@ -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() |