[cmake-developers] fphsa capitalization

Eric Noulard eric.noulard at gmail.com
Wed Aug 11 16:02:11 EDT 2010


2010/8/11 Alexander Neundorf <neundorf at kde.org>:
> On Tuesday 10 August 2010, Brad King wrote:
>> On 08/10/2010 05:14 PM, Alexander Neundorf wrote:
>> > I think it is still true for most find-modules, I think there are only a
>> > few exceptions, mostly Boost and Subversion.
>> > Checking... ok, also PostgreSQL, LibArchive (they are both new, right ?),
>> > ImageMagick and Java set the exact-case _FOUND variables.
>> > All others (more then 100 ?) use the UPPERCASE_FOUND.
>> >
>> > No matter which version I personally like better, I really do think that
>> > the big majority uses UPPERCASE_CASE found, and now declaring that
>> > ExactCase_FOUND is the standard would be wrong.
>>
>> I think the subversion patch in question is a step backwards.
>> Somehow we need to move toward the Right Thing.  At least the
>> documented FOO_FOUND variable should match the case of the
>> rest of the Foo_XXX variables in the same module.  This is why
>> I think the fphsa should just set both,
>
> Well, I still think the UPPERCASE_ prefix also has it advantages, I don't have
> to remember the exact case of the module (was it FindLibXml2 or FindLibXML2
> or Findlibxml2 or FindLibxml2, the variables are all just LIBXML_SOMETHING).
> It also makes them look more "consistent".

The simplicity argument is a good one.
I was in favor of ExactCase because I found it more "coherent"
but I admit UPPERCASE is "easier to remember".

I think the strongest argument is the one from Alan:

" I don't care what standard you follow so long as it is not ambiguous like the
  present standard in readme.txt AND enforced (with appropriate test
  scripts) in all the Find modules distributed with CMake."

> But if the majority here thinks ExactCase is better then ok.

So in the end I would say "I don't care" but let's do it for good:

 1) Chose between UPPERCASE and ExactCase

 2) Update FPHSA **and** Module/readme.txt accordingly

 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.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkModules.py
Type: text/x-python
Size: 2883 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20100811/b3ef324a/attachment-0002.py>


More information about the cmake-developers mailing list