0

We have a lot of CMake files that contain set()-sequences like

set(VERSION_MAJOR 1)
set(VERSION_MINOR 2)
set(VERSION_ABI   3)
set(VERSION_PATCH 0-rc2)

I can't find a for cmake-format to keep things aligned like that; it will always condense the repeated whitespaces (here, after _ABI) into one.

Is there a way to tell cmake-format to keep this alignment?

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94

1 Answers1

2

I would suggest simply disabling cmake-format locally around these few lines. See the manual: https://cmake-format.readthedocs.io/en/stable/format-features.html?highlight=disable#disable-formatting-locally

# cmake-format: off
set(VERSION_MAJOR 1)
set(VERSION_MINOR 2)
set(VERSION_ABI   3)
set(VERSION_PATCH 0-rc2)
# cmake-format: on
mbr0wn
  • 1,339
  • 1
  • 10
  • 12