sudo apt install build-essential cmake gcc libopencv-dev
mkdir build
cd build
cmake ..
cmake --build .
Download and install the following dependencies:
- Visual Studio IDE
- OpenCV for Windows. MSVC Specific Download Link. OpenCV extract location is relevant later. I recommend placing it in
C:/opencv
for simplicity. - CMake.
Navigate to where you have cloned this repository. Open a terminal and enter the following commands in order.
mkdir build
cd build
cmake .. -DOpenCV_DIR="<path/where/you/extracted/opencv/build/x64/vc16/lib>"
Note: DOpenCV_DIR is case-sensitive.
Once the commands finish executing, you should be able to find a MSVC solution (.sln) file in the build directory (i.e. /path/to/this-repository-name/build). Open the solution file and run the program via the green "Local Windows Debugger" button at the top.
When "Debug" is chosen in the configuration dropdown, OpenCV will output some error messages in the console but they can be ignored and do not appear if the configuration is switched to "Release"
If you add new files to the project, ensure you rerun: (terminal inside the build directory)
cmake .. -DOpenCV_DIR="<path/where/you/extracted/opencv/build/x64/vc16/lib>"
This will regenerate all the necessary project files to recognize the newly added file.
Download and install the following dependencies:
- Follow the instructions here to download MSYS on Windows and afterward install Ninja build tools.
- OpenCV for Windows. MSYS Specific Download Link. OpenCV extract location is relevant later. I recommend placing it in
C:/opencv
for simplicity. - CMake.
Navigate to where you have cloned this repository. Open a terminal and enter the following commands in order.
mkdir build
cd build
cmake .. -DOpenCV_DIR="<path/where/you/extracted/opencv/build/x64/mingw/lib>"
ninja
Note: DOpenCV_DIR is case-sensitive.
The built executable should be placed into the build directory.
If you make changes or add new files to the project, ensure you rerun: (terminal inside the build directory)
ninja