Skip to content

Commit

Permalink
Better libraries summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Wohlstand committed Nov 26, 2019
1 parent 5771fc4 commit 3852840
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 27 deletions.
52 changes: 33 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,25 +391,39 @@ install(FILES
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2"
)

if(USE_SYSTEM_AUDIO_LIBRARIES)
message("==== SDL Mixer X system-wide libraries ====")
if(LIBOGG_NEEDED)
message(" OGG found: ${OGG_FOUND}")
endif()
if(USE_OGG_VORBIS_TREMOR)
message(" Tremor found: ${Tremor_FOUND}")
function(print_sumary _libName _isEnabled _wasFound _whatFound)
if(${_isEnabled})
if(${_wasFound})
message(" ${_libName} found:")
message(" -- ${${_whatFound}}")
else()
message(" ${_libName} is missing, will be disabled")
message(" -- <missing>")
endif()
else()
message(" Vorbis found: ${Vorbis_FOUND}")
message(" ${_libName} is disabled")
message(" -- <disabled>")
endif()
message(" OPUS found: ${Opus_FOUND}")
message(" FLAC found: ${FLAC_FOUND}")
message(" libMAD found: ${MAD_FOUND}")
message(" MPG123 found: ${MPG123_FOUND}")
message(" ModPlug found: ${ModPlug_FOUND}")
message(" MikMod found: ${MikMod_FOUND}")
message(" libXMP found: ${XMP_FOUND}")
message(" GME found: ${GME_FOUND}")
message(" libADLMIDI found: ${ADLMIDI_FOUND}")
message(" libOPNMIDI found: ${OPNMIDI_FOUND}")
message(" FluidSynth found: ${FluidSynth_FOUND}")
endfunction()

message("==== SDL Mixer X modules ====")
if(LIBOGG_NEEDED)
print_sumary("OGG" LIBOGG_NEEDED OGG_FOUND OGG_LIBRARIES)
endif()
if(USE_OGG_VORBIS_TREMOR)
print_sumary("Tremor" USE_OGG_VORBIS_TREMOR Tremor_FOUND Tremor_LIBRARIES)
else()
print_sumary("Vorbis" USE_OGG_VORBIS Vorbis_FOUND Vorbis_LIBRARIES)
endif()
print_sumary("OPUS" USE_OPUS Opus_FOUND Opus_LIBRARIES)
print_sumary("FLAC" USE_FLAC FLAC_FOUND FLAC_LIBRARIES)
print_sumary("libMAD" USE_MP3_MAD MAD_FOUND MAD_LIBRARIES)
print_sumary("MPG123" USE_MP3_MPG123 MPG123_FOUND MPG123_LIBRARIES)
print_sumary("ModPlug" USE_MODPLUG ModPlug_FOUND ModPlug_LIBRARIES)
print_sumary("MikMod" USE_MIKMOD MikMod_FOUND MikMod_LIBRARIES)
print_sumary("libXMP" USE_XMP XMP_FOUND XMP_LIBRARIES)
print_sumary("GME" USE_GME GME_FOUND GME_LIBRARIES)
print_sumary("libADLMIDI" USE_MIDI_ADLMIDI ADLMIDI_FOUND ADLMIDI_LIBRARIES)
print_sumary("libOPNMIDI" USE_MIDI_OPNMIDI OPNMIDI_FOUND OPNMIDI_LIBRARIES)
print_sumary("FluidSynth" USE_MIDI_FLUIDSYNTH FluidSynth_FOUND FluidSynth_LIBRARIES)
print_sumary("Timidity-SDL" USE_MIDI_TIMIDITY TIMIDITYSDL_FOUND TIMIDITYSDL_LIBRARIES)
21 changes: 13 additions & 8 deletions src/codecs/music_timidity.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
option(USE_MIDI_TIMIDITY "Build with Timidity wave table MIDI sequencer support" ON)
if(USE_MIDI_TIMIDITY AND NOT USE_SYSTEM_AUDIO_LIBRARIES)
message("== using Timidity-SDL ==")
list(APPEND SDL_MIXER_DEFINITIONS -DMUSIC_MID_TIMIDITY)

if(AUDIO_CODECS_REPO_PATH)
list(APPEND SDL_MIXER_INCLUDE_PATHS ${AUDIO_CODECS_PATH}/libtimidity/include)
endif()

if(DOWNLOAD_AUDIO_CODECS_DEPENDENCY)
set(LIBTIMIDITY_LIB timidity)
set(TIMIDITYSDL_LIBRARIES timidity)
set(TIMIDITYSDL_FOUND True)
else()
find_library(LIBTIMIDITY_LIB NAMES timidity
find_library(TIMIDITYSDL_LIBRARIES NAMES timidity
HINTS "${AUDIO_CODECS_INSTALL_PATH}/lib")
if(TIMIDITYSDL_LIBRARIES)
set(TIMIDITYSDL_FOUND True)
endif()
endif()

list(APPEND SDLMixerX_LINK_LIBS ${LIBTIMIDITY_LIB})
if(TIMIDITYSDL_FOUND)
list(APPEND SDL_MIXER_DEFINITIONS -DMUSIC_MID_TIMIDITY)
if(AUDIO_CODECS_REPO_PATH)
list(APPEND SDL_MIXER_INCLUDE_PATHS ${AUDIO_CODECS_PATH}/libtimidity/include)
endif()
list(APPEND SDLMixerX_LINK_LIBS ${TIMIDITYSDL_LIBRARIES})
endif()
endif()

list(APPEND SDLMixerX_SOURCES ${CMAKE_CURRENT_LIST_DIR}/music_timidity.c)

0 comments on commit 3852840

Please sign in to comment.