aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-19 06:35:14 -0700
committerChris Robinson <[email protected]>2014-04-19 06:35:14 -0700
commit887763e41c953b91105bba119da7a7265815f5e0 (patch)
tree8443332ee06bf28e78fe5e34baf66e55b18b42a5 /cmake
parent1d266aa8347fadfb0db34ae27df7b728c0ab2171 (diff)
Use find cmake modules for more backends
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindAudioIO.cmake21
-rw-r--r--cmake/FindOSS.cmake21
-rw-r--r--cmake/FindPortAudio.cmake32
-rw-r--r--cmake/FindPulseAudio.cmake43
-rw-r--r--cmake/FindQSA.cmake34
-rw-r--r--cmake/FindSoundIO.cmake32
6 files changed, 183 insertions, 0 deletions
diff --git a/cmake/FindAudioIO.cmake b/cmake/FindAudioIO.cmake
new file mode 100644
index 00000000..f0f8b2a5
--- /dev/null
+++ b/cmake/FindAudioIO.cmake
@@ -0,0 +1,21 @@
+# - Find AudioIO includes and libraries
+#
+# AUDIOIO_FOUND - True if AUDIOIO_INCLUDE_DIR is found
+# AUDIOIO_INCLUDE_DIRS - Set when AUDIOIO_INCLUDE_DIR is found
+#
+# AUDIOIO_INCLUDE_DIR - where to find sys/audioio.h, etc.
+#
+
+find_path(AUDIOIO_INCLUDE_DIR
+ NAMES sys/audioio.h
+ DOC "The AudioIO include directory"
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(AudioIO REQUIRED_VARS AUDIOIO_INCLUDE_DIR)
+
+if(AUDIOIO_FOUND)
+ set(AUDIOIO_INCLUDE_DIRS ${AUDIOIO_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(AUDIOIO_INCLUDE_DIR)
diff --git a/cmake/FindOSS.cmake b/cmake/FindOSS.cmake
new file mode 100644
index 00000000..88ee66ad
--- /dev/null
+++ b/cmake/FindOSS.cmake
@@ -0,0 +1,21 @@
+# - Find OSS includes
+#
+# OSS_FOUND - True if OSS_INCLUDE_DIR is found
+# OSS_INCLUDE_DIRS - Set when OSS_INCLUDE_DIR is found
+#
+# OSS_INCLUDE_DIR - where to find sys/soundcard.h, etc.
+#
+
+find_path(OSS_INCLUDE_DIR
+ NAMES sys/soundcard.h
+ DOC "The OSS include directory"
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(OSS REQUIRED_VARS OSS_INCLUDE_DIR)
+
+if(OSS_FOUND)
+ set(OSS_INCLUDE_DIRS ${OSS_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(OSS_INCLUDE_DIR)
diff --git a/cmake/FindPortAudio.cmake b/cmake/FindPortAudio.cmake
new file mode 100644
index 00000000..fad2313d
--- /dev/null
+++ b/cmake/FindPortAudio.cmake
@@ -0,0 +1,32 @@
+# - Find PortAudio includes and libraries
+#
+# PORTAUDIO_FOUND - True if PORTAUDIO_INCLUDE_DIR & PORTAUDIO_LIBRARY
+# are found
+# PORTAUDIO_LIBRARIES - Set when PORTAUDIO_LIBRARY is found
+# PORTAUDIO_INCLUDE_DIRS - Set when PORTAUDIO_INCLUDE_DIR is found
+#
+# PORTAUDIO_INCLUDE_DIR - where to find portaudio.h, etc.
+# PORTAUDIO_LIBRARY - the portaudio library
+#
+
+find_path(PORTAUDIO_INCLUDE_DIR
+ NAMES portaudio.h
+ DOC "The PortAudio include directory"
+)
+
+find_library(PORTAUDIO_LIBRARY
+ NAMES portaudio
+ DOC "The PortAudio library"
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PortAudio
+ REQUIRED_VARS PORTAUDIO_LIBRARY PORTAUDIO_INCLUDE_DIR
+)
+
+if(PORTAUDIO_FOUND)
+ set(PORTAUDIO_LIBRARIES ${PORTAUDIO_LIBRARY})
+ set(PORTAUDIO_INCLUDE_DIRS ${PORTAUDIO_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(PORTAUDIO_INCLUDE_DIR PORTAUDIO_LIBRARY)
diff --git a/cmake/FindPulseAudio.cmake b/cmake/FindPulseAudio.cmake
new file mode 100644
index 00000000..1f6f843a
--- /dev/null
+++ b/cmake/FindPulseAudio.cmake
@@ -0,0 +1,43 @@
+# - Find PulseAudio includes and libraries
+#
+# PULSEAUDIO_FOUND - True if PULSEAUDIO_INCLUDE_DIR &
+# PULSEAUDIO_LIBRARY are found
+# PULSEAUDIO_LIBRARIES - Set when PULSEAUDIO_LIBRARY is found
+# PULSEAUDIO_INCLUDE_DIRS - Set when PULSEAUDIO_INCLUDE_DIR is found
+#
+# PULSEAUDIO_INCLUDE_DIR - where to find pulse/pulseaudio.h, etc.
+# PULSEAUDIO_LIBRARY - the pulse library
+# PULSEAUDIO_VERSION_STRING - the version of PulseAudio found
+#
+
+find_path(PULSEAUDIO_INCLUDE_DIR
+ NAMES pulse/pulseaudio.h
+ DOC "The PulseAudio include directory"
+)
+
+find_library(PULSEAUDIO_LIBRARY
+ NAMES pulse
+ DOC "The PulseAudio library"
+)
+
+if(PULSEAUDIO_INCLUDE_DIR AND EXISTS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h")
+ file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulse_version_str
+ REGEX "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\".*\"\\)")
+
+ string(REGEX REPLACE "^.*pa_get_headers_version\\(\\)[\t ]+\\(\"([^\"]*)\"\\).*$" "\\1"
+ PULSEAUDIO_VERSION_STRING "${pulse_version_str}")
+ unset(pulse_version_str)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PulseAudio
+ REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR
+ VERSION_VAR PULSEAUDIO_VERSION_STRING
+)
+
+if(PULSEAUDIO_FOUND)
+ set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY})
+ set(PULSEAUDIO_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY)
diff --git a/cmake/FindQSA.cmake b/cmake/FindQSA.cmake
new file mode 100644
index 00000000..0ad1fd43
--- /dev/null
+++ b/cmake/FindQSA.cmake
@@ -0,0 +1,34 @@
+# - Find QSA includes and libraries
+#
+# QSA_FOUND - True if QSA_INCLUDE_DIR & QSA_LIBRARY are found
+# QSA_LIBRARIES - Set when QSA_LIBRARY is found
+# QSA_INCLUDE_DIRS - Set when QSA_INCLUDE_DIR is found
+#
+# QSA_INCLUDE_DIR - where to find sys/asoundlib.h, etc.
+# QSA_LIBRARY - the asound library
+#
+
+# Only check for QSA on QNX, because it conflicts with ALSA.
+if("${CMAKE_C_PLATFORM_ID}" STREQUAL "QNX")
+ find_path(QSA_INCLUDE_DIR
+ NAMES sys/asoundlib.h
+ DOC "The QSA include directory"
+ )
+
+ find_library(QSA_LIBRARY
+ NAMES asound
+ DOC "The QSA library"
+ )
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(QSA
+ REQUIRED_VARS QSA_LIBRARY QSA_INCLUDE_DIR
+)
+
+if(QSA_FOUND)
+ set(QSA_LIBRARIES ${QSA_LIBRARY})
+ set(QSA_INCLUDE_DIRS ${QSA_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(QSA_INCLUDE_DIR QSA_LIBRARY)
diff --git a/cmake/FindSoundIO.cmake b/cmake/FindSoundIO.cmake
new file mode 100644
index 00000000..10450254
--- /dev/null
+++ b/cmake/FindSoundIO.cmake
@@ -0,0 +1,32 @@
+# - Find SoundIO (sndio) includes and libraries
+#
+# SOUNDIO_FOUND - True if SOUNDIO_INCLUDE_DIR & SOUNDIO_LIBRARY are
+# found
+# SOUNDIO_LIBRARIES - Set when SOUNDIO_LIBRARY is found
+# SOUNDIO_INCLUDE_DIRS - Set when SOUNDIO_INCLUDE_DIR is found
+#
+# SOUNDIO_INCLUDE_DIR - where to find sndio.h, etc.
+# SOUNDIO_LIBRARY - the sndio library
+#
+
+find_path(SOUNDIO_INCLUDE_DIR
+ NAMES sndio.h
+ DOC "The SoundIO include directory"
+)
+
+find_library(SOUNDIO_LIBRARY
+ NAMES sndio
+ DOC "The SoundIO library"
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SoundIO
+ REQUIRED_VARS SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR
+)
+
+if(SOUNDIO_FOUND)
+ set(SOUNDIO_LIBRARIES ${SOUNDIO_LIBRARY})
+ set(SOUNDIO_INCLUDE_DIRS ${SOUNDIO_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(SOUNDIO_INCLUDE_DIR SOUNDIO_LIBRARY)