Allow constructing a StringView from a std::string_view
[alure.git] / cmake / FindVorbis.cmake
blobc3de467ef9d6723feb23e150fe3a85c08dc5a1e2
1 # - FindVorbis.cmake
2 # Find the native vorbis includes and libraries
4 # VORBIS_INCLUDE_DIRS - where to find vorbis/vorbis.h, etc.
5 # VORBIS_LIBRARIES - List of libraries when using vorbis(file).
6 # VORBIS_FOUND - True if vorbis found.
8 if(VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
9     # Already in cache, be silent
10     set(VORBIS_FIND_QUIETLY TRUE)
11 endif(VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
13 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
15 # MSVC built vorbis may be named vorbis_static
16 # The provided project files name the library with the lib prefix.
17 find_library(VORBIS_LIBRARY
18     NAMES vorbis vorbis_static libvorbis libvorbis_static
20 find_library(VORBISFILE_LIBRARY
21     NAMES vorbisfile vorbisfile_static libvorbisfile libvorbisfile_static
24 # Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
25 # to TRUE if all listed variables are TRUE.
26 include(FindPackageHandleStandardArgs)
27 find_package_handle_standard_args(VORBIS DEFAULT_MSG
28     VORBISFILE_LIBRARY VORBIS_LIBRARY VORBIS_INCLUDE_DIR
31 if(VORBIS_FOUND)
32     set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY})
33     set(VORBIS_INCLUDE_DIRS ${VORBIS_INCLUDE_DIR})
34 endif(VORBIS_FOUND)