but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.

一、问题详情
在ubuntu中使用CMake编译链接opencv库的程序时找不到opencv库,信息如下:

CMake Warning at //home/smallping/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:20 (find_package)


CMake Error at CMakeLists.txt:20 (find_package):
  Found package configuration file:

    //home/smallping/opencv-3.1.0/cmake/OpenCVConfig.cmake

  but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
  NOT FOUND.


-- Configuring incomplete, errors occurred!
 

二、解决方法
经过查阅资料各种尝试,现已解决。主要问题在于库路径问题,

通过

sudo apt-get install cmake-qt-gui

cmake-gui

然后正确设置OpenCV_CONFIG_PATH and OpenCV_DIR。

OpenCV_CONFIG_PATH指向编译的OpenCVConfig.cmake

OpenCV_DIR指向编译的opencv目录(比如我编译opencv的时候,在cv源码下1、mkdir build. 2、cd build. 3、cmake, 那么路径就是build目录)

你可能感兴趣的:(but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.)