From 7a2a5c5c0ba9d04528d909f59c2ccfac35412e15 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 20:11:26 +0800 Subject: Obtain Vorbis & Ogg flags when using system libs On some platforms, pkg-config --libs vorbis might not necessarily imply -logg. vorbisenc & vorbisfile need their own checks anyway. --- indra/cmake/Audio.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra') diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 38547bb017..4c1a141dc5 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -4,6 +4,15 @@ include(Prebuilt) include_guard() add_library( ll::vorbis INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Vorbis REQUIRED ogg vorbis vorbisenc vorbisfile) + target_include_directories(ll::vorbis SYSTEM INTERFACE ${Vorbis_INCLUDE_DIRS}) + target_link_directories(ll::vorbis INTERFACE ${Vorbis_LIBRARY_DIRS}) + target_link_libraries(ll::vorbis INTERFACE ${Vorbis_LIBRARIES}) + return () +endif () + use_system_binary(vorbis) use_prebuilt_binary(ogg_vorbis) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) -- cgit v1.2.3