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 The new number here is "both", which means it matched both exact and ALLUP, which means the filename is already FindALLUPPERCASE.cmake. The 29 unclear files are files where e.g. not even one matching variable name was found. This is the case e.g. for FindLua50.cmake and FindLua51.cmake, where the variable names both start with LUA_ (and not LUA50/51_). This leaves 101 countable files. So, you can interprett it at least these two ways: there are 91 of 101 files where the variable names are ALLUPPERCASE, and only 10 of 101 files where the variable names contain also lowercase characters. (i.e. in 90% of the case just use ALLUPPERCASE and you are right) OR: There are 46 of 101 files where the variable names matches exactly the filename, and 55 of 101 files where the variable name is the ALLUPPERCASED version of a CamelCased filename. (i.e. in 46% of the cases just use ExactCase and you are right) Alex
checkModules.py
Description: application/python
_______________________________________________ cmake-developers mailing list cmake-developers@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers