TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / cmake / modules / FindSPANDSP.cmake
blobd4b6de2341701842f0000cae26bf3dbd33f23cee
1 # Find the system's SpanDSP includes and library
3 #  SPANDSP_INCLUDE_DIRS - where to find spandsp.h
4 #  SPANDSP_LIBRARIES    - List of libraries when using SpanDSP
5 #  SPANDSP_FOUND        - True if SpanDSP found
6 #  SPANDSP_DLL_DIR      - (Windows) Path to the SpanDSP DLL
7 #  SPANDSP_DLL          - (Windows) Name of the SpanDSP DLL
9 include( FindWSWinLibs )
10 FindWSWinLibs( "spandsp-.*" "SPANDSP_HINTS" )
12 if( NOT USE_REPOSITORY)
13   find_package(PkgConfig)
14   pkg_search_module(SPANDSP spandsp)
16   # spandsp.h might include tiffio.h.
17   find_package(TIFF QUIET)
18 endif()
21 find_path( SPANDSP_INCLUDE_DIR
22   NAMES spandsp.h
23   HINTS
24     "${SPANDSP_INCLUDEDIR}"
25     "${SPANDSP_HINTS}/include"
26   PATHS /usr/local/include /usr/include
29 find_library( SPANDSP_LIBRARY
30   NAMES
31     spandsp
32     libspandsp-2
33   HINTS
34     "${SPANDSP_LIBDIR}"
35     "${SPANDSP_HINTS}/lib"
36   PATHS /usr/local/lib /usr/lib
39 include( FindPackageHandleStandardArgs )
40 find_package_handle_standard_args( SPANDSP DEFAULT_MSG SPANDSP_LIBRARY SPANDSP_INCLUDE_DIR )
42 if( SPANDSP_FOUND )
43   set( SPANDSP_INCLUDE_DIRS ${SPANDSP_INCLUDE_DIR} )
44   if( TIFF_FOUND )
45     list(APPEND SPANDSP_INCLUDE_DIRS ${TIFF_INCLUDE_DIR})
46   endif()
47   set( SPANDSP_LIBRARIES ${SPANDSP_LIBRARY} )
48   if (WIN32)
49     set ( SPANDSP_DLL_DIR "${SPANDSP_HINTS}/bin"
50       CACHE PATH "Path to SpanDSP DLL"
51     )
52     file( GLOB _spandsp_dll RELATIVE "${SPANDSP_DLL_DIR}"
53       "${SPANDSP_DLL_DIR}/libspandsp-*.dll"
54     )
55     set ( SPANDSP_DLL ${_spandsp_dll}
56       # We're storing filenames only. Should we use STRING instead?
57       CACHE FILEPATH "SpanDSP DLL file name"
58     )
59     mark_as_advanced( SPANDSP_DLL_DIR SPANDSP_DLL )
60   endif()
61 else()
62   set( SPANDSP_INCLUDE_DIRS )
63   set( SPANDSP_LIBRARIES )
64 endif()
66 mark_as_advanced( SPANDSP_LIBRARIES SPANDSP_INCLUDE_DIRS )