LoginSignup
1

More than 3 years have passed since last update.

cmake-format で CMakeLists.txt を自動整形する

Posted at

背景

CMakeLists.txt いろいろ手動で記述していくと, 1 行が長くなったり, ifdef のインデントを保つのが面倒ですね...
clang-format で C/C++ コードが自動整形できるように, cmake の CMakeLists.txt も自動整形したい.

解決

cmake-format があります.

ありがとうございます.

pip install でお手軽に使えます.

cmake-format -i CMakeLists.txt で上書き(in-place)できます.

その他の詳細は git repo を参照ください.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1