<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>RE: [CMake] XML parsing ?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>&gt; I am wondering if it is currently possible using CMake to<BR>
&gt; parse an XML file...<BR>
&gt; I would like to include the SVN revision number in the target<BR>
&gt; name somehow, and I would need to get it from the .svn/entries<BR>
&gt; file I guess...<BR>
<BR>
Actually, you should not be parsing .svn/entries. Subversion comes<BR>
with a program named svnversion that will return the revision number of<BR>
a file or directory. You can use it from CMake like this:<BR>
<BR>
######<BR>
project( BOOJUM )<BR>
<BR>
find_program( SVNVERSION<BR>
&nbsp; svnversion<BR>
&nbsp; /usr/local/bin<BR>
&nbsp; /usr/bin<BR>
)<BR>
<BR>
macro( svn_repository_version DESTVAR TOPDIR )<BR>
&nbsp; exec_program( ${SVNVERSION} ${TOPDIR} ARGS &quot;.&quot; OUTPUT_VARIABLE ${DESTVAR} )<BR>
endmacro( svn_repository_version )<BR>
<BR>
svn_repository_version( SVNREV ${BOOJUM_SOURCE_DIR} )<BR>
<BR>
configure_file( version.h.in version.h )<BR>
<BR>
<BR>
######<BR>
and if version.h.in contains the line:<BR>
<BR>
&nbsp;&nbsp;&nbsp; #define BOOJUM_REVISION @SVNREV@<BR>
<BR>
then CMake will replace @SVNREV@ with the proper number when the file<BR>
is configured.<BR>
<BR>
&nbsp;&nbsp;&nbsp; David</FONT>
</P>

</BODY>
</HTML>