blob: 4f620fbac828608ff07ba78ee2d66cc114772e35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
commit 233f93b01ff05349793a8a2786750a2195f257ab
Author: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
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 <config.h>
+#ifdef HAVE_LIBASOUND2
#include <config-alsa.h>
+#endif
#include "mixer_backend.h"
#include "core/mixer.h"
|