# Find opusfile
#
# This module defines
# OPUSFILE_INCLUDE_DIRS
# OPUSFILE_LIBRARIES
# OPUSFILE_FOUND

find_path(OPUSFILE_INCLUDE_DIR NAMES opusfile.h HINTS /usr/include/opus $ENV{OPUSFILE_HOME}/include/opus)
find_library(OPUSFILE_LIBRARY NAMES opusfile HINTS /lib /usr/lib $ENV{OPUSFILE_HOME}/lib)

find_library(OGG_LIBRARY NAMES ogg HINTS /lib /usr/lib $ENV{OGG_HOME}/lib)
find_library(OPUS_LIBRARY NAMES opus HINTS /lib /usr/lib $ENV{OPUS_HOME}/lib)

set(OPUSFILE_INCLUDE_DIRS ${OPUSFILE_INCLUDE_DIR})
set(OPUSFILE_LIBRARIES ${OPUSFILE_LIBRARY} ${OGG_LIBRARY} ${OPUS_LIBRARY})

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPUSFILE DEFAULT_MSG OPUSFILE_LIBRARY OPUSFILE_INCLUDE_DIR)

mark_as_advanced(OPUSFILE_INCLUDE_DIR OPUSFILE_LIBRARY)