summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-22 07:58:25 -0700
committerChris Robinson <[email protected]>2014-04-22 07:58:25 -0700
commit84afe4fb4063cb93a774af946b5eb1e05ba777f0 (patch)
treee898405939beda85a576131c951328d8faeee83c /CMakeLists.txt
parentd5ac11c87f9b158d2c9a980a2ad38e7165de3d64 (diff)
Simplify the cmake backend handling a bit
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt55
1 files changed, 24 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 861d57b4..e42288ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -614,6 +614,16 @@ SET(HAVE_PULSEAUDIO 0)
SET(HAVE_COREAUDIO 0)
SET(HAVE_OPENSL 0)
SET(HAVE_WAVE 0)
+IF(WIN32 OR HAVE_DLFCN_H)
+ SET(IS_LINKED "")
+ MACRO(ADD_BACKEND_LIBS _LIBS)
+ ENDMACRO()
+ELSE()
+ SET(IS_LINKED " (linked)")
+ MACRO(ADD_BACKEND_LIBS _LIBS)
+ SET(EXTRA_LIBS ${_LIBS} ${EXTRA_LIBS})
+ ENDMACRO()
+ENDIF()
# Check ALSA backend
OPTION(ALSOFT_REQUIRE_ALSA "Require ALSA backend" OFF)
@@ -622,13 +632,9 @@ IF(ALSA_FOUND)
OPTION(ALSOFT_BACKEND_ALSA "Enable ALSA backend" ON)
IF(ALSOFT_BACKEND_ALSA)
SET(HAVE_ALSA 1)
+ SET(BACKENDS "${BACKENDS} ALSA${IS_LINKED},")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/alsa.c)
- IF(HAVE_DLFCN_H OR WIN32)
- SET(BACKENDS "${BACKENDS} ALSA,")
- ELSE()
- SET(BACKENDS "${BACKENDS} ALSA \(linked\),")
- SET(EXTRA_LIBS ${ALSA_LIBRARIES} ${EXTRA_LIBS})
- ENDIF()
+ ADD_BACKEND_LIBS(${ALSA_LIBRARIES})
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${ALSA_INCLUDE_DIRS})
ENDIF()
@@ -645,8 +651,8 @@ IF(OSS_FOUND)
OPTION(ALSOFT_BACKEND_OSS "Enable OSS backend" ON)
IF(ALSOFT_BACKEND_OSS)
SET(HAVE_OSS 1)
- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/oss.c)
SET(BACKENDS "${BACKENDS} OSS,")
+ SET(ALC_OBJS ${ALC_OBJS} Alc/backends/oss.c)
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${OSS_INCLUDE_DIRS})
ENDIF()
@@ -663,8 +669,8 @@ IF(AUDIOIO_FOUND)
OPTION(ALSOFT_BACKEND_SOLARIS "Enable Solaris backend" ON)
IF(ALSOFT_BACKEND_SOLARIS)
SET(HAVE_SOLARIS 1)
- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/solaris.c)
SET(BACKENDS "${BACKENDS} Solaris,")
+ SET(ALC_OBJS ${ALC_OBJS} Alc/backends/solaris.c)
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${AUDIOIO_INCLUDE_DIRS})
ENDIF()
@@ -681,8 +687,8 @@ IF(SOUNDIO_FOUND)
OPTION(ALSOFT_BACKEND_SNDIO "Enable SndIO backend" ON)
IF(ALSOFT_BACKEND_SNDIO)
SET(HAVE_SNDIO 1)
+ SET(BACKENDS "${BACKENDS} SndIO (linked),")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/sndio.c)
- SET(BACKENDS "${BACKENDS} SndIO \(linked\),")
SET(EXTRA_LIBS ${SOUNDIO_LIBRARIES} ${EXTRA_LIBS})
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${SOUNDIO_INCLUDE_DIRS})
@@ -700,9 +706,9 @@ IF(QSA_FOUND)
OPTION(ALSOFT_BACKEND_QSA "Enable QSA backend" ON)
IF(ALSOFT_BACKEND_QSA)
SET(HAVE_QSA 1)
+ SET(BACKENDS "${BACKENDS} QSA (linked),")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/qsa.c)
SET(EXTRA_LIBS ${QSA_LIBRARIES} ${EXTRA_LIBS})
- SET(BACKENDS "${BACKENDS} QSA \(linked\),")
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${QSA_INCLUDE_DIRS})
ENDIF()
@@ -719,13 +725,9 @@ IF(DSOUND_FOUND)
OPTION(ALSOFT_BACKEND_DSOUND "Enable DirectSound backend" ON)
IF(ALSOFT_BACKEND_DSOUND)
SET(HAVE_DSOUND 1)
+ SET(BACKENDS "${BACKENDS} DirectSound${IS_LINKED},")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c)
- IF(HAVE_DLFCN_H OR WIN32)
- SET(BACKENDS "${BACKENDS} DirectSound,")
- ELSE()
- SET(BACKENDS "${BACKENDS} DirectSound \(linked\),")
- SET(EXTRA_LIBS ${DSOUND_LIBRARIES} ${EXTRA_LIBS})
- ENDIF()
+ ADD_BACKEND_LIBS(${DSOUND_LIBRARIES})
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${DSOUND_INCLUDE_DIRS})
ENDIF()
@@ -743,9 +745,8 @@ IF(HAVE_WINDOWS_H)
OPTION(ALSOFT_BACKEND_MMDEVAPI "Enable MMDevApi backend" ON)
IF(ALSOFT_BACKEND_MMDEVAPI)
SET(HAVE_MMDEVAPI 1)
- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/mmdevapi.c)
-
SET(BACKENDS "${BACKENDS} MMDevApi,")
+ SET(ALC_OBJS ${ALC_OBJS} Alc/backends/mmdevapi.c)
ENDIF()
ENDIF()
ENDIF()
@@ -763,8 +764,8 @@ IF(HAVE_WINDOWS_H)
OPTION(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON)
IF(ALSOFT_BACKEND_WINMM)
SET(HAVE_WINMM 1)
- SET(ALC_OBJS ${ALC_OBJS} Alc/backends/winmm.c)
SET(BACKENDS "${BACKENDS} WinMM,")
+ SET(ALC_OBJS ${ALC_OBJS} Alc/backends/winmm.c)
SET(EXTRA_LIBS winmm ${EXTRA_LIBS})
ENDIF()
ENDIF()
@@ -781,13 +782,9 @@ IF(PORTAUDIO_FOUND)
OPTION(ALSOFT_BACKEND_PORTAUDIO "Enable PortAudio backend" ON)
IF(ALSOFT_BACKEND_PORTAUDIO)
SET(HAVE_PORTAUDIO 1)
+ SET(BACKENDS "${BACKENDS} PortAudio${IS_LINKED},")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/portaudio.c)
- IF(HAVE_DLFCN_H OR WIN32)
- SET(BACKENDS "${BACKENDS} PortAudio,")
- ELSE()
- SET(BACKENDS "${BACKENDS} PortAudio \(linked\),")
- SET(EXTRA_LIBS ${PORTAUDIO_LIBRARIES} ${EXTRA_LIBS})
- ENDIF()
+ ADD_BACKEND_LIBS(${PORTAUDIO_LIBRARIES})
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${PORTAUDIO_INCLUDE_DIRS})
ENDIF()
@@ -804,13 +801,9 @@ IF(PULSEAUDIO_FOUND)
OPTION(ALSOFT_BACKEND_PULSEAUDIO "Enable PulseAudio backend" ON)
IF(ALSOFT_BACKEND_PULSEAUDIO)
SET(HAVE_PULSEAUDIO 1)
+ SET(BACKENDS "${BACKENDS} PulseAudio${IS_LINKED},")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/pulseaudio.c)
- IF(HAVE_DLFCN_H OR WIN32)
- SET(BACKENDS "${BACKENDS} PulseAudio,")
- ELSE()
- SET(BACKENDS "${BACKENDS} PulseAudio \(linked\),")
- SET(EXTRA_LIBS ${PULSEAUDIO_LIBRARIES} ${EXTRA_LIBS})
- ENDIF()
+ ADD_BACKEND_LIBS(${PULSEAUDIO_LIBRARIES})
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${PULSEAUDIO_INCLUDE_DIRS})
ENDIF()