最近使用cmake在编译一个配置了opencv环境的c++开源项目时遇到如下问题:
CMake Warning at D:/opencv4/OpenCVConfig.cmake:176 (message):
Found OpenCV Windows Pack but it has no binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:13 (find_package)
CMake Error at CMakeLists.txt:13 (find_package):
Found package configuration file:
D:/opencv4/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
于是查看了所有博客的方法,基本分为两类,一类是修改CMakeLis.txt文档,另一类是opencv版本或者vs版本问题,尝试了一圈基本都没有用。最后无意间发现在configure时没有选择x64,默认的是x86,选择x64之后就编译成功了,给遇到同样问题的同志一个参考!