diff options
Diffstat (limited to 'cmake/modules/FindSndio.cmake')
| -rw-r--r-- | cmake/modules/FindSndio.cmake | 34 |
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 | |||
| 11 | include(CheckIncludeFiles) | ||
| 12 | include(CheckIncludeFileCXX) | ||
| 13 | include(CheckLibraryExists) | ||
| 14 | |||
| 15 | # Already done by toplevel | ||
| 16 | find_library(SNDIO_LIBRARY sndio) | ||
| 17 | set(SNDIO_LIBRARY_DIR "") | ||
| 18 | if(SNDIO_LIBRARY) | ||
| 19 | get_filename_component(SNDIO_LIBRARY_DIR ${SNDIO_LIBRARY} PATH) | ||
| 20 | endif(SNDIO_LIBRARY) | ||
| 21 | |||
| 22 | check_library_exists(sndio sio_open "${SNDIO_LIBRARY_DIR}" HAVE_SNDIO) | ||
| 23 | if(HAVE_SNDIO) | ||
| 24 | message(STATUS "Found sndio: ${SNDIO_LIBRARY}") | ||
| 25 | set(SNDIO_DEFINITIONS -DHAVE_SNDIO=1) | ||
| 26 | set(SNDIO_LIBRARIES ${SNDIO_LIBRARY}) | ||
| 27 | else(HAVE_SNDIO) | ||
| 28 | message(STATUS "sndio not found") | ||
| 29 | endif(HAVE_SNDIO) | ||
| 30 | set(SNDIO_FOUND ${HAVE_SNDIO}) | ||
| 31 | |||
| 32 | find_path(SNDIO_INCLUDES sndio.h) | ||
| 33 | |||
| 34 | mark_as_advanced(SNDIO_INCLUDES SNDIO_LIBRARY) | ||
