CMake Error at CMakeLists.txt CMAKE_PREFIX_PATH

  1. Check that OpenCV is installed on your system. Note the folder where it is installed. For example: C:\OpenCV
  2. Execute CMake with a command line similar to

cmake -DCMAKE_PREFIX_PATH="C:\OpenCV" ..

OR

find the folder containing OpenCVConfig.cmake (for example C:\OpenCV\build\x86\vc10\lib) and pass it to CMake via the variable OpenCV_DIR

cmake -DOpenCV_DIR="C:\OpenCV\build\x86\vc10\lib" ..

In both cases, I think the provider of the code you try to compile commited an error by putting NO_DEFAULT_PATH in the find_package(OpenCV ...). If nothing work, re-try after removing this flag.

Tags:

Opencv

Cmake