Windows compatibility for the portaudio package finder

This commit is contained in:
Bill Somerville 2021-04-14 21:59:00 +01:00
parent a44959962c
commit 5946eaf615
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
2 changed files with 7 additions and 8 deletions

View File

@ -90,15 +90,15 @@ libfind_process (Portaudio)
# fix up extra link libraries for macOS as target_link_libraries gets # fix up extra link libraries for macOS as target_link_libraries gets
# it wrong for frameworks # it wrong for frameworks
unset (_next_is_framework) unset (_next_is_framework)
unset (_portaudio_EXTRA_LIBS) unset (_Portaudio_EXTRA_LIBS)
foreach (_lib IN LISTS Portaudio_PKGCONF_LDFLAGS_OTHER) foreach (_lib IN LISTS Portaudio_PKGCONF_LDFLAGS)
if (_next_is_framework) if (_next_is_framework)
list (APPEND _portaudio_EXTRA_LIBS "-framework ${_lib}") list (APPEND _Portaudio_EXTRA_LIBS "-framework ${_lib}")
unset (_next_is_framework) unset (_next_is_framework)
elseif (${_lib} STREQUAL "-framework") elseif (${_lib} STREQUAL "-framework")
set (_next_is_framework TRUE) set (_next_is_framework TRUE)
else () else ()
list (APPEND _portaudio_EXTRA_LIBS ${_lib}) list (APPEND _Portaudio_EXTRA_LIBS ${_lib})
endif () endif ()
endforeach () endforeach ()
@ -109,7 +109,7 @@ if (Portaudio_FOUND AND NOT TARGET Portaudio::Portaudio)
IMPORTED_LOCATION "${Portaudio_LIBRARY}" IMPORTED_LOCATION "${Portaudio_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${Portaudio_PKGCONF_CFLAGS_OTHER}" INTERFACE_COMPILE_OPTIONS "${Portaudio_PKGCONF_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${Portaudio_INCLUDE_DIRS}" INTERFACE_INCLUDE_DIRECTORIES "${Portaudio_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${_portaudio_EXTRA_LIBS}" INTERFACE_LINK_LIBRARIES "${_Portaudio_EXTRA_LIBS}"
) )
endif () endif ()

View File

@ -1,4 +1,4 @@
find_package (portaudio REQUIRED) find_package (Portaudio REQUIRED)
find_package (libusb REQUIRED) find_package (libusb REQUIRED)
@ -57,8 +57,7 @@ add_subdirectory (libm65)
qt5_wrap_ui (map65_GENUISRCS ${map65_UISRCS}) qt5_wrap_ui (map65_GENUISRCS ${map65_UISRCS})
add_executable (map65 ${map65_CXXSRCS} ${map65_CSRCS} ${map65_GENUISRCS} map65.rc) add_executable (map65 ${map65_CXXSRCS} ${map65_CSRCS} ${map65_GENUISRCS} map65.rc)
target_include_directories (map65 PRIVATE ${PORTAUDIO_INCLUDE_DIRS}) target_link_libraries (map65 m65impl ${FFTW3_LIBRARIES} Qt5::Widgets Qt5::Network Portaudio::Portaudio libusb::libusb)
target_link_libraries (map65 m65impl ${FFTW3_LIBRARIES} Qt5::Widgets Qt5::Network portaudio::portaudio libusb::libusb)
install ( install (
TARGETS map65 TARGETS map65