1# - Try to find VORBIS
2# and define
3#
4#  VORBIS_FOUND        - System has VORBIS
5#  VORBIS_INCLUDE_DIRS - The include directories
6#  VORBIS_LIBRARY      - The libraries
7#  VORBISFILE_LIBRARY  - The vorbisfile
8
9# try to find package and provide a hint
10find_package(PkgConfig QUIET)
11pkg_check_modules(PC_VORBISFILE QUIET vorbisfile)
12find_path(VORBIS_INCLUDE_DIRS NAMES vorbis/vorbisfile.h HINTS ${PC_VORBIS_INCLUDE_DIRS} PATH_SUFFIXES vorbis)
13find_library(VORBIS_LIBRARY NAMES vorbis HINTS ${PC_VORBIS_LIBRARY_DIRS})
14
15# Find vorbisfile dependency
16find_package(PkgConfig QUIET)
17pkg_check_modules(PC_VORBISFILE QUIET vorbisfile)
18find_library(VORBISFILE_LIBRARY NAMES vorbisfile HINTS ${PC_VORBIS_LIBRARY_DIRS})
19
20include(FindPackageHandleStandardArgs)
21
22find_package_handle_standard_args(vorbis DEFAULT_MSG VORBIS_LIBRARY VORBIS_INCLUDE_DIRS)
23find_package_handle_standard_args(vorbisfile DEFAULT_MSG VORBISFILE_LIBRARY VORBIS_INCLUDE_DIRS)