xref: /libbtbb/wireshark/plugins-legacy/btle/cmake/FindWireshark.cmake (revision e018180df8c9bd1ca869d5329a027253be1a76ec)
1*e018180dSDominic Spill#
2*e018180dSDominic Spill# Try to find the wireshark library and its includes
3*e018180dSDominic Spill#
4*e018180dSDominic Spill# This snippet sets the following variables:
5*e018180dSDominic Spill#  WIRESHARK_FOUND             True if wireshark library got found
6*e018180dSDominic Spill#  WIRESHARK_INCLUDE_DIRS      Location of the wireshark headers
7*e018180dSDominic Spill#  WIRESHARK_LIBRARIES         List of libraries to use wireshark
8*e018180dSDominic Spill#
9*e018180dSDominic Spill#  Copyright (c) 2011 Reinhold Kainhofer <[email protected]>
10*e018180dSDominic Spill#
11*e018180dSDominic Spill#  Redistribution and use is allowed according to the terms of the New
12*e018180dSDominic Spill#  BSD license.
13*e018180dSDominic Spill#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14*e018180dSDominic Spill#
15*e018180dSDominic Spill
16*e018180dSDominic Spill# wireshark does not install its library with pkg-config information,
17*e018180dSDominic Spill# so we need to manually find the libraries and headers
18*e018180dSDominic Spill
19*e018180dSDominic SpillFIND_PATH( WIRESHARK_INCLUDE_DIRS epan/packet.h PATH_SUFFIXES wireshark )
20*e018180dSDominic SpillFIND_LIBRARY( WIRESHARK_LIBRARIES wireshark )
21*e018180dSDominic Spill
22*e018180dSDominic Spill# Report results
23*e018180dSDominic SpillIF ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )
24*e018180dSDominic Spill  SET( WIRESHARK_FOUND 1 )
25*e018180dSDominic SpillELSE ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )
26*e018180dSDominic Spill  MESSAGE( SEND_ERROR "Could NOT find the wireshark library and headers" )
27*e018180dSDominic SpillENDIF ( WIRESHARK_LIBRARIES AND WIRESHARK_INCLUDE_DIRS )
28*e018180dSDominic Spill
29