diff options
author | Matthias Kretz <kretz@kde.org> | 2006-12-27 22:24:07 +0000 |
---|---|---|
committer | Matthias Kretz <kretz@kde.org> | 2006-12-27 22:24:07 +0000 |
commit | 9f75f3eadabbdf3a036decbfd63391ef02ba4cc1 (patch) | |
tree | 9ecf7de5b61c0733e833a0d3a1bf887ab68de370 | |
parent | 7a98e063a9c380e64e02b03246c7fe0257db3e9d (diff) | |
download | extra-cmake-modules-9f75f3eadabbdf3a036decbfd63391ef02ba4cc1.tar.gz extra-cmake-modules-9f75f3eadabbdf3a036decbfd63391ef02ba4cc1.tar.bz2 |
add small lib that lists ALSA devices to be used in Phonon backends
now that I need FindAlsa in kdelibs should it be removed from kdemultimedia
next monday?
svn path=/trunk/KDE/kdelibs/; revision=617068
-rw-r--r-- | modules/FindAlsa.cmake | 38 | ||||
-rw-r--r-- | modules/config-alsa.h.cmake | 34 |
2 files changed, 72 insertions, 0 deletions
diff --git a/modules/FindAlsa.cmake b/modules/FindAlsa.cmake new file mode 100644 index 00000000..c40b95ef --- /dev/null +++ b/modules/FindAlsa.cmake @@ -0,0 +1,38 @@ +# Alsa check, based on libkmid/configure.in.in. +# 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) + +# Copyright (c) 2006, David Faure, <faure@kde.org> +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(CheckIncludeFiles) +include(CheckIncludeFileCXX) +include(CheckLibraryExists) + +# Already done by toplevel +#check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H) +#check_include_files(machine/soundcard.h HAVE_MACHINE_SOUNDCARD_H) + +check_include_files(linux/awe_voice.h HAVE_LINUX_AWE_VOICE_H) +check_include_files(awe_voice.h HAVE_AWE_VOICE_H) +check_include_files(/usr/src/sys/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_I386_ISA_SOUND_AWE_VOICE_H) +check_include_files(/usr/src/sys/gnu/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_GNU_I386_ISA_SOUND_AWE_VOICE_H) + +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_seq_create_simple_port "" HAVE_LIBASOUND2) +if(HAVE_LIBASOUND2) + set(ASOUND_LIBRARY "asound") + check_library_exists(asound snd_pcm_resume ${ASOUND_LIBRARY} ASOUND_HAS_SND_PCM_RESUME) + message(STATUS "Found ALSA: ${ASOUND_LIBRARY}") + if(ASOUND_HAS_SND_PCM_RESUME) + set(HAVE_SND_PCM_RESUME 1) + endif(ASOUND_HAS_SND_PCM_RESUME) + SET (LIBASOUND2_FOUND TRUE) +else(HAVE_LIBASOUND2) + message(STATUS "ALSA not found") +endif(HAVE_LIBASOUND2) + +configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/config-alsa.h.cmake ${CMAKE_BINARY_DIR}/config-alsa.h ) diff --git a/modules/config-alsa.h.cmake b/modules/config-alsa.h.cmake new file mode 100644 index 00000000..9c9e1683 --- /dev/null +++ b/modules/config-alsa.h.cmake @@ -0,0 +1,34 @@ +/* Define to 1 if you have the <linux/awe_voice.h> header file. */ +#cmakedefine HAVE_LINUX_AWE_VOICE_H 1 + +/* Define to 1 if you have the <sys/awe_voice.h> header file. */ +#cmakedefine HAVE_SYS_AWE_VOICE_H 1 + +/* Define to 1 if you have the </usr/src/sys/gnu/i386/isa/sound/awe_voice.h> + header file. */ +#cmakedefine HAVE__USR_SRC_SYS_GNU_I386_ISA_SOUND_AWE_VOICE_H + +/* Define to 1 if you have the </usr/src/sys/i386/isa/sound/awe_voice.h> + header file. */ +#cmakedefine HAVE__USR_SRC_SYS_I386_ISA_SOUND_AWE_VOICE_H + +/* Define to 1 if you have the <awe_voice.h> header file. */ +#cmakedefine HAVE_AWE_VOICE_H 1 + + + +/* Define if you have libasound.so.1 (for ALSA 0.5.x support - disabled now) */ +/* #undef HAVE_LIBASOUND */ + +/* Define if you have libasound.so.2 (required for ALSA 0.9.x support) */ +#cmakedefine HAVE_LIBASOUND2 1 + +/* Define if libasound has snd_pcm_resume() */ +#cmakedefine HAVE_SND_PCM_RESUME 1 + +/* Define to 1 if you have the <alsa/asoundlib.h> header file. */ +#cmakedefine HAVE_ALSA_ASOUNDLIB_H 1 + +/* Define to 1 if you have the <sys/asoundlib.h> header file. */ +#cmakedefine HAVE_SYS_ASOUNDLIB_H 1 + |