CMake cannot find OpenCVConfig.cmake in Windows

asked 2018-03-06 19:35:05 -0600

moival gravatar image

Hi,

I installed OpenCV following the installation instructions for Windows, using the pre-built libraries. I also set the environment variable OPENCV_DIR to C:\opencv\build\x64\vc14 (in my case). It is my understanding that there is nothing else to do to be able to create a project using CMake.

However, when I try running CMake, it complains that it cannot find OpenCVConfig.cmake. That is probably because the file is not in %OPENCV_DIR%: there is one in opencv\build\x64\vc14\lib and one in opencv\build. I have to manually set OpenCV_DIR in CMake for it to run.

How is it supposed to work with the environment variable as it is set based on the documentation?

Thanks!

edit retag flag offensive close merge delete

Comments

there is no file findOpenCV.cmake in cmake/share/cmakex.y/modules folder. You must write in GUI box opencv folder or add parameter -DOpenCV=C:\opencv\ in command line

LBerger gravatar imageLBerger ( 2018-03-07 01:54:24 -0600 )edit