Skip to content

Commit a5c72f9

Browse files
author
Clement Champetier
committed
CMake: get swresample or avresample
* Update FindFFmpeg.cmake : do not raise error if a component is not found (warning).
1 parent cdbc802 commit a5c72f9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmake/FindFFmpeg.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ endmacro()
3636
# then looking up the libraries and include directories.
3737
# @todo: WIN and MAC OSX.
3838
#
39-
macro(find_component COMPONENT PKGCONFIG PKGOPTION LIBRARY HEADER)
39+
macro(find_component COMPONENT PKGCONFIG LIBRARY HEADER)
4040
if(NOT WIN32)
4141
# use pkg-config to get the directories and then use these values
4242
# in the FIND_PATH() and FIND_LIBRARY() calls
4343
find_package(PkgConfig)
4444
if(PKG_CONFIG_FOUND)
45-
pkg_check_modules(PC_${COMPONENT} ${PKGCONFIG} ${PKGOPTION})
45+
pkg_check_modules(PC_${COMPONENT} ${PKGCONFIG})
4646
endif()
4747
endif()
4848

@@ -93,15 +93,15 @@ else()
9393
foreach(COMPONENT ${FFmpeg_FIND_COMPONENTS})
9494
# Get component name is lower cases.
9595
string(TOLOWER ${COMPONENT} LOWERCOMPONENT)
96-
find_component(${COMPONENT} lib${LOWERCOMPONENT} REQUIRED ${LOWERCOMPONENT} lib${LOWERCOMPONENT}/${LOWERCOMPONENT}.h)
96+
find_component(${COMPONENT} lib${LOWERCOMPONENT} ${LOWERCOMPONENT} lib${LOWERCOMPONENT}/${LOWERCOMPONENT}.h)
9797
# If the component is found.
9898
if(${COMPONENT}_FOUND)
9999
message(STATUS "Required component ${COMPONENT} present.")
100100
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${COMPONENT}_LIBRARIES})
101101
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${COMPONENT}_DEFINITIONS})
102102
list(APPEND FFMPEG_INCLUDE_DIR ${${COMPONENT}_INCLUDE_DIR})
103103
else()
104-
message(SEND_ERROR "Required component ${COMPONENT} missing.")
104+
message(STATUS "Required component ${COMPONENT} missing.")
105105
endif()
106106
endforeach()
107107

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include(AvTranscoderMacros)
44

55
##find_package(FFmpeg)
66
find_package(FFmpeg
7-
COMPONENTS REQUIRED avcodec avformat avutil swscale swresample)
7+
COMPONENTS avcodec avformat avutil swscale swresample avresample)
88

99
# get FFmpeg / libav libraries from path
1010
file(GLOB FFMPEG_LIBRARIES "${FFMPEG_LIBRARIES}/*.so")

0 commit comments

Comments
 (0)