From 38528403c33c3c6aafe5ffa36a81901665a73a93 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Wed, 27 Nov 2019 01:21:01 +0300 Subject: [PATCH] Better libraries summary --- CMakeLists.txt | 52 +++++++++++++++++++++------------ src/codecs/music_timidity.cmake | 21 ++++++++----- 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9914cba2..4b639a89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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(" -- ") + endif() else() - message(" Vorbis found: ${Vorbis_FOUND}") + message(" ${_libName} is disabled") + message(" -- ") 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) diff --git a/src/codecs/music_timidity.cmake b/src/codecs/music_timidity.cmake index 948cc0fa..5f9e2933 100644 --- a/src/codecs/music_timidity.cmake +++ b/src/codecs/music_timidity.cmake @@ -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)