2021-04-10 07:25:28 -04:00
|
|
|
# - Try to find portaudio
|
|
|
|
#
|
|
|
|
# Once done, this will define:
|
|
|
|
#
|
|
|
|
# portaudio_FOUND - system has portaudio
|
2021-04-11 10:29:15 -04:00
|
|
|
# portaudio_VERSION - The version of the portaudio library which was found
|
|
|
|
#
|
|
|
|
# and the following imported targets::
|
|
|
|
#
|
|
|
|
# portaudio::portaudio - The portaudio library
|
2021-04-10 07:25:28 -04:00
|
|
|
#
|
|
|
|
# If portaudio_STATIC is TRUE then static linking will be assumed
|
|
|
|
#
|
|
|
|
|
2021-04-11 17:03:56 -04:00
|
|
|
# function(dump_cmake_variables)
|
|
|
|
# get_cmake_property(_variableNames VARIABLES)
|
|
|
|
# list (SORT _variableNames)
|
|
|
|
# foreach (_variableName ${_variableNames})
|
|
|
|
# if (ARGV0)
|
|
|
|
# unset(MATCHED)
|
|
|
|
# string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
|
|
|
|
# if (NOT MATCHED)
|
|
|
|
# continue()
|
|
|
|
# endif()
|
|
|
|
# endif()
|
|
|
|
# message(STATUS "${_variableName}=${${_variableName}}")
|
|
|
|
# endforeach()
|
|
|
|
# endfunction()
|
2021-04-11 10:29:15 -04:00
|
|
|
|
2021-04-10 07:25:28 -04:00
|
|
|
include (LibFindMacros)
|
|
|
|
|
2021-04-11 17:03:56 -04:00
|
|
|
libfind_pkg_detect (portaudio portaudio-2.0 FIND_PATH portaudio.h FIND_LIBRARY portaudio)
|
|
|
|
set (portaudio_PROCESS_LIBS portaudio_PKGCONF_LDFLAGS)
|
2021-04-10 07:25:28 -04:00
|
|
|
libfind_process (portaudio)
|
|
|
|
|
2021-04-11 17:03:56 -04:00
|
|
|
#dump_cmake_variables ("^portaudio_")
|
2021-04-11 10:29:15 -04:00
|
|
|
|
|
|
|
if (portaudio_FOUND AND NOT TARGET portaudio::portaudio)
|
|
|
|
add_library (portaudio::portaudio UNKNOWN IMPORTED)
|
|
|
|
set_target_properties (portaudio::portaudio PROPERTIES
|
|
|
|
IMPORTED_LOCATION "${portaudio_LIBRARY}"
|
2021-04-11 17:03:56 -04:00
|
|
|
INTERFACE_COMPILE_OPTIONS "${portaudio_CFLAGS_OTHERS}"
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${portaudio_INCLUDE_DIRS}"
|
|
|
|
INTERFACE_LINK_LIBRARIES "${portaudio_LIBRARIES}"
|
2021-04-11 10:29:15 -04:00
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
mark_as_advanced (
|
|
|
|
portaudio_INCLUDE_DIR
|
|
|
|
portaudio_LIBRARY
|
|
|
|
)
|