| 1 |
# https://github.com/idiap/juicer/blob/master/cmake/FindRtAudio.cmake |
| 2 |
# |
| 3 |
# Copyright 2015 by Idiap Research Institute |
| 4 |
# |
| 5 |
# Licensed under 3-clause BSD. |
| 6 |
# |
| 7 |
# Author(s): |
| 8 |
# Phil Garner, November 2015 |
| 9 |
# |
| 10 |
# ...but basically copied from FindSndFile in libube, in turn from the examples |
| 11 |
# on the web. |
| 12 |
# |
| 13 |
|
| 14 |
# |
| 15 |
# Try to find RtAudio |
| 16 |
# Once done this will define |
| 17 |
# RTAUDIO_FOUND - System has RtAudio |
| 18 |
# RTAUDIO_INCLUDE_DIR - The RtAudio include directories |
| 19 |
# RTAUDIO_LIBRARIES - The libraries needed to use RtAudio |
| 20 |
# RTAUDIO_DEFINITIONS - Compiler switches required for using RtAudio |
| 21 |
# RTAUDIO_VERSION_STRING - the version of RtAudio found |
| 22 |
# |
| 23 |
|
| 24 |
find_package(PkgConfig) |
| 25 |
pkg_check_modules(PC_RTAUDIO rtaudio) |
| 26 |
|
| 27 |
set(RTAUDIO_DEFINITIONS ${PC_RTAUDIO_CFLAGS_OTHER}) |
| 28 |
set(RTAUDIO_VERSION_STRING ${PC_RTAUDIO_VERSION}) |
| 29 |
|
| 30 |
find_path( |
| 31 |
RTAUDIO_INCLUDE_DIR RtAudio.h |
| 32 |
HINTS ${PC_RTAUDIO_INCLUDEDIR} ${PC_RTAUDIO_INCLUDE_DIRS} |
| 33 |
) |
| 34 |
|
| 35 |
find_library( |
| 36 |
RTAUDIO_LIBRARIES NAMES rtaudio |
| 37 |
HINTS ${PC_RTAUDIO_LIBDIR} ${PC_RTAUDIO_LIBRARY_DIRS} |
| 38 |
) |
| 39 |
|
| 40 |
include(FindPackageHandleStandardArgs) |
| 41 |
find_package_handle_standard_args( |
| 42 |
RtAudio |
| 43 |
REQUIRED_VARS RTAUDIO_LIBRARIES RTAUDIO_INCLUDE_DIR |
| 44 |
VERSION_VAR RTAUDIO_VERSION_STRING |
| 45 |
) |
| 46 |
|
| 47 |
#mark_as_advanced(RTAUDIO_INCLUDE_DIR RTAUDIO_LIBRARIES) |
| 48 |
|