[cmake-developers] fphsa capitalization

Alexander Neundorf neundorf at kde.org
Thu Aug 12 14:52:41 EDT 2010


On Thursday 12 August 2010, Alexander Neundorf wrote:
> On Wednesday 11 August 2010, Eric Noulard wrote:
> ...
>
> >  3) Review existing Modules and set-up "compatibility" missing vars
> >      in them if needed.
> >
> > You'll find attached a python script which does a "raw" check
> > on any file given as argument which would help for 3).
> >
> > currently
> > checkModules.py <prefix>/share/cmake-2.8/Modules/*
> >
> > gives:
> > Checked <130> files, exact=63, allUp=55, mismatch=12
> >
> > * exact       means ExactCase is used (including those whose name is
> > all upper case)
> > * allUp        means UPPERCASE is used
> > * mismatch means neither those two.
> >
> > there may be false positives because I do a raw regular expression match.
>
> I improved the script a bit, the numbers didn't seem right to me.
> I changed mainly the regexps used. They are now:
> any match: [ \(^][dD][oO][xX][yY][gG][eE][nN]_.+
> exact match: [ \(^]Doxygen_.+
> UPPERCASE match: [ \(^]DOXYGEN_.+
>
> Before there was nothing before the name and nothing after the underscore
> (e.g. "XDOXYGEN" would have matched too).
> The script now also skips the lines which contain _FIND_REQUIRED,
> _FIND_VERSION, _FIND_QUIETLY and _FIND_COMPONENTS, since these are set by
> cmake and not by the module itself, so they shouldn't be counted.
>
> Now it says:
> Checked <130> files, exact=10, allUp=55, both=36 unclear=29

This is for current kdelibs, since we have also quite a lot modules and quite 
a lot developers using them:

...
kdelibs/cmake/modules/FindXine.cmake checked OK : ALLUP match
kdelibs/cmake/modules/FindXmms.cmake checked OK : ALLUP match
Checked <102> files, exact=6, allUp=67, both=16 unclear=13

So here we have 83/89 ALLUPPERCASE vs. 6/89 HasAlsoLowerCase

OR

22/89 with ExactCase vs. 67/89 ALLUPPERCASE

Alex



More information about the cmake-developers mailing list