/cpp-opencv-cmake-superbuild

Automatically download, build and use OpenCV with OpenCV contrib for C++ application using CMake

Primary LanguageCMakeThe UnlicenseUnlicense

cpp-opencv-cmake-superbuild

Automatically download, build and use OpenCV with OpenCV contrib for C++ application using CMake.

How to use

clone the repo in your desired folder ex: cvdemo

git clone https://github.com/BBO-repo/cpp-opencv-cmake-superbuild.git cvdemo
cd cvdemo

run the cmake configuration to generate makefiles in the folder cvdemo/build

cmake -S . -B build

run cmake to build your app

cmake --build build --target all

That's it you're done! You can enjoy developing OpenCV wonderful stuffs

Notes: Downloading opencv and opencv-contrib may take some time.. fortunately you only do it once
Comments: You could also using previous cmake commands

mkdir build
cd build
cmake ..
make

P.S: Building opencv may take some time .. you could increase number of threads

cmake --build build --target all -j12

Or if using the previous cmake commands

...
make -j12

P.P.S: You may want to update OPENCV_LIBS with your additionnal required linked libs and as opencv build as dynamic library. Also make sure the LD_LIBRARY_PATH is updated while running your exectable in the bin/ folder.