cmake case cleanupBRL-CAD
Status: ClosedTime to complete: 48 hrs Mentors: SeanTags: cmake, build system, logic cleanup

BRL-CAD uses the CMake build system.  With that system, our build logic is defined by a lot of script code spread throughout our repository in .cmake files.  The syntax of the script files is case insensitive, but we have an inconsistent use of uppercase and lowercase throughout.

This task involves updating our script code to make the logic and macro names be all lowercase.  Do not make the variables lowercase.

References:

  • http://cmake.org/Wiki/CMake/Language_Syntax
  • http://www.cmake.org/cmake/help/syntax.html

Code:

  • all CMakeLists.txt files
  • all *.cmake files

This should find most:

find . \( -name \*.cmake -o -name CMakeLists.txt \)

Changes will be submitted as a single patch file with all changes.  Be sure to compile successfully before and after to make sure you preserve behavior.  See http://brlcad.org/wiki/Deuces on getting started. 

Uploaded Work
File name/URLFile sizeDate submitted
cmake.patch1.1 MBDecember 21 2012 00:52 UTC
cmake2.patch1.0 MBDecember 22 2012 02:25 UTC
cmake3.patch1.0 MBDecember 22 2012 20:06 UTC
Comments
javamonnon December 14 2012 00:08 UTCTask Claimed

I would like to work on this task.

Sean on December 14 2012 01:13 UTCTask Assigned

This task has been assigned to javamonn. You have 48 hours to complete this task, good luck!

javamonnon December 15 2012 20:13 UTCClaim Removed

The claim on this task has been removed, someone else can claim it now.

javamonnon December 19 2012 04:31 UTCTask Claimed

I would like to work on this task.

Sean on December 19 2012 04:45 UTCTask Assigned

This task has been assigned to javamonn. You have 48 hours to complete this task, good luck!

javamonnon December 19 2012 13:27 UTCA couple of questions:

When you say logic, I'm assuming you mean the actual control stuctures like "IF" and "WHILE", and not the logic contained within the conditional, like the "GREATER 10 AND..." Also, should all commands be lower case, or just the user defined macros?


Thanks for all the help,


Daniel

Sean on December 19 2012 16:05 UTCeverything

Everything that can be lowercase (except variables), should be lowercase.  I'm kinda ambivalent about the logic within the conditional but would lean towards it also being lowercase if cmake doesn't care.  Feel free to try just one file first and we can look if there are any exceptions.


Note that something like these might help:


http://www.cmake.org/pipermail/cmake/2008-May/021900.html  (emacs auto-cleanup)


http://www.cmake.org/pipermail/cmake/2008-May/021752.html  (shell script)


https://issues.itk.org/jira/browse/ITK-1474   (vim cleanup)


Be sure to make sure it compiles cleanly before changing anything, then making changes and making sure the compile still works.. ;)


 


 

javamonnon December 21 2012 00:52 UTCReady for review

The work on this task is ready to be reviewed.

javamonnon December 21 2012 00:55 UTCA couple notes:

I converted everything that I could to lower case. Arguements in cmake are case sensitive so I left them alone. All commands and macros,  both user defined and system were changed to lower case. Everything compiles fine on my end. Let me know if anything should be changed. 


Thanks,


Daniel

Melange on December 21 2012 04:45 UTCNo more Work can be submitted

Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.

Sean on December 21 2012 05:38 UTCimpressive

Hi Daniel, Impressive!  How'd you convert everything so quickly?  How long did it take?  It'll take a lil bit to verify a few things but it looks good on a quick read through.

Sean on December 21 2012 06:52 UTCfound a problem

I've found several problems in all the instances of ResolveCompilerPaths.cmake and FindTCL.cmake where an internal option was changed in case and is incorrect.  You should re-review the changes (yeah, all lines.. somewhat tedious) to make sure all are intentional, particularly the lines with MATCHES and REGEX on them.  If those two exist, it's possible there are others depending on what regexes you used to update the sources.


 

Sean on December 21 2012 06:52 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on December 21 2012 06:53 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

javamonnon December 22 2012 02:25 UTCReady for review

The work on this task is ready to be reviewed.

javamonnon December 22 2012 02:27 UTCFixed it...

Yeah, I saw that earlier, I wasn't sure if it was going to cause problems. I fixed it so those aren't edited anymore, which is how it should've been in the first place. I apologize about that. But yeah, regex's are perfect for this sort of task. Let me know if there are any other problems.


Thanks, 


Daniel

Erik on December 22 2012 13:15 UTCStill some left

a quick grep pass shows there're still a handful to be converted.


I used this command: (find . -name 'CMakeLists.txt' | grep -v '/src/other/' ; find misc/CMake -type f | grep -v '\.\(c\|in\)$') | xargs grep '^[^"#]*[A-Z][\t ]*('


So at least that set needs to be updated, there may be others not caught by that regex as well.

Erik on December 22 2012 13:15 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

javamonnon December 22 2012 20:07 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 23 2012 06:40 UTCTask Closed

Congratulations, this task has been completed successfully.