Skip to content

Commit

Permalink
cmake: Depend entirely on pkg-config if found for VPL
Browse files Browse the repository at this point in the history
Released versions of VPL have a pkg-config that orders dependencies
before the main VPL library. This causes our library searching with
pkg-config hints to instead search for the first dependency of VPL.

Instead just import the pkg-config definition directly and use it. This
is a bit more correct as all the dependencies will be correctly linked.

Also install the library since the debian package doesnt seem to depend
on the library itself...

fixes obsproject#9573
  • Loading branch information
kkartaltepe authored and RytoEX committed Oct 9, 2023
1 parent 773e45b commit 9b98686
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/utils.zsh/setup_linux
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ sudo apt-get install -y --no-install-recommends \
libasound2-dev libfdk-aac-dev libfontconfig-dev libfreetype6-dev libjack-jackd2-dev \
libpulse-dev libsndio-dev libspeexdsp-dev libudev-dev libv4l-dev libva-dev libvlc-dev \
libpci-dev libdrm-dev \
nlohmann-json3-dev libwebsocketpp-dev libasio-dev libvpl-dev libqrcodegencpp-dev
nlohmann-json3-dev libwebsocketpp-dev libasio-dev libvpl-dev libvpl2 libqrcodegencpp-dev

if (( UBUNTU_2210_OR_LATER )) sudo apt-get install -y --no-install-recommends librist-dev libsrt-openssl-dev

Expand Down
6 changes: 5 additions & 1 deletion cmake/Modules/FindVPL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ The following cache variables may also be set:

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_search_module(_VPL QUIET vpl)
pkg_search_module(_VPL IMPORTED_TARGET QUIET vpl)
if(_VPL_FOUND)
add_library(VPL::VPL ALIAS PkgConfig::_VPL)
return()
endif()
endif()

find_path(
Expand Down

0 comments on commit 9b98686

Please sign in to comment.