一、最简单的用法
mkdir -p /tmp/someplace
cd /tmp/someplace
cmake /path/to/source //CMakeList.txt文件所在的路径
cmake --build .
二、cmake生成的Makefile支持哪些target
cmake --build . --target help
The following are some of the valid targets for this Makefile:
... all (the default if no target is provided)
... clean
... depend
... rebuild_cache
... hello-world
... edit_cache
... hello-world.o
... hello-world.i
... hello-world.s
三、删除cmake生成的文件
cmake --build . --target <target- name>
语法,实现如下功能:
all
(
或
Visual Studio generator
中的
ALL_BUILD)
是默认目标,将在项目中构建所有目
标。
clean
,删除所有生成的文件。
rebuild_cache
,将调用
CMake
为源文件生成依赖
(
如果有的话
)
。
edit_cache
,这个目标允许直接编辑缓存。