From ba5ad79394c444b76f905711d9b56382a74acc2b Mon Sep 17 00:00:00 2001 From: "chen.yang" Date: Thu, 5 Aug 2021 19:59:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E4=BD=BF=E7=94=A8=20CMake?= =?UTF-8?q?=20=E6=9E=84=E5=BB=BA=E9=A1=B9=E7=9B=AE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chen.yang --- .../Environment/CMake/使用_CMake_构建项目.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Software/Development/Environment/CMake/使用_CMake_构建项目.md diff --git a/Software/Development/Environment/CMake/使用_CMake_构建项目.md b/Software/Development/Environment/CMake/使用_CMake_构建项目.md new file mode 100644 index 0000000..ed7bc88 --- /dev/null +++ b/Software/Development/Environment/CMake/使用_CMake_构建项目.md @@ -0,0 +1,19 @@ +# 使用 CMake 构建项目 + +## 1.基本使用 + +CMake 会生成各种临时文件,用下面命令可将这些临时文件集中在 build 文件夹下: + +```bash +cmake -S . -B build +``` + +## 2.常用宏 + +### 2.1.CMAKE_INSTALL_PREFIX + +通过修改该宏,重新指定 install 目录: + +```bash +cmake -DCMAKE_INSTALL_PREFIX +```