Temporary diagnstics

This commit is contained in:
Bill Somerville 2021-04-13 14:18:26 +01:00
parent 19875e2b03
commit 6dac83abe2
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F

View File

@ -10,6 +10,21 @@
# portaudio::portaudio - The portaudio library # portaudio::portaudio - The portaudio library
# #
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()
include (LibFindMacros) include (LibFindMacros)
libfind_pkg_detect (portaudio portaudio-2.0 libfind_pkg_detect (portaudio portaudio-2.0
@ -18,15 +33,15 @@ libfind_pkg_detect (portaudio portaudio-2.0
) )
libfind_process (portaudio) libfind_process (portaudio)
dump_cmake_variables ("portaudio")
if (portaudio_FOUND AND NOT TARGET portaudio::portaudio) if (portaudio_FOUND AND NOT TARGET portaudio::portaudio)
add_library (portaudio::portaudio UNKNOWN IMPORTED) add_library (portaudio::portaudio UNKNOWN IMPORTED)
set_target_properties (portaudio::portaudio PROPERTIES set_target_properties (portaudio::portaudio PROPERTIES
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_PKGCONF_LDFLAGS}"
) )
target_link_libraries (portaudio::portaudio INTERFACE ${portaudio_PKGCONF_LDFLAGS})
endif () endif ()
mark_as_advanced ( mark_as_advanced (