cmake_minimum_required(VERSION 3.1)
project(untitled)
set(CMAKE_CXX_STANDARD 14)
# 设置OpenCV路径
set(OpenCV_DIR D:\\opencv\\build)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(untitled
main.cpp)
target_link_libraries(
${PROJECT_NAME}
${OpenCV_LIBS}
)
clion配置OpenCV环境Cmake文件写法图片示例,出现opencv的地址就说明配置成功了: