diff options
author | Chris Robinson <[email protected]> | 2014-04-19 00:52:19 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-04-19 00:52:19 -0700 |
commit | 9b685bace50c25fd720799584e78a58d37a55eaa (patch) | |
tree | f5b904d5b091307e55dd62ef2796b0404103f4b1 | |
parent | 2eda15fc771223d391f6a411876e0f744ea1d21c (diff) |
Use FindALSA.cmake to look for ALSA
Also, only provide the ALSA_BACKEND_ALSA option if it's available
-rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 25c5cbdc..bf5c37d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,6 @@ IF(WIN32) OPTION(ALSOFT_NO_UID_DEFS "Do not define GUIDs, IIDs, CLSIDs, or PropertyKeys" OFF) ENDIF() -OPTION(ALSOFT_BACKEND_ALSA "Check for ALSA backend" ON) OPTION(ALSOFT_BACKEND_OSS "Check for OSS backend" ON) OPTION(ALSOFT_BACKEND_SOLARIS "Check for Solaris backend" ON) OPTION(ALSOFT_BACKEND_SNDIO "Check for SndIO backend" ON) @@ -50,7 +49,6 @@ OPTION(ALSOFT_BACKEND_WAVE "Enable Wave Writer backend" ON) OPTION(ALSOFT_REQUIRE_SSE "Require SSE/SSE2 support" OFF) OPTION(ALSOFT_REQUIRE_NEON "Require ARM Neon support" OFF) -OPTION(ALSOFT_REQUIRE_ALSA "Require ALSA backend" OFF) OPTION(ALSOFT_REQUIRE_OSS "Require OSS backend" OFF) OPTION(ALSOFT_REQUIRE_SOLARIS "Require Solaris backend" OFF) OPTION(ALSOFT_REQUIRE_SNDIO "Require SndIO backend" OFF) @@ -647,19 +645,20 @@ SET(HAVE_OPENSL 0) SET(HAVE_WAVE 0) # Check ALSA backend -IF(ALSOFT_BACKEND_ALSA) - CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H) - IF(HAVE_ALSA_ASOUNDLIB_H) - CHECK_SHARED_FUNCTION_EXISTS(snd_pcm_open "alsa/asoundlib.h" asound "" HAVE_LIBASOUND) - IF(HAVE_LIBASOUND OR HAVE_DLFCN_H OR WIN32) - SET(HAVE_ALSA 1) - 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 asound ${EXTRA_LIBS}) - ENDIF() +OPTION(ALSOFT_REQUIRE_ALSA "Require ALSA backend" OFF) +FIND_PACKAGE(ALSA) +IF(ALSA_FOUND) + OPTION(ALSOFT_BACKEND_ALSA "Enable ALSA backend" ON) + IF(ALSOFT_BACKEND_ALSA) + SET(HAVE_ALSA 1) + SET_SOURCE_FILES_PROPERTIES(Alc/backends/alsa.c PROPERTIES + INCLUDE_DIRECTORIES "${ALSA_INCLUDE_DIRS}") + 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() ENDIF() ENDIF() |