git clone git@github.com:snandasena/opencv-cpp-examples.git
cd opencv-cmake-config
mkdir build
cd build
cmake ../src/
cd ../
cmake --build build --target opencvdemo -- -j4
./build/opencvdemo
There are multiple c++ files in src folder and if you want to try those, please un comment required file from CMakeLists.txt and run it.
Please visit OpenCV