aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2019-02-02 14:52:07 +0000
committerJoão Valverde <j@v6e.pt>2019-05-02 21:12:01 +0000
commit186f985793cceb7d7222955987df72ab5a82beeb (patch)
treeff6c744a7d5ee356b5bc6e8632916bbb68a6ca30 /cmake
parent854479a7dcd198fa2f167a7845e22688d2f710d5 (diff)
CMake: Check for and use system SpeexDSP library
Change-Id: I8443379d23a2946dd21c12e5e0bd5464ab73ca25 Reviewed-on: https://code.wireshark.org/review/31857 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindSpeexDSP.cmake38
1 files changed, 38 insertions, 0 deletions
diff --git a/cmake/modules/FindSpeexDSP.cmake b/cmake/modules/FindSpeexDSP.cmake
new file mode 100644
index 0000000000..6c111111e5
--- /dev/null
+++ b/cmake/modules/FindSpeexDSP.cmake
@@ -0,0 +1,38 @@
+#
+# - Find speexdsp libraries
+#
+# SPEEXDSP_INCLUDE_DIRS - where to find speexdsp headers.
+# SPEEXDSP_LIBRARIES - List of libraries when using speexdsp.
+# SPEEXDSP_FOUND - True if speexdsp is found.
+
+find_package(PkgConfig QUIET)
+pkg_search_module(PC_SPEEXDSP QUIET speexdsp)
+
+find_path(SPEEXDSP_INCLUDE_DIR
+ NAMES
+ speex/speex_resampler.h
+ HINTS
+ ${PC_SPEEXDSP_INCLUDE_DIRS}
+)
+
+find_library(SPEEXDSP_LIBRARY
+ NAMES
+ speexdsp
+ HINTS
+ ${PC_SPEEXDSP_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SpeexDSP
+ REQUIRED_VARS SPEEXDSP_LIBRARY SPEEXDSP_INCLUDE_DIR
+ VERSION_VAR PC_SPEEXDSP_VERSION)
+
+if(SPEEXDSP_FOUND)
+ set(SPEEXDSP_LIBRARIES ${SPEEXDSP_LIBRARY})
+ set(SPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR})
+else()
+ set(SPEEXDSP_LIBRARIES)
+ set(SPEEXDSP_INCLUDE_DIRS)
+endif()
+
+mark_as_advanced(SPEEXDSP_LIBRARIES SPEEXDSP_INCLUDE_DIRS)