<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
Am 08.07.2010 22:31, schrieb Tyler Roscoe:<br>
<span style="white-space: pre;">> On Wed, Jul 07, 2010 at
10:43:15PM -0400, John Drescher wrote:<br>
>> On Wed, Jul 7, 2010 at 9:44 PM, Clark Gaebel
<a class="moz-txt-link-rfc2396E" href="mailto:cg.wowus.cg@gmail.com"><cg.wowus.cg@gmail.com></a> wrote:<br>
>>> I would like to generate file that looks something like
this:<br>
>>><br>
>>> // version.h<br>
>>> #define VERSION "v0.1-345-ga77ede8"<br>
>><br>
>> You want to do that with configure_file<br>
><br>
> The upside of this approach is that it's simple. The downside is
that it<br>
> is only run (and thus your version header is only updated)
whenever<br>
> CMake runs. It's possible for the source code to change without<br>
> triggering a re-run of CMake.</span><br>
We use a custom command to check the SVN revision via a CMake script.<br>
I then let the target depend on this project. Within the script, the<br>
version header will only be updated if the revision actually changed.<br>
Thus, the target is recompiled if and only if the SVN revision
changed.<br>
<br>
Johannes<br>
<br>
</body>
</html>