在配置完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.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
后来查到需要添加下面一句话
set(OpenCV_FOUND 1)
- 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
- 2
问题解决,原因未知。
原文链接:https://www.f2er.com/ubuntu/349726.html