CMake coding style in ECM?

Alexander Neundorf neundorf at kde.org
Wed Sep 14 20:42:50 UTC 2011


On Tuesday, September 13, 2011 11:59:44 PM Allen Winter wrote:
> On Tuesday 13 September 2011 2:32:31 PM Stephen Kelly wrote:
> > Hi,
> > 
> > I propose using a modern CMake coding style in modules added to ECM.
> > Notable changes compared to the only existing module in there not
> > written from scratch (ECMOptionalAddSubdirectory):
> > 
> > * Use lowercase CMake commands
> > ** if(...) instead of IF(...)
> > ** add_subdirectory instead of ADD_SUBDIRECTORY(...)
> > ** etc
> > 
> > * Use empty closing macros
> > ** endif() instead of endif(...)
> > ** endforeach instead of endforeach(...)
> > 
> > What do you think?
> 
> We already have a CMake coding style policy
> http://techbase.kde.org/Policies/CMake_Coding_Style
> 
> But I think your suggestions should be added to that policy, namely:
> - use lowercase for the CMake commands
> - use empty closing macros
> as well as
>  - 2 char indentation

Agree, except that I think 3 char indentation is used in most files, at least 
in FindKDE4Internal.cmake and KDE4Macros.cmake.
So, if we really want to recommend how many characters to indent, I'm for 3.
(we already recommend to used space-indentation instead of tabs).

Alex


More information about the Kde-buildsystem mailing list