On Fri, May 16, 2008 at 9:56 PM, Edson Tadeu &lt;<a href="mailto:e.tadeu@gmail.com">e.tadeu@gmail.com</a>&gt; 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;">
&nbsp; (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&#39;t know what style to settle for my new CMakeLists.txt&#39;s, because if I use lowercase, to copy&amp;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&#39;t tested it extensively so run with caution (i.e. backup first).&nbsp; Also you&#39;ll want to make sure that &quot;cmake&quot; version 2.6.0 or greater is in your path for it to work properly.<br>
<br>I&#39;m sure someone that&#39;s out there who has the time could write this in CMake script to make it more portable.&nbsp; That would be a lot cooler actually, just add INCLUDE(convert_my_project_commands_to_lowercase) once, configure, and then you&#39;re done. =)<br>
<br>=====<br><br><br>#!/bin/sh<br>command_list=`cmake --help-command-list | grep -v &#39;cmake version &#39;`<br><br>fix_case ()<br>{<br>&nbsp;&nbsp;&nbsp; LC_COMMAND=$1<br>&nbsp;&nbsp;&nbsp; UC_COMMAND=`echo $LC_COMMAND | tr &#39;[a-z]&#39; &#39;[A-Z]&#39;`<br>
&nbsp;&nbsp;&nbsp; echo &quot;Replacing \&quot;$UC_COMMAND\&quot; with \&quot;$LC_COMMAND\&quot;...&quot;<br>&nbsp;&nbsp;&nbsp; find . -name CMakeLists.txt -exec sed -i s/$UC_COMMAND\ *\(/$LC_COMMAND\(/ {} \;<br>&nbsp;&nbsp;&nbsp; find . -name \*.cmake&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -exec sed -i s/$UC_COMMAND\ *\(/$LC_COMMAND\(/ {} \;<br>
}<br><br>for command in $command_list<br>do<br>&nbsp;&nbsp;&nbsp; fix_case $command<br>done<br><br><br></div></div><br>-- <br>Philip Lowman