2
0

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