diff --git a/cmake/modules/FindPortAudio.cmake b/cmake/modules/FindPortAudio.cmake index 3c0a8b5c8f4..aa01d4224d9 100644 --- a/cmake/modules/FindPortAudio.cmake +++ b/cmake/modules/FindPortAudio.cmake @@ -43,6 +43,8 @@ The following cache variables may also be set: #]=======================================================================] +include(IsStaticLibrary) + find_package(PkgConfig QUIET) if(PkgConfig_FOUND) pkg_check_modules(PC_PortAudio QUIET portaudio-2.0) @@ -89,6 +91,14 @@ if(PortAudio_FOUND) ) is_static_library(PortAudio_IS_STATIC PortAudio::PortAudio) if(PortAudio_IS_STATIC) + if(PortAudio_ALSA_H) + find_package(ALSA) + if(ALSA_FOUND) + set_property(TARGET PortAudio::PortAudio APPEND PROPERTY INTERFACE_LINK_LIBRARIES + ALSA::ALSA + ) + endif() + endif() find_package(JACK) if(JACK_FOUND) set_property(TARGET PortAudio::PortAudio APPEND PROPERTY INTERFACE_LINK_LIBRARIES