# CMake 宏

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/clion/llms.txt).

您可以在设置 [运行/调试配置](run-debug-configuration-application.html)和 [外部工具](configuring-third-party-tools.html)时使用特定于 CMake 的宏（例如，用于使用与项目相关的路径）。

点击 ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.add_dark.svg)，在您希望插入宏的字段中，然后从列表中选择它：

![CMake 宏](https://resources.jetbrains.com/help/img/idea/2026.3/cl_cmake_macros.png)

> **Note:**
> 如果您在 [远程与本地源](remote-projects-support.html)模式下工作，您可以使用本地和远程路径及名称的宏，它们将被正确展开。 例如，  `CMakeCurrentProductLocalFile` 会展开为当前配置的本地产品路径，而  `CMakeCurrentProductFile` 则返回环境（远程）路径。

## See also

### 操作指南

[快速 CMake 教程](quick-cmake-tutorial.html) [External Tools](configuring-third-party-tools.html) [自定义构建目标和应用程序](custom-build-targets.html)

