其他分享
首页 > 其他分享> > CMakeList 基础写法

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} )
 

 

标签:CMakeList,11,set,cmake,基础,imageBasics,OpenCV,include,写法
来源: https://blog.csdn.net/u011808673/article/details/95946531