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

若安装OpenCV测试时报错

CMake Warning at /home/e/OpenCV/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:

    /home/e/OpenCV/cmake/OpenCVConfig.cmake

  but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
  NOT FOUND.
CmakeLists.txt这样写的话!

cmake_minimum_required(VERSION 2.8)  
project( Display )  
find_package( OpenCV REQUIRED )  
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( Display Display.cpp )  
target_link_libraries( Display ${OpenCV_LIBS} ) 
1.find_package( OpenCV REQUIRED )  后添加 include_directories( ${OpenCV_INCLUDE_DIRS} )
2.find_package( OpenCV REQUIRED )  后添加  set( OpenCV_FOUND 1 )
3.find_package( OpenCV REQUIRED )  后添加 set(OpenCV_DIR /home/***/opencv-2.4.13/build)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值