安装OpenCV
配置环境
配置Clion中的CMakeLists.txt文件
# 设置OpenCV的安装路径
set(OpenCV_DIR "D:/OpenCv_Win/opencv/build/x64/vc16/lib")
# 查找OpenCV包
find_package(OpenCV REQUIRED)
下面添加的CMakeLists.txt文件中主要是添加了后面的${OpenCV_LIBS}
# 链接Qt库,这里是链接了Qt下面的Widgets库和SerialPort库,OpenCV库
target_link_libraries(NaMi PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::SerialPort ${OpenCV_LIBS})
如上,OpenCV就配置完成了。