OggVorbis.cmake 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # -*- cmake -*-
  2. if (OGGVORBIS_CMAKE_INCLUDED)
  3. return()
  4. endif (OGGVORBIS_CMAKE_INCLUDED)
  5. set (OGGVORBIS_CMAKE_INCLUDED TRUE)
  6. include(Prebuilt)
  7. if (USESYSTEMLIBS)
  8. include(FindPkgConfig)
  9. pkg_check_modules(OGG ogg)
  10. pkg_check_modules(VORBIS vorbis)
  11. pkg_check_modules(VORBISENC vorbisenc)
  12. pkg_check_modules(VORBISFILE vorbisfile)
  13. endif (USESYSTEMLIBS)
  14. if (NOT OGG_FOUND OR NOT VORBIS_FOUND OR NOT VORBISENC_FOUND OR NOT VORBISFILE_FOUND)
  15. use_prebuilt_binary(ogg-vorbis)
  16. set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
  17. if (WINDOWS)
  18. set(OGG_LIBRARIES ogg_static)
  19. set(VORBIS_LIBRARIES vorbis_static)
  20. set(VORBISENC_LIBRARIES vorbisenc_static)
  21. set(VORBISFILE_LIBRARIES vorbisfile_static)
  22. else (WINDOWS)
  23. set(OGG_LIBRARIES ogg)
  24. set(VORBIS_LIBRARIES vorbis)
  25. set(VORBISENC_LIBRARIES vorbisenc)
  26. set(VORBISFILE_LIBRARIES vorbisfile)
  27. endif (WINDOWS)
  28. endif (NOT OGG_FOUND OR NOT VORBIS_FOUND OR NOT VORBISENC_FOUND OR NOT VORBISFILE_FOUND)
  29. if (NOT WINDOWS)
  30. add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
  31. endif (NOT WINDOWS)
  32. link_directories(
  33. ${VORBIS_LIBRARY_DIRS}
  34. ${VORBISENC_LIBRARY_DIRS}
  35. ${VORBISFILE_LIBRARY_DIRS}
  36. ${OGG_LIBRARY_DIRS}
  37. )
  38. include_directories(SYSTEM
  39. ${VORBIS_INCLUDE_DIRS}
  40. ${VORBISENC_INCLUDE_DIRS}
  41. ${VORBISFILE_INCLUDE_DIRS}
  42. )