Browse Source

libobs: Fix cmake bug (make sure variable exists)

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.
jp9000 10 years ago
parent
commit
df14671d2f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libobs/CMakeLists.txt

+ 3 - 1
libobs/CMakeLists.txt

@@ -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)