<!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>> I am wondering if it is currently possible using CMake to<BR>
> parse an XML file...<BR>
> I would like to include the SVN revision number in the target<BR>
> name somehow, and I would need to get it from the .svn/entries<BR>
> 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>
svnversion<BR>
/usr/local/bin<BR>
/usr/bin<BR>
)<BR>
<BR>
macro( svn_repository_version DESTVAR TOPDIR )<BR>
exec_program( ${SVNVERSION} ${TOPDIR} ARGS "." 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>
#define BOOJUM_REVISION @SVNREV@<BR>
<BR>
then CMake will replace @SVNREV@ with the proper number when the file<BR>
is configured.<BR>
<BR>
David</FONT>
</P>
</BODY>
</HTML>