若安装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)