20 lines
329 B
Markdown
20 lines
329 B
Markdown
|
# 使用 CMake 构建项目
|
||
|
|
||
|
## 1.基本使用
|
||
|
|
||
|
CMake 会生成各种临时文件,用下面命令可将这些临时文件集中在 build 文件夹下:
|
||
|
|
||
|
```bash
|
||
|
cmake -S . -B build
|
||
|
```
|
||
|
|
||
|
## 2.常用宏
|
||
|
|
||
|
### 2.1.CMAKE_INSTALL_PREFIX
|
||
|
|
||
|
通过修改该宏,重新指定 install 目录:
|
||
|
|
||
|
```bash
|
||
|
cmake -DCMAKE_INSTALL_PREFIX
|
||
|
```
|