diff --git a/src/devices/ffmpeg/CMakeLists.txt b/src/devices/ffmpeg/CMakeLists.txt index 52f61e2ab8..fd8311b017 100644 --- a/src/devices/ffmpeg/CMakeLists.txt +++ b/src/devices/ffmpeg/CMakeLists.txt @@ -20,6 +20,23 @@ yarp_prepare_plugin(ffmpeg_writer DEPENDS "YARP_HAS_FFMPEG;FFMPEG_avcodec_FOUND;FFMPEG_avformat_FOUND;FFMPEG_avdevice_FOUND;FFMPEG_avutil_FOUND;FFMPEG_swscale_FOUND" ) +if (FFmpeg_VERSION VERSION_LESS "4.0.0") + set(FFMPEG_VERSIONS_IS_OK TRUE) + message(WARNING"ffmpeg <4)" +elseif (FFmpeg_VERSION VERSION_LESS "5.0.0") + set(FFMPEG_VERSIONS_IS_OK TRUE) + message(WARNING "ffmpeg >=4 <5)" +else() + set(FFMPEG_VERSIONS_IS_OK FALSE) + message(WARNING "ffmpeg >=5)" +endif() + +if(NOT FFMPEG_VERSIONS_IS_OK AND (NOT SKIP_ffmpeg_grabber OR NOT SKIP_ffmpeg_writer)) + message(WARNING "ffmpeg_grabber/ffmpeg_writer devices cannot be currently compiled with FFMPEG library version greater >=5. See issue https://github.com/robotology/yarp/issues/2885") + set (SKIP_ffmpeg_grabber TRUE) + set (SKIP_ffmpeg_writer TRUE) +endif() + if(NOT SKIP_ffmpeg_grabber OR NOT SKIP_ffmpeg_writer) yarp_add_plugin(yarp_ffmpeg) @@ -84,6 +101,3 @@ if(NOT SKIP_ffmpeg_grabber OR NOT SKIP_ffmpeg_writer) set_property(TARGET yarp_ffmpeg PROPERTY FOLDER "Plugins/Device") endif() - -include(YarpRemoveFile) -yarp_remove_file("${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}/ffmpeg.ini") # YARP_DEPRECATED since YARP 3.2