Skip to content

cmake: FFMPEG not detected when WARNINGS_ARE_ERRORS=ON #9047

@travbid

Description

@travbid
System information (version)
  • OpenCV => 3.2.0
  • Operating System / Platform => Ubuntu Gnome x86_64
  • Compiler => g++ 5.4.0
Detailed description

When trying to build OpenCV from source and running cmake, FFMPEG will not be detected/configured if WARNINGS_ARE_ERRORS is set.

Steps to reproduce
git clone https://github.com/opencv/opencv
cd opencv
mkdir build
cd build
cmake -D OPENCV_WARNINGS_ARE_ERRORS=ON ..

Results in cmake-opencv-1.txt
Note Video I/O: FFMPEG: NO

Un-commenting line 241 of cmake/OpenCVFindLibsVideo.cmake ( message(FATAL_ERROR "FFMPEG: test check build log:\n${TRY_OUT}") ) results in cmake-opencv-2.txt
Note the unused variables and unchecked errors in cmake/checks/ffmpeg_test.cpp

Re-commenting line 241 and running:

cmake ..

results in Video I/O: FFMPEG: YES

Proposed solution

Do something with the unused variables and check the errors in cmake/checks/ffmpeg_test.cpp

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions