FindPortaudio.cmake 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # - Try to find Portaudio
  2. # Once done this will define
  3. #
  4. # PORTAUDIO_FOUND - system has Portaudio
  5. # PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
  6. # PORTAUDIO_LIBRARIES - Link these to use Portaudio
  7. # PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
  8. #
  9. # Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
  10. #
  11. # Redistribution and use is allowed according to the terms of the New BSD license.
  12. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  13. #
  14. if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
  15. # in cache already
  16. set(PORTAUDIO_FOUND TRUE)
  17. else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
  18. include(FindPkgConfig)
  19. pkg_check_modules(PORTAUDIO portaudio-2.0)
  20. if (PORTAUDIO_FOUND)
  21. if (NOT Portaudio_FIND_QUIETLY)
  22. message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
  23. endif (NOT Portaudio_FIND_QUIETLY)
  24. else (PORTAUDIO_FOUND)
  25. if (Portaudio_FIND_REQUIRED)
  26. message(FATAL_ERROR "Could not find Portaudio")
  27. endif (Portaudio_FIND_REQUIRED)
  28. endif (PORTAUDIO_FOUND)
  29. # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
  30. mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
  31. endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)