Ask Your Question

Revision history [back]

Use doc :

Building OpenCV from Source Using CMake

Create a temporary directory, which we denote as <cmake_build_dir>, where you want to put the generated Makefiles, project files as well the object files and output binaries and enter there.

For example
cd ~/opencv
mkdir build
cd build

Configuring. Run cmake [<some optional parameters>] <path to the OpenCV source directory>

For example
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

or cmake-gui
    set full path to OpenCV source code, e.g. /home/user/opencv
    set full path to <cmake_build_dir>, e.g. /home/user/opencv/build
    set optional parameters
    run: “Configure”
    run: “Generate”