FindSndio.cmake 957 B

123456789101112131415161718192021222324252627282930313233
  1. # sndio check, based on FindAlsa.cmake
  2. #
  3. # Copyright (c) 2006, David Faure, <faure@kde.org>
  4. # Copyright (c) 2007, Matthias Kretz <kretz@kde.org>
  5. # Copyright (c) 2009, Jacob Meuser <jakemsr@sdf.lonestar.org>
  6. #
  7. # Redistribution and use is allowed according to the terms of the BSD license.
  8. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  9. include(CheckIncludeFiles)
  10. include(CheckIncludeFileCXX)
  11. include(CheckLibraryExists)
  12. # Already done by toplevel
  13. find_library(SNDIO_LIBRARY sndio)
  14. set(SNDIO_LIBRARY_DIR "")
  15. if(SNDIO_LIBRARY)
  16. get_filename_component(SNDIO_LIBRARY_DIR ${SNDIO_LIBRARY} PATH)
  17. endif(SNDIO_LIBRARY)
  18. check_library_exists(sndio sio_open "${SNDIO_LIBRARY_DIR}" HAVE_SNDIO)
  19. if(HAVE_SNDIO)
  20. message(STATUS "Found sndio: ${SNDIO_LIBRARY}")
  21. else(HAVE_SNDIO)
  22. message(STATUS "sndio not found")
  23. endif(HAVE_SNDIO)
  24. set(SNDIO_FOUND ${HAVE_SNDIO})
  25. find_path(SNDIO_INCLUDES sndio.h)
  26. mark_as_advanced(SNDIO_INCLUDES SNDIO_LIBRARY)