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)
17 find_path( AMRNB_INCLUDE_DIR
18 NAMES opencore-amrnb/interf_dec.h
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
30 PATHS /usr/local/lib /usr/lib
33 include( FindPackageHandleStandardArgs )
34 find_package_handle_standard_args( AMRNB DEFAULT_MSG AMRNB_LIBRARY AMRNB_INCLUDE_DIR)
37 set( AMRNB_INCLUDE_DIRS ${AMRNB_INCLUDE_DIR} )
38 set( AMRNB_LIBRARIES ${AMRNB_LIBRARY} )
40 set ( AMRNB_DLL_DIR "${AMRNB_HINTS}/bin"
41 CACHE PATH "Path to the AMR-NB DLL"
43 file( GLOB _amrnb_dll RELATIVE "${AMRNB_DLL_DIR}"
44 "${AMRNB_DLL_DIR}/libopencore-amrnb-0.dll"
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"
50 mark_as_advanced( AMRNB_DLL_DIR AMRNB_DLL )
53 set( AMRNB_INCLUDE_DIRS )
54 set( AMRNB_LIBRARIES )
57 mark_as_advanced( AMRNB_LIBRARIES AMRNB_INCLUDE_DIRS )