aboutsummaryrefslogtreecommitdiff
path: root/cmake/modules/FindOpus.cmake
diff options
context:
space:
mode:
authorNiels Ole Salscheider <niels_ole@salscheider-online.de>2018-06-23 17:20:47 +0200
committerGitHub <noreply@github.com>2018-06-23 17:20:47 +0200
commited6b199dff15ddb4c6bd72d1565501e9f1a2bf87 (patch)
tree7bbb53c40ecf53fe9464b53b7966dd7726eeac5e /cmake/modules/FindOpus.cmake
parentea83c77a5a4524cc9778336b10eff60979582980 (diff)
parent31f0a42073b68823e85835ec3e25114d79705a04 (diff)
downloadqxmpp-ed6b199dff15ddb4c6bd72d1565501e9f1a2bf87.tar.gz
Merge pull request #131 from olesalscheider/cmake
Add CMake build system, drop Qt4 support
Diffstat (limited to 'cmake/modules/FindOpus.cmake')
-rw-r--r--cmake/modules/FindOpus.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/cmake/modules/FindOpus.cmake b/cmake/modules/FindOpus.cmake
new file mode 100644
index 00000000..fc13497b
--- /dev/null
+++ b/cmake/modules/FindOpus.cmake
@@ -0,0 +1,25 @@
+# Try to find Opus
+# Once done this will define
+# Opus_FOUND - System has Opus
+# Opus_INCLUDE_DIRS - The Opus include directories
+# Opus_LIBRARIES - The libraries needed to use Opus
+
+find_package(PkgConfig)
+pkg_check_modules(PC_Opus QUIET libopus)
+
+find_path(Opus_INCLUDE_DIR opus/opus.h
+ HINTS ${PC_Opus_INCLUDEDIR} ${PC_Opus_INCLUDE_DIRS}
+)
+
+find_library(Opus_LIBRARY NAMES opus
+ HINTS ${PC_Opus_LIBDIR} ${PC_Opus_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Opus DEFAULT_MSG Opus_LIBRARY Opus_INCLUDE_DIR)
+
+mark_as_advanced(Opus_INCLUDE_DIR Opus_LIBRARY)
+
+set(Opus_LIBRARIES ${Opus_LIBRARY})
+set(Opus_INCLUDE_DIRS ${Opus_INCLUDE_DIR})
+