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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章