Skip to content

Commit bab28bb

Browse files
author
Clement Champetier
committed
FindFFmpeg.cmake: manages REQUIRED statement
* If REQUIRED is specified for modules, raise error if a module is not found.
1 parent a5c72f9 commit bab28bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmake/FindFFmpeg.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,16 @@ else()
9696
find_component(${COMPONENT} lib${LOWERCOMPONENT} ${LOWERCOMPONENT} lib${LOWERCOMPONENT}/${LOWERCOMPONENT}.h)
9797
# If the component is found.
9898
if(${COMPONENT}_FOUND)
99-
message(STATUS "Required component ${COMPONENT} present.")
99+
message(STATUS "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(STATUS "Required component ${COMPONENT} missing.")
104+
if(FFmpeg_FIND_REQUIRED)
105+
message(SEND_ERROR "Error: required component ${COMPONENT} missing.")
106+
else()
107+
message(STATUS "Warning: component ${COMPONENT} missing.")
108+
endif()
105109
endif()
106110
endforeach()
107111

0 commit comments

Comments
 (0)