commit 233f93b01ff05349793a8a2786750a2195f257ab Author: Andreas Sturmlechner Date: Sat Jul 11 15:48:35 2015 +0200 Fix build w/ optional alsa, make HAVE_LIBASOUND2 work diff --git a/CMakeLists.txt b/CMakeLists.txt index c829005..17c106d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,6 @@ include(MacroLibrary) # Do not yet REQUIRE Phonon. Hint: As long as we do not find_package(), ${KDE4_PHONON_LIBS} will be empty below, but that should not hurt. #find_package(Phonon REQUIRED) -find_package(Alsa) - set(PA_VER "0.9.16") macro_optional_find_package(PulseAudio "${PA_VER}") macro_log_feature(PULSEAUDIO_FOUND "PulseAudio" "PulseAudio Audio Server" @@ -20,8 +18,11 @@ macro_optional_find_package(Canberra) macro_log_feature(CANBERRA_FOUND "libcanberra" "libcanberra audio library" "http://0pointer.de/lennart/projects/libcanberra/" FALSE "" "libcanberra is needed for kmix sound feedback") -alsa_configure_file(${CMAKE_BINARY_DIR}/config-alsa.h) - +find_package(Alsa) +if(ALSA_FOUND) + alsa_configure_file(${CMAKE_BINARY_DIR}/config-alsa.h) + add_definitions(-DHAVE_LIBASOUND2) +endif(ALSA_FOUND) add_definitions (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS} ) add_definitions(-DKDE_DEFAULT_DEBUG_AREA=67100) diff --git a/backends/kmix-backends.cpp b/backends/kmix-backends.cpp index 14ecfb3..1397099 100644 --- a/backends/kmix-backends.cpp +++ b/backends/kmix-backends.cpp @@ -23,7 +23,9 @@ /* This code is being #include'd from mixer.cpp */ #include +#ifdef HAVE_LIBASOUND2 #include +#endif #include "mixer_backend.h" #include "core/mixer.h"