summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindSndio.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/FindSndio.cmake')
-rw-r--r--cmake/modules/FindSndio.cmake34
1 files changed, 34 insertions, 0 deletions
diff --git a/cmake/modules/FindSndio.cmake b/cmake/modules/FindSndio.cmake
new file mode 100644
index 0000000..4e66a4b
--- /dev/null
+++ b/cmake/modules/FindSndio.cmake
@@ -0,0 +1,34 @@
1# sndio check, based on FindAlsa.cmake
2#
3
4# Copyright (c) 2006, David Faure, <faure@kde.org>
5# Copyright (c) 2007, Matthias Kretz <kretz@kde.org>
6# Copyright (c) 2009, Jacob Meuser <jakemsr@sdf.lonestar.org>
7#
8# Redistribution and use is allowed according to the terms of the BSD license.
9# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
10
11include(CheckIncludeFiles)
12include(CheckIncludeFileCXX)
13include(CheckLibraryExists)
14
15# Already done by toplevel
16find_library(SNDIO_LIBRARY sndio)
17set(SNDIO_LIBRARY_DIR "")
18if(SNDIO_LIBRARY)
19 get_filename_component(SNDIO_LIBRARY_DIR ${SNDIO_LIBRARY} PATH)
20endif(SNDIO_LIBRARY)
21
22check_library_exists(sndio sio_open "${SNDIO_LIBRARY_DIR}" HAVE_SNDIO)
23if(HAVE_SNDIO)
24 message(STATUS "Found sndio: ${SNDIO_LIBRARY}")
25 set(SNDIO_DEFINITIONS -DHAVE_SNDIO=1)
26 set(SNDIO_LIBRARIES ${SNDIO_LIBRARY})
27else(HAVE_SNDIO)
28 message(STATUS "sndio not found")
29endif(HAVE_SNDIO)
30set(SNDIO_FOUND ${HAVE_SNDIO})
31
32find_path(SNDIO_INCLUDES sndio.h)
33
34mark_as_advanced(SNDIO_INCLUDES SNDIO_LIBRARY)