FindVorbis.cmake 1.2 KB

1234567891011121314151617181920212223242526272829
  1. # - Find vorbis
  2. # Find the native vorbis includes and libraries
  3. #
  4. # VORBIS_INCLUDE_DIRS - where to find vorbis.h, etc.
  5. # VORBIS_LIBRARIES - List of libraries when using vorbis(file).
  6. # VORBIS_FOUND - True if vorbis found.
  7. find_package(Ogg)
  8. if(OGG_FOUND)
  9. find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
  10. # MSVC built vorbis may be named vorbis_static
  11. # The provided project files name the library with the lib prefix.
  12. find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static libvorbis libvorbis_static)
  13. find_library(VORBISFILE_LIBRARY NAMES vorbisfile vorbisfile_static libvorbisfile libvorbisfile_static)
  14. # Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
  15. # to TRUE if all listed variables are TRUE.
  16. include(FindPackageHandleStandardArgs)
  17. find_package_handle_standard_args(VORBIS DEFAULT_MSG VORBIS_INCLUDE_DIR VORBIS_LIBRARY VORBISFILE_LIBRARY)
  18. endif(OGG_FOUND)
  19. if(VORBIS_FOUND)
  20. set(VORBIS_INCLUDE_DIRS ${VORBIS_INCLUDE_DIR})
  21. set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
  22. else(VORBIS_FOUND)
  23. set(VORBIS_INCLUDE_DIRS)
  24. set(VORBIS_LIBRARIES)
  25. endif(VORBIS_FOUND)
  26. mark_as_advanced(VORBIS_INCLUDE_DIR VORBIS_LIBRARY VORBISFILE_LIBRARY)