FindVorbis.cmake 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # - Find vorbis
  2. # Find the native vorbis includes and libraries
  3. #
  4. # VORBIS_INCLUDE_DIR - where to find vorbis.h, etc.
  5. # VORBIS_LIBRARIES - List of libraries when using vorbis(file).
  6. # VORBIS_FOUND - True if vorbis found.
  7. if(NOT GP2XWIZ)
  8. if(VORBIS_INCLUDE_DIR)
  9. # Already in cache, be silent
  10. set(VORBIS_FIND_QUIETLY TRUE)
  11. endif(VORBIS_INCLUDE_DIR)
  12. find_path(OGG_INCLUDE_DIR ogg/ogg.h)
  13. find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
  14. # MSVC built ogg/vorbis may be named ogg_static and vorbis_static
  15. find_library(OGG_LIBRARY NAMES ogg ogg_static)
  16. find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static)
  17. find_library(VORBISFILE_LIBRARY NAMES vorbisfile vorbisfile_static)
  18. # Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
  19. # to TRUE if all listed variables are TRUE.
  20. include(FindPackageHandleStandardArgs)
  21. find_package_handle_standard_args(VORBIS DEFAULT_MSG
  22. OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR
  23. OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
  24. else(NOT GP2XWIZ)
  25. find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h)
  26. find_library(VORBIS_LIBRARY NAMES vorbis_dec)
  27. find_package_handle_standard_args(VORBIS DEFAULT_MSG
  28. VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
  29. endif(NOT GP2XWIZ)
  30. if(VORBIS_FOUND)
  31. if(NOT GP2XWIZ)
  32. set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}
  33. ${OGG_LIBRARY})
  34. else(NOT GP2XWIZ)
  35. set(VORBIS_LIBRARIES ${VORBIS_LIBRARY})
  36. endif(NOT GP2XWIZ)
  37. else(VORBIS_FOUND)
  38. set(VORBIS_LIBRARIES)
  39. endif(VORBIS_FOUND)
  40. mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR)
  41. mark_as_advanced(OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)