<html><head>
<meta name="Generator" content="MS Exchange Server version 6.5.7653.38"><title>CMake generated build number?</title></head><body><div><font size="2"></font> Hi,<br>
<br>
Just a thought: Why don't you use the date and time? The compiler can provide those for you. We use
two static functions for this:<br>
const char *GetBuildDate ()<br>
{<br>
return __DATE__;<br>
}<br>
<br>
const char *GetBuildTime ()<br>
{<br>
return __TIME__;<br>
}<br>
<br>
Of course if you don't do a clean build, then the date and time won't get updated. In the past we
used a different method, just passing the date and time through the compiler directly:<br>
gcc -D`date +"%Y%m%d %H%M%S"`<br>
<br>
Using the subversion revision number is also nice. For that, you could probably using the
"exec_program" command that executes "svn info". After that you'll need some regex magic to
retrieve the revision number from that.<br>
<br>
best,<br>
Jeroen<br>
<br>
Leiden University Medical Center<br>
</div><br><div class="OutlookMessageHeader" dir="ltr" align="left" lang="en-us"> <hr tabindex="-1"> <font face="Tahoma" size="2"> <b>From:</b> cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org] <b>On Behalf Of </b> Blezek, Daniel J.<br> <b>Sent:</b> Wednesday, November 05, 2008 3:00 PM<br> <b>To:</b> cmake@cmake.org<br> <b>Subject:</b> [CMake] CMake generated build number?<br> </font><br></div><div></div>
<!-- Converted from text/rtf format -->
<p><font face="Arial" size="2">Hi,</font>
</p>
<p><font face="Arial" size="2"> I'd like to have a monotonically increasing "build number" auto
generated by CMake. This would be for official builds of the software, so we could track algorithm
changes / results. I'd also be happy if CMake could pull the latest SVN revision number. This
would go in a -D during the build.</font></p>
<p><font face="Arial" size="2">Any clues how to do this?</font>
</p>
<p><font face="Arial" size="2">Thanks,</font>
<br><font face="Arial" size="2">-dan</font>
</p>
<p><b><font face="Arial" size="2">Daniel Blezek, PhD</font></b>
<br><font face="Arial" size="2">Medical Imaging Informatics Innovation Center</font>
</p>
<p><font face="Arial" size="2">P 127 or (77) 8 8886</font>
<br><font face="Arial" size="2">T 507 538 8886</font>
<br><font face="Arial" size="2">E blezek.daniel@mayo.edu</font>
</p>
<p><font face="Arial" size="2">Mayo Clinic</font>
<br><font face="Arial" size="2">200 First St. S.W.</font>
<br><font face="Arial" size="2">Harwick SL-44</font>
<br><font face="Arial" size="2">Rochester, MN 55905</font>
<br><font face="Arial" size="2">mayoclinic.org</font>
</p>
</body></html>