CMakeLists.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # -*- cmake -*-
  2. project(llaudio)
  3. include(00-Common)
  4. include(LLAudio)
  5. include(LLAudio)
  6. include(LLCommon)
  7. include(LLFilesystem)
  8. include(LLMath)
  9. include(LLMessage)
  10. include(OggVorbis)
  11. set(llaudio_SOURCE_FILES
  12. llaudioengine.cpp
  13. llaudiodecodemgr.cpp
  14. lllistener.cpp
  15. llvorbisencode.cpp
  16. )
  17. set(llaudio_HEADER_FILES
  18. CMakeLists.txt
  19. llaudioengine.h
  20. llaudiodecodemgr.h
  21. lllistener.h
  22. llvorbisencode.h
  23. llwindgen.h
  24. )
  25. if (FMOD)
  26. list(APPEND llaudio_SOURCE_FILES
  27. llaudioengine_fmod.cpp
  28. lllistener_fmod.cpp
  29. llstreamingaudio_fmod.cpp
  30. )
  31. list(APPEND llaudio_HEADER_FILES
  32. llaudioengine_fmod.h
  33. lllistener_fmod.h
  34. llstreamingaudio_fmod.h
  35. )
  36. endif ()
  37. if (OPENAL)
  38. list(APPEND llaudio_SOURCE_FILES
  39. llaudioengine_openal.cpp
  40. lllistener_openal.cpp
  41. )
  42. list(APPEND llaudio_HEADER_FILES
  43. llaudioengine_openal.h
  44. lllistener_openal.h
  45. )
  46. endif (OPENAL)
  47. set_source_files_properties(${llaudio_HEADER_FILES}
  48. PROPERTIES HEADER_FILE_ONLY TRUE)
  49. list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES})
  50. add_library (llaudio ${llaudio_SOURCE_FILES})
  51. add_dependencies(llaudio prepare)
  52. target_link_libraries(
  53. llaudio
  54. ${VORBISENC_LIBRARIES}
  55. ${VORBISFILE_LIBRARIES}
  56. ${VORBIS_LIBRARIES}
  57. ${OGG_LIBRARIES}
  58. ${FMOD_LIBRARY}
  59. ${OPENAL_LIBRARIES}
  60. )
  61. if (NOT ${CMAKE_VERSION} VERSION_LESS "3.16.0")
  62. if (USEUNITYBUILD)
  63. set_target_properties(llaudio PROPERTIES UNITY_BUILD ON UNITY_BUILD_BATCH_SIZE 0)
  64. else (USEUNITYBUILD)
  65. target_precompile_headers(llaudio PRIVATE <linden_common.h>)
  66. endif (USEUNITYBUILD)
  67. endif ()
  68. get_directory_property(ALLDEFINES COMPILE_DEFINITIONS)
  69. message("llaudio COMPILE_DEFINITIONS = ${ALLDEFINES}")