CMake Tutorial
CMakeLists.txt
简单项目三行
cmake_minimum_required(VERSION 3.10)
# set the project name
project(Tutorial VERSION 1.0)
# add the executable 利用源码文件生成目标可执行程序
add_executable(Tutorial src/tutorial.cxx)
mkdir build
cd build
cmake .. # 按照 CMakeLists 配置文件运行构建Makefile文件
make # 编译项目
入门实战
https://www.hahack.com/codes/cmake/