[cmake-developers] Questions about coding conventions

Stephen Kelly steveire at gmail.com
Sat Jun 11 09:45:30 EDT 2016


Daniel Pfeifer wrote:

> On Fri, Jun 10, 2016 at 3:43 PM, Brad King
> <brad.king at kitware.com> wrote:
>> On 06/10/2016 09:30 AM, Daniel Pfeifer wrote:
>>> By looking at the CMake source code, there are some inconsistencies
>>> regarding coding conventions. This is not a big problem and fixing
>>> them probably does not have a high priority.
>>> I would like to know what conventions to follow for new code.
>>
>> Please look at documenting this in CONTRIBUTING.rst once we resolve
>> this discussion.
> 
> ok.

Or link to 

 Help/manual/cmake-developer.7.rst

and put it there.

> I see that `#include <string.h>` is preferred over `#include
> <cstring>`. Are there old compilers supported that prohibit the latter
> or was it just not changed yet?

Probably just not changed with. Porting CMake away from C++95 happened quite 
recently. The same is probably true of other includes like assert.h

> cmStandardIncludes.h includes many standard headers. That is against
> the idea of include-what-you-use. Is there a particular requirement or
> was it just not cleaned up yet?

I cleaned up some of these last year. IIRC there are things in cmConfigure.h 
which must be before some of the remaining includes, otherwise bad things 
happen in certain translation units on some dashboard machines.

Thanks,

Steve.




More information about the cmake-developers mailing list