| 1 |
#[[ |
| 2 |
A module to look for PortAudio |
| 3 |
]] |
| 4 |
|
| 5 |
if( NOT PortAudio_FOUND ) |
| 6 |
find_path( PortAudio_INCLUDE_DIR portaudio.h ) |
| 7 |
find_library( PortAudio_LIBRARIES NAMES portaudio ) |
| 8 |
|
| 9 |
if( PortAudio_INCLUDE_DIR AND PortAudio_LIBRARIES ) |
| 10 |
set( PortAudio_FOUND Yes ) |
| 11 |
endif() |
| 12 |
|
| 13 |
if( PortAudio_FOUND ) |
| 14 |
if( NOT PortAudio_FIND_QUIETLY ) |
| 15 |
message( STATUS "Found PortAudio: \n\tPortAudio_INCLUDE_DIR: ${PortAudio_INCLUDE_DIR}\n\tPortAudio_LIBRARIES: ${PortAudio_LIBRARIES}" ) |
| 16 |
endif() |
| 17 |
|
| 18 |
if( NOT TARGET portaudio::portaudio ) |
| 19 |
add_library( portaudio::portaudio INTERFACE IMPORTED GLOBAL) |
| 20 |
|
| 21 |
target_include_directories( portaudio::portaudio INTERFACE ${PortAudio_INCLUDE_DIR} ) |
| 22 |
target_link_libraries( portaudio::portaudio INTERFACE ${PortAudio_LIBRARIES} ) |
| 23 |
|
| 24 |
add_library(portaudio ALIAS portaudio::portaudio) |
| 25 |
endif() |
| 26 |
else() |
| 27 |
if( PortAudio_FIND_REQUIRED ) |
| 28 |
message( FATAL_ERROR "Could not find PortAudio") |
| 29 |
endif() |
| 30 |
endif() |
| 31 |
|
| 32 |
mark_as_advanced( |
| 33 |
PortAudio_FOUND |
| 34 |
PortAudio_INCLUDE_DIR |
| 35 |
PortAudio_LIBRARIES |
| 36 |
) |
| 37 |
endif() |