Example for CMake build system.Compile OpenCV with cmake, preferently in an off-tree build, for example: $ mkdir opencv-release $ cd opencv-release $ cmake <OPENCV_SRC_PATH> $ makeAnd, *only optionally*, install it with. $ sudo make installThen create the binary directory for the example with: $ mkdir example-release $ cd example-releaseThen, if "make install" have been executed, directly running $ cmake <OPENCV_SRC_PATH>/samples/c/example_cmake/will detect the "OpenCVConfig.cmake" file and the project is ready to compile.If "make install" has not been executed, you'll have to manually pick the opencvbinary directory (Under Windows CMake may remember the correct directory). Openthe CMake gui with: $ cmake-gui <OPENCV_SRC_PATH>/samples/c/example_cmake/And pick the correct value for OpenCV_DIR.