Skip to content

Commit

Permalink
fix: build using system ffmpeg when ffmpeg include dirs are empty and…
Browse files Browse the repository at this point in the history
… fix undefined reference to boost::log (#1522)
  • Loading branch information
nerijus authored Jan 16, 2024
1 parent ebe69dd commit fb253fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CMakeModules/Bootstrap_Linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MARK_AS_ADVANCED (CMAKE_INSTALL_PREFIX)
if (USE_STATIC_BOOST)
SET (Boost_USE_STATIC_LIBS ON)
endif()
FIND_PACKAGE (Boost 1.67.0 COMPONENTS system thread chrono filesystem log locale regex date_time coroutine REQUIRED)
FIND_PACKAGE (Boost 1.67.0 COMPONENTS system thread chrono filesystem log_setup log locale regex date_time coroutine REQUIRED)

if (NOT USE_SYSTEM_FFMPEG)
FetchContent_Declare(
Expand Down
12 changes: 10 additions & 2 deletions src/CMakeModules/FindFFmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,17 @@ foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
endforeach ()

# Compile the list of required vars
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
if (FFMPEG_INCLUDE_DIRS)
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
else ()
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES)
endif ()
foreach (_component ${FFmpeg_FIND_COMPONENTS})
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
if (${_component}_INCLUDE_DIRS)
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
else ()
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES)
endif ()
endforeach ()

# Give a nice error message if some of the required vars are missing.
Expand Down

0 comments on commit fb253fd

Please sign in to comment.