diff options
Diffstat (limited to 'modules/FindAlsa.cmake')
-rw-r--r-- | modules/FindAlsa.cmake | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/modules/FindAlsa.cmake b/modules/FindAlsa.cmake index 5b8e43f8..23003b39 100644 --- a/modules/FindAlsa.cmake +++ b/modules/FindAlsa.cmake @@ -2,10 +2,10 @@ # Only the support for Alsa >= 0.9.x was included; 0.5.x was dropped (but feel free to re-add it if you need it) # It defines ... # It offers the following macros: -# ALSA_CONFIGURE_FILE(config_header) - generate a config.h, typical usage: -# ALSA_CONFIGURE_FILE(${CMAKE_BINARY_DIR}/config-alsa.h) -# ALSA_VERSION_STRING(version_string) looks for alsa/version.h and reads the version string into -# the first argument passed to the macro +# ALSA_CONFIGURE_FILE(config_header) - generate a config.h, typical usage: +# ALSA_CONFIGURE_FILE(${CMAKE_BINARY_DIR}/config-alsa.h) +# ALSA_VERSION_STRING(version_string) looks for alsa/version.h and reads the version string into +# the first argument passed to the macro # Copyright (c) 2006, David Faure, <faure@kde.org> # Copyright (c) 2007, Matthias Kretz <kretz@kde.org> @@ -19,7 +19,12 @@ include(CheckLibraryExists) # Already done by toplevel find_library(ASOUND_LIBRARY asound) -check_library_exists(asound snd_seq_create_simple_port ${ASOUND_LIBRARY} HAVE_LIBASOUND2) +set(ASOUND_LIBRARY_DIR "") +if(ASOUND_LIBRARY) + get_filename_component(ASOUND_LIBRARY_DIR ${ASOUND_LIBRARY} PATH) +endif(ASOUND_LIBRARY) + +check_library_exists(asound snd_seq_create_simple_port "${ASOUND_LIBRARY_DIR}" HAVE_LIBASOUND2) if(HAVE_LIBASOUND2) message(STATUS "Found ALSA: ${ASOUND_LIBRARY}") else(HAVE_LIBASOUND2) @@ -53,7 +58,7 @@ macro(ALSA_CONFIGURE_FILE _destFile) check_include_file_cxx(sys/asoundlib.h HAVE_SYS_ASOUNDLIB_H) check_include_file_cxx(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H) - check_library_exists(asound snd_pcm_resume ${ASOUND_LIBRARY} ASOUND_HAS_SND_PCM_RESUME) + check_library_exists(asound snd_pcm_resume "${ASOUND_LIBRARY_DIR}" ASOUND_HAS_SND_PCM_RESUME) if(ASOUND_HAS_SND_PCM_RESUME) set(HAVE_SND_PCM_RESUME 1) endif(ASOUND_HAS_SND_PCM_RESUME) |