1# This file was taken from Unvanquished,
2# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
3# It's licensed under the terms of the 3-clause OpenBSD license.
4# Modifications Copyright 2014-2015 the openage authors.
5# See copying.md for further legal info.
6
7# - Find opus library
8# Find the native Opus headers and libraries.
9# This module defines
10#  OPUS_INCLUDE_DIRS   - where to find opus/opus.h, opus/opusfile.h, etc
11#  OPUS_LIBRARIES      - List of libraries when using libopus
12#  OPUS_FOUND          - True if opus is found.
13
14# find the opusfile header, defines our api.
15find_path(OPUS_INCLUDE_DIR
16	NAMES opus/opusfile.h
17	DOC "Opus include directory"
18)
19mark_as_advanced(OPUS_INCLUDE_DIR)
20
21# look for libopusfile, the highlevel container-aware api.
22find_library(OPUSFILE_LIBRARY
23	NAMES opusfile
24	DOC "Path to OpusFile library"
25)
26mark_as_advanced(OPUSFILE_LIBRARY)
27
28# find libopus, the core codec component.
29find_library(OPUS_LIBRARY
30	NAMES opus
31	DOC "Path to Opus library"
32)
33mark_as_advanced(OPUS_LIBRARY)
34
35
36# handle the QUIETLY and REQUIRED arguments and set OPUSFILE_FOUND to TRUE if
37# all listed variables are TRUE
38include(FindPackageHandleStandardArgs)
39find_package_handle_standard_args(Opus DEFAULT_MSG OPUSFILE_LIBRARY OPUS_LIBRARY OPUS_INCLUDE_DIR)
40
41# export the variables
42set(OPUS_LIBRARIES "${OPUSFILE_LIBRARY}" "${OPUS_LIBRARY}")
43set(OPUS_INCLUDE_DIRS "${OPUS_INCLUDE_DIR}" "${OPUS_INCLUDE_DIR}/opus")
44