4

CMakeList批量导入源文件和头文件

 2 years ago
source link: https://dawnki.github.io/2017/08/25/goodCMake/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

CMakeList批量导入源文件和头文件

2017-08-25

今天分享一套 提高寿命 的CMakelist写法,仅供简单项目使用O(∩_∩)O哈哈~

cmake_minimum_required(VERSION 3.8)
project(your_project_name)
set(CMAKE_CXX_STANDARD 11)
file(GLOB SOURCE_FILES "*.h" "*.cpp")
add_executable(your_project_name ${SOURCE_FILES})

简单粗暴利用 通配符 直接把目录下的所有头文件,源文件直接导入,包括二级,三级…..N级目录。

妈妈再也不用担心我xxxx未定义使用~\(≧▽≦)/~啦啦啦

弱鸡写法,仅供简单项目使用233333333


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK