FindSndio.cmake 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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_SIO_OPEN)
  19. find_path(SNDIO_INCLUDE_DIR sndio.h)
  20. include(FindPackageHandleStandardArgs)
  21. find_package_handle_standard_args(SNDIO DEFAULT_MSG SNDIO_LIBRARY SNDIO_INCLUDE_DIR HAVE_SIO_OPEN)
  22. if(SNDIO_FOUND)
  23. set(SNDIO_INCLUDE_DIRS "${SNDIO_INCLUDE_DIR}")
  24. set(SNDIO_LIBRARIES "${SNDIO_LIBRARY}")
  25. endif()
  26. mark_as_advanced(SNDIO_INCLUDE_DIR SNDIO_LIBRARY SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES)