vscode cmake-format

1,292 阅读1分钟

vscode中格式化CMakeLists.txt

安装cmake-format插件

image.png

工作机中安装cmake_format

我的机器是Ubuntu 20.04

$ sudo apt-get install python3-pip
$ pip3 install cmake_format

配置cmake-format settings.json

"cmakeFormat.exePath": "cmake-format"

Q

pip3 安装cmake_format之后,并没有立即生效,重启之后生效,挺奇怪的,后续有时间再看看原因