regen pidl all: rm epan/dissectors/pidl/*-stamp; pushd epan/dissectors/pidl/ && make...
[wireshark-sm.git] / cmake / modules / FindAMRNB.cmake
blob4c5babe2f4a5fc582576497af87df68102bef49d
1 # Find the system's opencore-amrnb includes and library
3 #  AMRNB_INCLUDE_DIRS - where to find amrnb/decoder.h
4 #  AMRNB_LIBRARIES    - List of libraries when using amrnb
5 #  AMRNB_FOUND        - True if amrnb found
6 #  AMRNB_DLL_DIR      - (Windows) Path to the amrnb DLL
7 #  AMRNB_DLL          - (Windows) Name of the amrnb DLL
9 include( FindWSWinLibs )
10 FindWSWinLibs( "opencore-amr-.*" "AMRNB_HINTS" )
12 if (NOT USE_REPOSITORY)
13   find_package(PkgConfig)
14   pkg_search_module(PC_AMRNB opencore-amrnb)
15 endif()
17 find_path( AMRNB_INCLUDE_DIR
18   NAMES opencore-amrnb/interf_dec.h
19   HINTS
20     "${PC_AMRNB_INCLUDE_DIRS}"
21     "${AMRNB_HINTS}/include"
22   PATHS /usr/local/include /usr/include
25 find_library( AMRNB_LIBRARY
26   NAMES opencore-amrnb libopencore-amrnb-0
27   HINTS
28     "${PC_AMRNB_LIBDIRS}"
29     "${AMRNB_HINTS}/lib"
30   PATHS /usr/local/lib /usr/lib
33 include( FindPackageHandleStandardArgs )
34 find_package_handle_standard_args( AMRNB DEFAULT_MSG AMRNB_LIBRARY AMRNB_INCLUDE_DIR)
36 if( AMRNB_FOUND )
37   set( AMRNB_INCLUDE_DIRS ${AMRNB_INCLUDE_DIR} )
38   set( AMRNB_LIBRARIES ${AMRNB_LIBRARY} )
39   if (WIN32)
40     set ( AMRNB_DLL_DIR "${AMRNB_HINTS}/bin"
41       CACHE PATH "Path to the AMR-NB DLL"
42     )
43     file( GLOB _amrnb_dll RELATIVE "${AMRNB_DLL_DIR}"
44       "${AMRNB_DLL_DIR}/libopencore-amrnb-0.dll"
45     )
46     set ( AMRNB_DLL ${_amrnb_dll}
47       # We're storing filenames only. Should we use STRING instead?
48       CACHE FILEPATH "AMR NB-DLL file name"
49     )
50     mark_as_advanced( AMRNB_DLL_DIR AMRNB_DLL )
51   endif()
52 else()
53   set( AMRNB_INCLUDE_DIRS )
54   set( AMRNB_LIBRARIES )
55 endif()
57 mark_as_advanced( AMRNB_LIBRARIES AMRNB_INCLUDE_DIRS )