diff --git a/cmake/modules/FindPipeWire.cmake b/cmake/modules/FindPipeWire.cmake --- a/cmake/modules/FindPipeWire.cmake +++ b/cmake/modules/FindPipeWire.cmake @@ -32,7 +32,7 @@ #============================================================================= # Copyright 2014 Alex Merry # Copyright 2014 Martin Gräßlin -# Copyright 2018 Jan Grulich +# Copyright 2018-2020 Jan Grulich # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -61,23 +61,35 @@ # Use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls find_package(PkgConfig QUIET) -pkg_check_modules(PKG_PipeWire QUIET libpipewire-0.2 libpipewire-0.3) -set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS_OTHER}") +pkg_search_module(PKG_PipeWire QUIET libpipewire-0.3 libpipewire-0.2) +pkg_search_module(PKG_Spa QUIET libspa-0.2 libspa-0.1) + +set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS}" "${PKG_Spa_CFLAGS}") set(PipeWire_VERSION "${PKG_PipeWire_VERSION}") find_path(PipeWire_INCLUDE_DIRS NAMES pipewire/pipewire.h HINTS ${PKG_PipeWire_INCLUDE_DIRS} + ${PKG_PipeWire_INCLUDE_DIRS}/pipewire-0.3 +) + +find_path(Spa_INCLUDE_DIRS + NAMES + spa/param/props.h + HINTS + ${PKG_Spa_INCLUDE_DIRS} + ${PKG_Spa_INCLUDE_DIRS}/spa-0.2 ) find_library(PipeWire_LIBRARIES NAMES - pipewire-0.2 pipewire-0.3 + pipewire-0.3 + pipewire-0.2 HINTS - ${PKG_PipeWire_LIBRARIES_DIRS} + ${PKG_PipeWire_LIBRARY_DIRS} ) include(FindPackageHandleStandardArgs) @@ -87,6 +99,7 @@ REQUIRED_VARS PipeWire_LIBRARIES PipeWire_INCLUDE_DIRS + Spa_INCLUDE_DIRS VERSION_VAR PipeWire_VERSION ) @@ -96,7 +109,7 @@ set_target_properties(PipeWire::PipeWire PROPERTIES IMPORTED_LOCATION "${PipeWire_LIBRARIES}" INTERFACE_COMPILE_OPTIONS "${PipeWire_DEFINITIONS}" - INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS}" + INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS}" "${Spa_INCLUDE_DIRS}" ) endif()