in your example avfilter
gets expanded to a full path to static lib.
Is avfilter
a target part of your build or is it an IMPORTED TARGET
of some sort?
as noted by @McMartin your statement:
target_link_libraries(utils_video_encode_decode_ffmpeg PUBLIC -Wl,-force_load avfilter)
consider the two arguments -Wl,-force_load
and avfilter
to be 2 differents targets, one being passed as is because it’s a link flags and the other one treated as a target known to CMake (plain or imported).
See: https://cmake.org/cmake/help/latest/command/target_link_libraries.html
in order to check the rule of TLL ordering done by CMake.
as stated there you may have to tweak expected correct order with TLO:
https://cmake.org/cmake/help/latest/command/target_link_options.html