[cmake-developers] CMake code style

Alexander Neundorf neundorf at kde.org
Tue Sep 21 12:13:40 EDT 2010


On Tuesday 21 September 2010, Alan W. Irwin wrote:
> On 2010-09-20 16:20-0400 Bill Hoffman wrote:
> > BTW, this type of code is not allowed in CMake:
> >
> >   if (fi!=files.begin()) os << ";";
> >
> > Needs to be:
> >
> > if((fi!=files.begin())
> > {
> > os << ";";
> > }
>
> If you want a consistent coding style in CMake, I suggest you give
> uncrustify a look.  It is extremely powerful and configurable, and we
> are quite pleased with the results it gives in the PLplot case.
>
> Let's face it, with a variety of humans involved with a code base some
> inconsistent coding style is constantly creeping in.  To stop that you
> need (1) some sort of style czar or (2) some semi-automatic script
> that does the job which one core developer runs by hand aperiodically
> to bring all code into conformance with a uniform style.  I feel that
> (2) is the better choice since it gives consistent results and better
> feelings amongst developers since it is easier to come to consensus on
> uncrustify options you are going to use then argue over styling of
> individual files.

I guess Kitware would favour kwstyle for that job ?
Last time I checked a few years ago it still had to mature a bit, don't know 
how it looks today.

Alex



More information about the cmake-developers mailing list