[CMake] Building a Version Header
Blezek.Daniel at mayo.edu
Thu Jul 8 16:34:58 EDT 2010
One alternative is to use git itself. There is a "git smudge" option that
can do much of what you are asking. However, I've never done this sort of
On 7/8/10 3:31 PM, "Tyler Roscoe" <tyler at cryptio.net> wrote:
> On Wed, Jul 07, 2010 at 10:43:15PM -0400, John Drescher wrote:
>> On Wed, Jul 7, 2010 at 9:44 PM, Clark Gaebel <cg.wowus.cg at gmail.com> wrote:
>>> I would like to generate file that looks something like this:
>>> // version.h
>>> #define VERSION "v0.1-345-ga77ede8"
>> You want to do that with configure_file
> The upside of this approach is that it's simple. The downside is that it
> is only run (and thus your version header is only updated) whenever
> CMake runs. It's possible for the source code to change without
> triggering a re-run of CMake.
> Consequently, we use a custom command to call a python script at build
> time. The script writes out the header with the up-to-date version info.
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> Please keep messages on-topic and check the CMake FAQ at:
> Follow this link to subscribe/unsubscribe:
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center
P 127 or (77) 8 8886
T 507 538 8886
E blezek.daniel at mayo.edu
200 First St. S.W.
Rochester, MN 55905
More information about the CMake