cmake: fix libavutil linking

In preparation for the upgrade to Qt 6.8, update CMakeLists.txt to ensure
that the client links against the same version of libavutil as the one
built by the daemon.

GitLab: #1944
Change-Id: I45bbf9f698a869b9028fc0489f2cd518a1f45781
This commit is contained in:
François-Simon Fauteux-Chapleau
2025-07-31 11:25:35 -04:00
parent 82eb5c59a6
commit 8c9f6a85a3

View File

@@ -580,19 +580,25 @@ elseif (NOT APPLE)
add_definitions(${LIBGDKPIXBUF_CFLAGS})
endif()
# Link against the version of libavutil built in the daemon's contribs to
# make sure we don't have ABI incompatibility issues.
set(ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE})
if (NOT ARCHITECTURE)
execute_process(COMMAND gcc -dumpmachine COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE)
endif()
list(PREPEND CMAKE_PREFIX_PATH
${LIBJAMI_CONTRIB_DIR}/native/ffmpeg/libavutil)
pkg_check_modules(LIBAVUTIL libavutil>=55.75.100)
${LIBJAMI_CONTRIB_DIR}/${ARCHITECTURE})
pkg_check_modules(avutil REQUIRED IMPORTED_TARGET libavutil=58.2.100)
list(REMOVE_ITEM CMAKE_PREFIX_PATH
${LIBJAMI_CONTRIB_DIR}/native/ffmpeg/libavutil)
${LIBJAMI_CONTRIB_DIR}/${ARCHITECTURE})
list(APPEND CLIENT_LIBS PkgConfig::avutil)
include_directories(
${LIBCLIENT_SRC_DIR}
${LIBNM_INCLUDE_DIRS}
${LIBNOTIFY_INCLUDE_DIRS}
${LIBGDKPIXBUF_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${LIBAVUTIL_INCLUDE_DIRS})
${GLIB_INCLUDE_DIRS})
set(JAMI_DATA_PREFIX "${CMAKE_INSTALL_PREFIX}/share")