aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2017-07-26 23:23:12 +0200
committerAnders Broman <a.broman58@gmail.com>2017-07-30 05:22:35 +0000
commit3e54cabf8193e6a8cd607b1671defb8b6800b53d (patch)
tree63297098c0c26c1c875ab0959d9679d70b3c6e65 /cmake/modules
parent32b446d5a8f146565b81324d1a18bcb053e07c5f (diff)
Add G.729 decoding based on bcg729 library
Bug: 13635 Change-Id: Ic22a0719a59da13e51425aeb747e88caca0d6512 Reviewed-on: https://code.wireshark.org/review/22808 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindBCG729.cmake55
1 files changed, 55 insertions, 0 deletions
diff --git a/cmake/modules/FindBCG729.cmake b/cmake/modules/FindBCG729.cmake
new file mode 100644
index 0000000000..2ca4d48d0f
--- /dev/null
+++ b/cmake/modules/FindBCG729.cmake
@@ -0,0 +1,55 @@
+# Find the system's bcg729 includes and library
+#
+# BCG729_INCLUDE_DIRS - where to find bcg729/decoder.h
+# BCG729_LIBRARIES - List of libraries when using bcg729
+# BCG729_FOUND - True if bcg729 found
+# BCG729_DLL_DIR - (Windows) Path to the bcg729 DLL
+# BCG729_DLL - (Windows) Name of the bcg729 DLL
+
+include( FindWSWinLibs )
+FindWSWinLibs( "bcg729-.*" "BCG729_HINTS" )
+
+find_package(PkgConfig)
+pkg_search_module(BCG729 bcg729)
+
+find_path( BCG729_INCLUDE_DIR
+ NAMES bcg729/decoder.h
+ HINTS
+ "${BCG729_INCLUDE_DIR}"
+ "${BCG729_HINTS}/include"
+ PATHS /usr/local/include /usr/include
+)
+
+find_library( BCG729_LIBRARY
+ NAMES bcg729
+ HINTS
+ "${BCG729_LIBDIR}"
+ "${BCG729_HINTS}/lib"
+ PATHS /usr/local/lib /usr/lib
+)
+
+include( FindPackageHandleStandardArgs )
+find_package_handle_standard_args( bcg729 DEFAULT_MSG BCG729_INCLUDE_DIR BCG729_LIBRARY )
+
+if( BCG729_FOUND )
+ set( BCG729_INCLUDE_DIRS ${BCG729_INCLUDE_DIR} )
+ set( BCG729_LIBRARIES ${BCG729_LIBRARY} )
+ if (WIN32)
+ set ( BCG729_DLL_DIR "${BCG729_HINTS}/bin"
+ CACHE PATH "Path to bcg729 DLL"
+ )
+ file( GLOB _bcg729_dll RELATIVE "${BCG729_DLL_DIR}"
+ "${BCG729_DLL_DIR}/libbcg729.dll"
+ )
+ set ( BCG729_DLL ${_bcg729_dll}
+ # We're storing filenames only. Should we use STRING instead?
+ CACHE FILEPATH "bcg729 DLL file name"
+ )
+ mark_as_advanced( BCG729_DLL_DIR BCG729_DLL )
+ endif()
+else()
+ set( BCG729_INCLUDE_DIRS )
+ set( BCG729_LIBRARIES )
+endif()
+
+mark_as_advanced( BCG729_LIBRARIES BCG729_INCLUDE_DIRS )