<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; Current master (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/opencv/opencv/commit/63564039640c81256ccfedf77899e37746352d45/hovercard" href="https://github.com/opencv/opencv/commit/63564039640c81256ccfedf77899e37746352d45"><tt>6356403</tt></a> on 2018-8-23)</li>
<li>Operating System / Platform =&gt; Ubuntu 18.04</li>
<li>Compiler =&gt; GCC 7.3.0, CMake version 3.10.2</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">When compiling OpenCV I ran into the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Scanning dependencies of target opencv_videoio
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/videoio_registry.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/videoio_c.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_images.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_encoder.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/container_avi.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_gstreamer.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_v4l.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_gphoto2.cpp.o
/home/ruben/Projects/Libraries/opencv/modules/videoio/src/cap_gphoto2.cpp:32:10: fatal error: gphoto2/gphoto2.h: No such file or directory
 #include &lt;gphoto2/gphoto2.h&gt;
          ^~~~~~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">Scanning dependencies of target opencv_videoio
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/videoio_registry.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/videoio_c.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_images.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_encoder.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/container_avi.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dc1394_v2.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_gstreamer.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_v4l.cpp.o
[ 36%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_gphoto2.cpp.o
/home/ruben/Projects/Libraries/opencv/modules/videoio/src/cap_gphoto2.cpp:32:10: fatal error: gphoto2/gphoto2.h: No such file or directory
 #include &lt;gphoto2/gphoto2.h&gt;
          ^~~~~~~~~~~~~~~~~~~
</code></pre></div>
<p dir="auto">So it's missing the header files for gPhoto2. However, CMake says that it detects gPhoto2 to be present:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--     gPhoto2:                     YES"><pre class="notranslate"><code class="notranslate">--     gPhoto2:                     YES
</code></pre></div>
<p dir="auto">Turns out that the problem was that I did have gPhoto2 present on my system, but not the development files that includes the header that OpenCV needs for this module. CMake detected gPhoto2, but this was a false positive as I didn't have the required files anyway. Installing Ubuntu's package for libgphoto2-dev fixed the problem for me, because that put <code class="notranslate">gphoto2.h</code> on the include path.</p>
<h5 dir="auto">Steps to reproduce</h5>
<ol dir="auto">
<li>Install all dependencies of OpenCV except gPhoto2.</li>
<li>Install the Ubuntu package for <code class="notranslate">libgphoto2-6</code>, but not <code class="notranslate">libgphoto2-dev</code>.</li>
<li>Build OpenCV using CMake.</li>
</ol>
<h5 dir="auto">Actual results</h5>
<ul dir="auto">
<li>Error at 36% that <code class="notranslate">gphoto2.h</code> is not found.</li>
</ul>
<h5 dir="auto">Expected results</h5>
<p dir="auto">gPhoto2 should not be marked as found in the configure stage of OpenCV, if its header files are not present. Furthermore, I'd expect one of these things to happen, whichever you think is most common behaviour for OpenCV:</p>
<ul dir="auto">
<li>CMake disables whatever modules require gPhoto2 (videoio at least), or</li>
<li>an error is raised during the configure stage that not all modules can be built as desired.</li>
</ul>
<h1 dir="auto">OpenCV Documentation</h1>
<p dir="auto">When you click on the link in the following line in the documentation "List of codes can be obtained at <a href="http://www.fourcc.org/codecs.php" rel="nofollow">Video Codecs by FOURCC</a> page", you get redirected to the wrong page.</p>
<p dir="auto">This is in the VideoWriter section of the documentation. <a href="https://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture" rel="nofollow">https://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture</a></p>