本篇文章重点介绍 CMakeLists.txt 的基础语法和常用指令。 变量使用 ${} 方式取值,但是在 IF 控制语句中是直接使用变量名。 指令(参数 1 参数 2...) 参数使用括弧括起,参数之间使用空格或分号分开。以 ADD_EXECUTABLE 指令为例,如果存在main.c、func.c 源文件 ...
在介绍cmake之前,我们先来从工具一个个衍生出来,做过linux c/c 编程的时候一般用过gcc指令或者makefile。我们先来介绍下 gcc(GNU Compiler Collection)将源文件编译(Compile)成可执行文件或者库文件; 而当需要编译的东西很多时,需要说明先编译什么,后编译什么 ...
When looking through a large list of projects, one thing becomes apparent: a description of the build process always is stored in a group of files. These files can be simple shell scripts, Makefiles, ...