I consider this a fundamental step for creating projects that use OpenCV libraries so you don’t need to manually include all the libraries. There is not detailed information on this topic, at least for a newbie that just wants to use OpenCV as soon as posible, so:
Which is the easiest and scalable way to create a multiplatform c++ OpenCV with Cmake?
First: create a folder Project containing two subfolders src and include, and a file called CMakeLists.txt.
Second: Put your cpp inside the src folder and your headers in the include folders.
Third: Your
CMakeLists.txtshould look like this:Fourth: Open CMake GUI and select the root folder as input and create a build folder for the output. Click configure, then generate, and choose the generator (VisualStudio, Eclipse, …)