0

I am new to OpenCV with CMake and I am using it on Windows for the first time and facing some problem which I have mentioned below.

CMake Error at CMakeLists.txt:10 (find_package):
  By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OpenCV", but
  CMake did not find one.

  Could not find a package configuration file provided by "OpenCV" (requested
  version 3.1.0) with any of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake

  Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
  "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
  provides a separate development package or SDK, be sure it has been
  installed.

Can anyone suggest me a step-by-step solution for this.

Craig Scott
  • 9,238
  • 5
  • 56
  • 85
  • 2
    Possible duplicate of [cmake is not working in opencv c++ project](https://stackoverflow.com/questions/9742052/cmake-is-not-working-in-opencv-c-project) – Dmitrii Z. Jan 31 '18 at 10:33

1 Answers1

0

Use vcpkg.exe to build open-source windows projects , including OpenCV, on the fly. Download vcpkg from github and build the vcpkg.exe. CMake download and cross-compiling( if any) will be perform automatically. Open Powershell window in administrative mode and type .\vcpkg install opencv . After successful install type .\vcpkg integrate install on the Powershell command prompt. Your project is ready and the libraries will be automatically inserted in your project. You can choose x86 or x84 or static/dynamic built.

seccpur
  • 4,996
  • 2
  • 13
  • 21