diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2016-07-12 20:25:33 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-05-15 21:27:45 +0200 |
commit | 07a0e68377b9efcd9cf30a7671e8043c9cd120ba (patch) | |
tree | 02f0f3dd4e0ce52838cf7110f7b8a73fc69aa423 /cmake/modules/FindAMRNB.cmake | |
parent | 2db3db56bfd1ba38c5f42015622dbc8530ed05e9 (diff) |
Add AMR codec support
CMake work and rebase on current wireshark master by Pau Espin Pedrol.
Change-Id: I5ec963b910f8f271aa2e5d680ea33e2170a6f367
Diffstat (limited to 'cmake/modules/FindAMRNB.cmake')
-rw-r--r-- | cmake/modules/FindAMRNB.cmake | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/cmake/modules/FindAMRNB.cmake b/cmake/modules/FindAMRNB.cmake new file mode 100644 index 0000000000..21f152ba11 --- /dev/null +++ b/cmake/modules/FindAMRNB.cmake @@ -0,0 +1,57 @@ +# Find the system's opencore-amrnb includes and library +# +# AMRNB_INCLUDE_DIRS - where to find amrnb/decoder.h +# AMRNB_LIBRARIES - List of libraries when using amrnb +# AMRNB_FOUND - True if amrnb found +# AMRNB_DLL_DIR - (Windows) Path to the amrnb DLL +# AMRNB_DLL - (Windows) Name of the amrnb DLL + +include( FindWSWinLibs ) +FindWSWinLibs( "opencore-amrnb-.*" "AMRNB_HINTS" ) + +if (NOT WIN32) + find_package(PkgConfig) + pkg_search_module(AMRNB opencore-amrnb) +endif() + +find_path( AMRNB_INCLUDE_DIR + NAMES opencore-amrnb/interf_dec.h + HINTS + "${AMRNB_INCLUDE_DIR}" + "${AMRNB_HINTS}/include" + PATHS /usr/local/include /usr/include +) + +find_library( AMRNB_LIBRARY + NAMES opencore-amrnb + HINTS + "${AMRNB_LIBDIR}" + "${AMRNB_HINTS}/lib" + PATHS /usr/local/lib /usr/lib +) + +include( FindPackageHandleStandardArgs ) +find_package_handle_standard_args( amrnb DEFAULT_MSG AMRNB_INCLUDE_DIR AMRNB_LIBRARY ) + +if( AMRNB_FOUND ) + set( AMRNB_INCLUDE_DIRS ${AMRNB_INCLUDE_DIR} ) + set( AMRNB_LIBRARIES ${AMRNB_LIBRARY} ) + if (WIN32) + set ( AMRNB_DLL_DIR "${AMRNB_HINTS}/bin" + CACHE PATH "Path to amrnb DLL" + ) + file( GLOB _amrnb_dll RELATIVE "${AMRNB_DLL_DIR}" + "${AMRNB_DLL_DIR}/libamrnb.dll" + ) + set ( AMRNB_DLL ${_amrnb_dll} + # We're storing filenames only. Should we use STRING instead? + CACHE FILEPATH "amrnb DLL file name" + ) + mark_as_advanced( AMRNB_DLL_DIR AMRNB_DLL ) + endif() +else() + set( AMRNB_INCLUDE_DIRS ) + set( AMRNB_LIBRARIES ) +endif() + +mark_as_advanced( AMRNB_LIBRARIES AMRNB_INCLUDE_DIRS ) |