aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-07-12 20:25:33 +0200
committerOliver Smith <osmith@sysmocom.de>2021-08-02 12:30:45 +0200
commitadc002a04543afdd20d484bb9d836cecca5aef52 (patch)
treef1bc0a26f79acda63de9721f391f2794a7bad330 /cmake/modules
parent8ca21cbe7acb941b31eac4decc78fdccb6bbcb61 (diff)
Add AMR codec supportosmith/wip
CMake work and rebase on current wireshark master by Pau Espin Pedrol. Rebase on 3.4.7 by Oliver Smith. Change-Id: I5ec963b910f8f271aa2e5d680ea33e2170a6f367
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindAMRNB.cmake57
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 )