If the FFMPEG_AVCODEC_LIBRARIES variable does not exist, it will generate a cmake error, so check to make sure the variable exists before executing this code.
@@ -7,7 +7,9 @@ find_package(FFmpeg REQUIRED
OPTIONAL_COMPONENTS avcodec)
include_directories(${FFMPEG_INCLUDE_DIRS})
-list(REMOVE_ITEM FFMPEG_LIBRARIES ${FFMPEG_AVCODEC_LIBRARIES})
+if (NOT "${FFMPEG_AVCODEC_LIBRARIES}" STREQUAL "")
+ list(REMOVE_ITEM FFMPEG_LIBRARIES ${FFMPEG_AVCODEC_LIBRARIES})
+endif()
if(UNIX)
find_package(DBus QUIET)