forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindOpusFile.cmake
More file actions
34 lines (28 loc) · 1.08 KB
/
FindOpusFile.cmake
File metadata and controls
34 lines (28 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Filename: FindOpusFile.cmake
# Authors: CFSworks (13 Jan, 2019)
#
# Usage:
# find_package(OpusFile [REQUIRED] [QUIET])
#
# Once done this will define:
# OPUSFILE_FOUND - system has Ogg and opusfile
# OPUSFILE_INCLUDE_DIRS - the include directory/ies containing opus/ and ogg/
# OPUSFILE_LIBRARIES - the paths to the opus and opusfile libraries
#
# Find Ogg
find_package(Ogg QUIET)
# Find Opus
find_path(OPUS_INCLUDE_DIR NAMES "opus/opusfile.h")
find_library(OPUS_opus_LIBRARY NAMES "opus")
find_library(OPUS_opusfile_LIBRARY NAMES "opusfile")
mark_as_advanced(OPUS_INCLUDE_DIR OPUS_opus_LIBRARY OPUS_opusfile_LIBRARY)
# Define output variables
set(OPUSFILE_INCLUDE_DIRS ${OPUS_INCLUDE_DIR} "${OPUS_INCLUDE_DIR}/opus")
if(NOT OGG_INCLUDE_DIR STREQUAL OPUS_INCLUDE_DIR)
list(APPEND OPUSFILE_INCLUDE_DIRS ${OGG_INCLUDE_DIR})
endif()
set(OPUSFILE_LIBRARIES ${OPUS_opusfile_LIBRARY} ${OPUS_opus_LIBRARY} ${OGG_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpusFile DEFAULT_MSG
Ogg_FOUND
OPUS_INCLUDE_DIR OPUS_opus_LIBRARY OPUS_opusfile_LIBRARY)