如果要用Cmake编译引用Opencv的库,CmakeLisets可以这样写,把contour_detect换成自己的项目名称就可以了。
cmake_minimum_required(VERSION 3.15)
project(contour_detect)
set(CMAKE_CXX_STANDARD 14)
find_package(OpenCV REQUIRED)
add_executable(contour_detect main.cpp)
target_link_libraries(contour_detect ${OpenCV_LIBS})