On Fri, May 16, 2008 at 9:56 PM, Edson Tadeu <<a href="mailto:e.tadeu@gmail.com">e.tadeu@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
(Not even mentioning the indent style). It seems that there is a transition going on from uppercase to lowercase in the recent CMakeLists... I don't know what style to settle for my new CMakeLists.txt's, because if I use lowercase, to copy&paste from other projects would be a real pain... but maybe the projects will convert their CMakeLists to lowercase? A tool to automatically convert from uppercase commands to lowercase would help.</blockquote>
<div><br>I wrote this quick and dirty shell script which should work on most Unix systems and Cygwin but I obviously haven't tested it extensively so run with caution (i.e. backup first). Also you'll want to make sure that "cmake" version 2.6.0 or greater is in your path for it to work properly.<br>
<br>I'm sure someone that's out there who has the time could write this in CMake script to make it more portable. That would be a lot cooler actually, just add INCLUDE(convert_my_project_commands_to_lowercase) once, configure, and then you're done. =)<br>
<br>=====<br><br><br>#!/bin/sh<br>command_list=`cmake --help-command-list | grep -v 'cmake version '`<br><br>fix_case ()<br>{<br> LC_COMMAND=$1<br> UC_COMMAND=`echo $LC_COMMAND | tr '[a-z]' '[A-Z]'`<br>
echo "Replacing \"$UC_COMMAND\" with \"$LC_COMMAND\"..."<br> find . -name CMakeLists.txt -exec sed -i s/$UC_COMMAND\ *\(/$LC_COMMAND\(/ {} \;<br> find . -name \*.cmake -exec sed -i s/$UC_COMMAND\ *\(/$LC_COMMAND\(/ {} \;<br>
}<br><br>for command in $command_list<br>do<br> fix_case $command<br>done<br><br><br></div></div><br>-- <br>Philip Lowman