Files
vision-training-2026-opencvcpp/exp3_gaussian_blur/CMakeLists.txt

29 lines
874 B
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# 实验 3:高斯模糊 - CMake 构建配置文件
# ============================================================
# 最低 CMake 版本要求
cmake_minimum_required(VERSION 3.10)
# 项目标识名称
project(exp3_gaussian_blur)
# 使用 C++11 标准进行编译
set(CMAKE_CXX_STANDARD 11)
# 强制 C++11,不可降级
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 自动搜索并配置 OpenCV 的头文件和库文件路径
find_package(OpenCV REQUIRED)
# 生成名为 "exp3" 的可执行文件,编译源文件 main.cpp
add_executable(exp3 main.cpp)
# 链接 OpenCV 库到可执行文件
# ${OpenCV_LIBS} 变量由 find_package 自动设置,包含所有必需的 OpenCV 模块
target_link_libraries(exp3 ${OpenCV_LIBS})
# 添加 OpenCV 头文件搜索路径
include_directories(${OpenCV_INCLUDE_DIRS})