cheshirekow / cmake_format

Source code formatter for cmake listfiles.
GNU General Public License v3.0
949 stars 104 forks source link

Positional argument formatting #283

Open saheerb opened 2 years ago

saheerb commented 2 years ago

I am newbie, apologies if it has been already answered: (Looking at the case studies) [https://cmake-format.readthedocs.io/en/latest/format-case_studies.html#positional-arguments]

I would like to format my CmMakeLists in the following format:

target_sources(test-harness
    INTERFACE
        shim.cpp
        shim1.cpp
        shim1.cpp
        shim1.cpp
        shim1.cpp
)

Is there any styling option I can use. If I run cmake-format, it is formatting based on the number of chars in line to:

target_sources(test-harness INTERFACE shim.cpp shim1.cpp shim1.cpp shim1.cpp shim1.cpp)
saheerb commented 2 years ago

@cheshirekow can you help here please?

janhieber commented 2 years ago

Set max_pargs_hwrap to 1 or so.

Close this if it solves your issue :)