下载安装
CMake 官网下载 https://cmake.org/download/
安装完打开:
Tools -> How to install For Command Line Use
弹窗里提供了命令行使用CMake的配置方法
截屏2021-11-12 下午5.30.32.png
临时使用 (关闭命令行窗口会失效)
PATH="/Applications/CMake.app/Contents/bin":"$PATH"
长期使用
在bash_profile中配置CMake路径
open .bash_profile
// 在bash_profile中 添加CMake Path
export PATH="/Applications/CMake.app/Contents/bin":"$PATH"
在zshrc 中执行source .bash_profile
vim ~/.zshrc
// 添加source .bash_profile
source .bash_profile