File:  [HATARI the Atari ST Emulator] / hatari / cmake / FindPortAudio.cmake
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 9 08:58:48 2019 UTC (7 years, 1 month ago) by root
Branches: hatari, MAIN
CVS tags: hatari02210, hatari02200, HEAD
hatari 2.2.0

#
# Find the native PORTAUDIO (version 2) includes and library
#
#  PORTAUDIO_INCLUDE_DIR  - where to find portaudio.h, etc.
#  PORTAUDIO_LIBRARY      - List of libraries when using portaudio.
#  PORTAUDIO_FOUND        - True if portaudio found.

include(FindPackageHandleStandardArgs)
include(CheckSymbolExists)

if(PORTAUDIO_INCLUDE_DIR)
  # Already in cache, be silent
  set(PORTAUDIO_FIND_QUIETLY TRUE)
endif(PORTAUDIO_INCLUDE_DIR)

find_path(PORTAUDIO_INCLUDE_DIR portaudio.h)

find_library(PORTAUDIO_LIBRARY NAMES portaudio)

# handle the QUIETLY and REQUIRED arguments and set PORTAUDIO_FOUND to TRUE if 
# all listed variables are TRUE
find_package_handle_standard_args(PORTAUDIO DEFAULT_MSG
                                  PORTAUDIO_LIBRARY PORTAUDIO_INCLUDE_DIR)

# Check if it's really a portaudio2 installation...
if(PORTAUDIO_FOUND)
	set(CMAKE_REQUIRED_LIBRARIES ${PORTAUDIO_LIBRARY})
	set(CMAKE_REQUIRED_INCLUDES ${PORTAUDIO_INCLUDE_DIR})
	check_symbol_exists(Pa_GetDefaultInputDevice "portaudio.h" HAVE_PA_GETDEFAULTINPUTDEVICE)
	if (NOT HAVE_PA_GETDEFAULTINPUTDEVICE)
		unset (PORTAUDIO_FOUND)
	endif(NOT HAVE_PA_GETDEFAULTINPUTDEVICE)
	set(CMAKE_REQUIRED_INCLUDES "")
	set(CMAKE_REQUIRED_LIBRARIES "")
endif(PORTAUDIO_FOUND)

mark_as_advanced(PORTAUDIO_LIBRARY PORTAUDIO_INCLUDE_DIR)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.