当使用简单的opencv功能时,在程序中包含这两个头文件即可,相应的CmakeLists.txt的写法如下
PROJECT(main)
cmake_minimum_required(VERSION 2.7)
# OpenCV
find_package( OpenCV 3.1 REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
ADD_EXECUTABLE(Test main.cpp)
target_link_libraries( Hello ${OpenCV_LIBS)