From 07a0e68377b9efcd9cf30a7671e8043c9cd120ba Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Tue, 12 Jul 2016 20:25:33 +0200 Subject: Add AMR codec support CMake work and rebase on current wireshark master by Pau Espin Pedrol. Change-Id: I5ec963b910f8f271aa2e5d680ea33e2170a6f367 --- cmake/modules/FindAMRNB.cmake | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 cmake/modules/FindAMRNB.cmake (limited to 'cmake/modules') 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 ) -- cgit v1.2.3