Skip to content

Building OpenCV

These guides cover building OpenCV from source on each supported platform. Building from source gives you full control over compile-time flags, optional modules (opencv_contrib), GPU acceleration (CUDA), and debug/release configurations.

Build on Linux

GCC/Clang, apt dependencies, CMake flags, and opencv_contrib on Linux.

Read more →

Build on Windows

Visual Studio, cmake-gui, Ninja, and MSVC-specific gotchas on Windows.

Read more →

Build on macOS

Xcode, Homebrew, and Apple Silicon (M-series) build flags on macOS.

Read more →

Build with CUDA (Linux & Windows)

CMake flags, compute capability table, full CUDA build commands for Linux and Windows.

Read more →

Build on Jetson Nano

JetPack 4.6, CUDA 10.2, swap expansion, and full CMake config for NVIDIA Jetson Nano.

Read more →