在配置完opencv之后,cmake测试,出现下面的错误
$ cmake .
-- OpenCV ARCH:
-- OpenCV RUNTIME:
-- OpenCV STATIC: ON
CMake Warning at /Applications/opencv-3.1.0/cmake/OpenCVConfig.cmake:166 (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:10 (find_package)
CMake Error at CMakeLists.txt:10 (find_package):
Found package configuration file:
/Applications/opencv-3.1.0/cmake/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
后来查到需要添加下面一句话
set(OpenCV_FOUND 1)
结果依然是上面的错误,后面又查到有人使用下面的方法
from opencv/build/ copy OpencvConfig.cmake and OpenCVModules.cmake to opencv/cmake/
then in you project delete file build and run again cmake .. and make
问题解决,原因未知。