<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Please be VERY careful where you put such information. The itkVersion.h file is included in itkMacro.h which is included in just about every other itk header. If you change branches we do not want to have to rebuild all of ITK, and have our ccaches miss all the time.<div><br></div><div>Consider keeping the information only available at run time by encapsulating it in a cxx file, or a separate header filer, that is not included by each bit of ITK.</div><div><br></div><div>Brad<br><div><br></div><div><br><div><div>On Apr 25, 2012, at 3:15 PM, M Stauffer -V- wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Thanks Brad.<br><br>Is CMakeVersionSource.cmake run from cmake or as a cmake script from<br>makefiles (I'm assuming the latter is possible)? If the former, then am<br>I right in thinking that if the user has changed branches since running<br>cmake, then the commit version will be wrong? If such a cmake script<br>could be run from a makefile then the current commit and index status<br>would always be accurate.<br><br>What do you then do with the CMake_VERSION_SOURCE variable? I'm thinking<br>I'd write what I'm looking to produce to a header file that's included<br>itkVersion.h.<br><br>-M<br><br><blockquote type="cite">-----Original Message-----<br></blockquote><blockquote type="cite">From: Brad King [mailto:brad.king@kitware.com] <br></blockquote><blockquote type="cite">Sent: Wednesday, April 25, 2012 2:49 PM<br></blockquote><blockquote type="cite">To: M Stauffer -V-<br></blockquote><blockquote type="cite">Cc: <a href="mailto:insight-developers@itk.org">insight-developers@itk.org</a><br></blockquote><blockquote type="cite">Subject: Re: [Insight-developers] incorporating commit info<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Wed, Apr 25, 2012 at 2:16 PM, M Stauffer -V- <br></blockquote><blockquote type="cite"><<a href="mailto:mstauff@verizon.net">mstauff@verizon.net</a>> wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">During compilation, I'd like to be able to incorporate the <br></blockquote></blockquote><blockquote type="cite">commit hash<br></blockquote><blockquote type="cite"><blockquote type="cite">and at least a flag as to whether there are any local <br></blockquote></blockquote><blockquote type="cite">modifications. The<br></blockquote><blockquote type="cite"><blockquote type="cite">goal is to have this info in the itk binaries for reliably <br></blockquote></blockquote><blockquote type="cite">referencing<br></blockquote><blockquote type="cite"><blockquote type="cite">what version of the toolkit was used for a particularly build.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I hear this has been discussed before. I'm willing to give <br></blockquote></blockquote><blockquote type="cite">it a go. If<br></blockquote><blockquote type="cite"><blockquote type="cite">anyone knows the outline of how to do this that'll really <br></blockquote></blockquote><blockquote type="cite">help. I think<br></blockquote><blockquote type="cite"><blockquote type="cite">there are git hooks for getting commit info into a header file, but I<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">haven't looked recently. Also, we'll want to add something <br></blockquote></blockquote><blockquote type="cite">similar for<br></blockquote><blockquote type="cite"><blockquote type="cite">our ANTS toolkit, which currently is still using svn.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">FYI, we do this in CMake's own build:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CMakeVersio">http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CMakeVersio</a><br></blockquote>nSource.cmake;hb=v2.8.8<br><blockquote type="cite"><br></blockquote><blockquote type="cite">though the implementation pre-dates FindGit.cmake so it does not use<br></blockquote><blockquote type="cite">find_package(Git) as a new implementation should.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">It does require a Git command line tool to be found during CMake<br></blockquote><blockquote type="cite">configuration of the project though. To do that on Windows one should<br></blockquote><blockquote type="cite">use find_package(Git) and require CMake >= 2.8.2 to reliably find<br></blockquote><blockquote type="cite">msysGit.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">-Brad<br></blockquote><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-developers<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">========================================================</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Bradley Lowekamp<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Medical Science and Computing for</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Office of High Performance Computing and Communications</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">National Library of Medicine<span class="Apple-converted-space"> </span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; "><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>