1、先安装 brew,参考文章:Mac Pro 安装 Homebrew 软件包管理工具
2、执行安装命令
brew install cmake
出现警告提示:
Warning: cmake-3.5.2 already installed, it's just not linked
3、国外网友也遇到这个问题:cmake-3.5.2 already installed, it's just not linked
解决方案:为 cmake 建立一个软连接
$ ln -s /usr/local/Cellar/cmake/3.5.2/bin/cmake /usr/local/bin/cmake $ cmake --version cmake version 3.5.2