CMakeList 基础写法

#设置cmake 最小版本要求

cmake_minimum_required( VERSION 2.8 )
project( imageBasics )

# 添加c++ 11标准支持
set( CMAKE_CXX_FLAGS "-std=c++11" )
 

#设置查找opencv 的路径 该路径下放了 FindOpenCV.cmake 文件

set(OpenCV_DIR "/root/work_space/software/opencv3.3.0/share/OpenCV")
find_package( OpenCV 3 REQUIRED )

#添加 include 文件

include_directories( ${OpenCV_INCLUDE_DIRS} )

 

add_executable( imageBasics imageBasics.cpp )
 

# 链接OpenCV库
target_link_libraries( imageBasics ${OpenCV_LIBS} )
 

 

上一篇:c++ 并行:并行的一个小实验


下一篇:Cmake