OPENAL.cmake 870 B

1234567891011121314151617181920212223242526272829303132
  1. # -*- cmake -*-
  2. if (OPENAL_CMAKE_INCLUDED)
  3. return()
  4. endif (OPENAL_CMAKE_INCLUDED)
  5. set (OPENAL_CMAKE_INCLUDED TRUE)
  6. include(00-BuildOptions)
  7. include(Prebuilt)
  8. if (OPENAL)
  9. if (USESYSTEMLIBS)
  10. include(FindPkgConfig)
  11. include(FindOpenAL)
  12. pkg_check_modules(OPENAL_LIB openal)
  13. pkg_check_modules(FREEALUT_LIB freealut)
  14. endif (USESYSTEMLIBS)
  15. if (NOT OPENAL_LIB_FOUND OR NOT FREEALUT_LIB_FOUND)
  16. use_prebuilt_binary(openal-soft)
  17. set(OPENAL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
  18. endif (NOT OPENAL_LIB_FOUND OR NOT FREEALUT_LIB_FOUND)
  19. if (WINDOWS)
  20. set(OPENAL_LIBRARIES openal32 alut)
  21. else (WINDOWS)
  22. set(OPENAL_LIBRARIES openal alut)
  23. endif (WINDOWS)
  24. endif (OPENAL)
  25. if (OPENAL)
  26. message(STATUS "Building with OpenAL audio support")
  27. add_definitions(-DLL_OPENAL=1)
  28. include_directories(SYSTEM ${OPENAL_INCLUDE_DIR})
  29. endif (OPENAL)