#cmake_minimum_required(VERSION 3.16)
#set(DEFAULT_CXX_STANDARD 11)
#set(OpenCV_DIR D:/opencv/build/x64/vc15/lib/)#库路径你自己换成你电脑上的:添加环境变量(D:/opencv/build/)
#1、找opencv所在位置
find_package(OpenCV REQUIRED)
#2、包含库目录
#include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(D:/opencv/build/include)
#3、生成可执行文件
#add_executable(lesson2_opencv ${PROJECT_SOURCE_DIR}/main.cpp)
add_executable(lesson2_opencv main.cpp)
#4、链接opencv库:.lib
#target_link_libraries(lesson2_opencv ${OpenCV_LIBS}) #.lib文件库路径
target_link_libraries(lesson2_opencv D:/opencv/build/x64/vc15/lib/opencv_world460d.lib)