TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / cmake / modules / FindSpeexDSP.cmake
blob2df717d5747fcee5ce81681d3719dac3d90877d5
1 # Find the system's SpeexDSP includes and library
3 #  SPEEXDSP_INCLUDE_DIRS - where to find SpeexDSP headers
4 #  SPEEXDSP_LIBRARIES    - List of libraries when using SpeexDSP
5 #  SPEEXDSP_FOUND        - True if SpeexDSP found
6 #  SPEEXDSP_DLL_DIR      - (Windows) Path to the SpeexDSP DLL
7 #  SPEEXDSP_DLL          - (Windows) Name of the SpeexDSP DLL
9 include(FindWSWinLibs)
10 FindWSWinLibs("speexdsp-.*" "SPEEXDSP_HINTS")
12 if(NOT USE_REPOSITORY)
13   find_package(PkgConfig)
14   pkg_search_module(PC_SPEEXDSP speexdsp)
15 endif()
18 find_path(SPEEXDSP_INCLUDE_DIR
19   NAMES
20     speex/speex_resampler.h
21   HINTS
22     ${PC_SPEEXDSP_INCLUDE_DIRS}
23     ${SPEEXDSP_HINTS}/include
26 find_library(SPEEXDSP_LIBRARY
27   NAMES
28     speexdsp
29   HINTS
30     ${PC_SPEEXDSP_LIBRARY_DIRS}
31     ${SPEEXDSP_HINTS}/lib
34 include(FindPackageHandleStandardArgs)
35 find_package_handle_standard_args(SpeexDSP DEFAULT_MSG SPEEXDSP_LIBRARY SPEEXDSP_INCLUDE_DIR)
37 if(SPEEXDSP_FOUND)
38   set(SPEEXDSP_LIBRARIES ${SPEEXDSP_LIBRARY})
39   set(SPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR})
40   if(WIN32)
41     set(SPEEXDSP_DLL_DIR "${SPEEXDSP_HINTS}/bin"
42       CACHE PATH "Path to SpeexDSP DLL"
43     )
44     file(GLOB _speexdsp_dll RELATIVE "${SPEEXDSP_DLL_DIR}"
45       "${SPEEXDSP_DLL_DIR}/libspeexdsp.dll"
46     )
47     set(SPEEXDSP_DLL ${_speexdsp_dll}
48       # We're storing filenames only. Should we use STRING instead?
49       CACHE FILEPATH "SpeexDSP DLL file name"
50     )
51     mark_as_advanced(SPEEXDSP_DLL_DIR SPEEXDSP_DLL)
52   endif()
53 else()
54   set(SPEEXDSP_LIBRARIES)
55   set(SPEEXDSP_INCLUDE_DIRS)
56 endif()
58 mark_as_advanced(SPEEXDSP_LIBRARIES SPEEXDSP_INCLUDE_DIRS)