Merge branch 'ryzom/ark-features' into main/gingo-test
[ryzomcore.git] / nel / src / sound / CMakeLists.txt
blob0a6f78646dcfd1663a1a2f9541674d51000e3bed
1 FILE(GLOB SRC *.cpp *.h)
2 FILE(GLOB HEADERS ../../include/nel/sound/*.h)
4 IF(NOT FFMPEG_FOUND)
5   LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/audio_decoder_ffmpeg.cpp)
6   LIST(REMOVE_ITEM HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/nel/sound/audio_decoder_ffmpeg.h)
7 ENDIF()
9 FILE(GLOB ANIMATION
10         sound_anim_manager.cpp ../../include/nel/sound/sound_anim_manager.h
11         sound_anim_marker.cpp ../../include/nel/sound/sound_anim_marker.h
12         sound_animation.cpp ../../include/nel/sound/sound_animation.h
15 FILE(GLOB BACKGROUND_SOUND
16         background_sound.cpp ../../include/nel/sound/background_sound.h
17         background_sound_manager.cpp ../../include/nel/sound/background_sound_manager.h
18         background_source.cpp ../../include/nel/sound/background_source.h
19         clustered_sound.cpp ../../include/nel/sound/clustered_sound.h
20         context_sound.cpp ../../include/nel/sound/context_sound.h
23 FILE(GLOB BANKS
24         async_file_manager_sound.cpp ../../include/nel/sound/async_file_manager_sound.h
25         sample_bank.cpp ../../include/nel/sound/sample_bank.h
26         sample_bank_manager.cpp ../../include/nel/sound/sample_bank_manager.h
27         sound_bank.cpp ../../include/nel/sound/sound_bank.h
30 FILE(GLOB MIXER
31         audio_mixer_user.cpp ../../include/nel/sound/audio_mixer_user.h
32         ../../include/nel/sound/containers.h
33         group_controller.cpp ../../include/nel/sound/group_controller.h
34         group_controller_root.cpp ../../include/nel/sound/group_controller_root.h
35         listener_user.cpp ../../include/nel/sound/listener_user.h
36         mixing_track.cpp ../../include/nel/sound/mixing_track.h
39 FILE(GLOB MUSIC
40         music_channel_fader.cpp ../../include/nel/sound/music_channel_fader.h
41         music_sound.cpp ../../include/nel/sound/music_sound.h
42         music_sound_manager.cpp ../../include/nel/sound/music_sound_manager.h
43         music_source.cpp ../../include/nel/sound/music_source.h
44         source_music_channel.cpp ../../include/nel/sound/source_music_channel.h
47 FILE(GLOB SOUND
48         complex_sound.cpp ../../include/nel/sound/complex_sound.h
49         complex_source.cpp ../../include/nel/sound/complex_source.h
50         simple_sound.cpp ../../include/nel/sound/simple_sound.h
51         simple_source.cpp ../../include/nel/sound/simple_source.h
52         sound.cpp ../../include/nel/sound/sound.h
53         ../../include/nel/sound/sound_pattern.h
54         source_common.cpp ../../include/nel/sound/source_common.h
57 FILE(GLOB STREAM
58         stream_sound.cpp ../../include/nel/sound/stream_sound.h
59         stream_source.cpp ../../include/nel/sound/stream_source.h
62 FILE(GLOB STREAM_FILE
63         audio_decoder.cpp ../../include/nel/sound/audio_decoder.h
64         audio_decoder_vorbis.cpp ../../include/nel/sound/audio_decoder_vorbis.h
65         audio_decoder_mp3.cpp ../../include/nel/sound/audio_decoder_mp3.h
66         audio_decoder_ffmpeg.cpp ../../include/nel/sound/audio_decoder_ffmpeg.h
67         stream_file_sound.cpp ../../include/nel/sound/stream_file_sound.h
68         stream_file_source.cpp ../../include/nel/sound/stream_file_source.h
71 FILE(GLOB USER_CLASSES
72         ../../include/nel/sound/u_audio_mixer.h
73         ../../include/nel/sound/u_group_controller.h
74         ../../include/nel/sound/u_listener.h
75         ../../include/nel/sound/u_source.h
76         ../../include/nel/sound/u_stream_source.h
79 SOURCE_GROUP("" FILES ${SRC} ${HEADERS})
80 SOURCE_GROUP("animation" FILES ${ANIMATION})
81 SOURCE_GROUP("background_sound" FILES ${BACKGROUND_SOUND})
82 SOURCE_GROUP("banks" FILES ${BANKS})
83 SOURCE_GROUP("mixer" FILES ${MIXER})
84 SOURCE_GROUP("music_deprecated" FILES ${MUSIC})
85 SOURCE_GROUP("sound" FILES ${SOUND})
86 SOURCE_GROUP("stream" FILES ${STREAM})
87 SOURCE_GROUP("stream_file" FILES ${STREAM_FILE})
88 SOURCE_GROUP("user_classes" FILES ${USER_CLASSES})
91 NL_TARGET_LIB(nelsound ${HEADERS} ${SRC})
93 IF(HUNTER_ENABLED)
94   HUNTER_ADD_PACKAGE(libogg)
95   FIND_PACKAGE(libogg CONFIG REQUIRED)
96   SET(OGG_LIBRARY libogg::ogg)
97   SET(OGG_LIBRARIES libogg::ogg)
99   HUNTER_ADD_PACKAGE(vorbis)
100   FIND_PACKAGE(vorbis CONFIG REQUIRED)
101   SET(VORBIS_LIBRARY vorbis::vorbis)
102   SET(VORBISFILE_LIBRARY vorbis::vorbisfile)
104   IF(WITH_FFMPEG)
105     HUNTER_ADD_PACKAGE(ffmpeg)
106     FIND_PACKAGE(ffmpeg CONFIG REQUIRED)
107     SET(FFMPEG_LIBRARIES ffmpeg::avcodec ffmpeg::avformat ffmpeg::avutil ffmpeg::swresample)
108   ENDIF()
109 ENDIF()
111 INCLUDE_DIRECTORIES(${VORBIS_INCLUDE_DIR})
112 INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR})
114 TARGET_LINK_LIBRARIES(nelsound ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY})
116 IF(WITH_STATIC)
117   # Add libogg dependency only if target is static because to libvorbisfile
118   TARGET_LINK_LIBRARIES(nelsound ${OGG_LIBRARY})
119 ENDIF()
121 IF(FFMPEG_FOUND)
122         ADD_DEFINITIONS(-DFFMPEG_ENABLED)
123         INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})
124         TARGET_LINK_LIBRARIES(nelsound ${FFMPEG_LIBRARIES})
125 ENDIF()
128 INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
130 TARGET_LINK_LIBRARIES(nelsound nelmisc nelligo nelgeorges nel3d nelsnd_lowlevel)
131 NL_DEFAULT_PROPS(nelsound "NeL, Library: NeL Sound")
132 NL_ADD_RUNTIME_FLAGS(nelsound)
134 NL_ADD_LIB_SUFFIX(nelsound)
136 ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
138 IF(WITH_PCH)
139   ADD_NATIVE_PRECOMPILED_HEADER(nelsound ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.cpp)
140 ENDIF()
142 NL_GEN_PC(nel-sound.pc)
144 IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
145   INSTALL(TARGETS nelsound LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
146 ENDIF()
148 ADD_SUBDIRECTORY(driver)