Boost logo

Boost-Build :

Subject: Re: [Boost-build] Understanding generated files / targets.
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-07-27 18:27:42


On 07/27/2014 12:42 PM, Tom wrote:
> I am trying to generate a C++ source (or header) file containing
> versioning information generated from 'git describe'. This has become
> necessary as we have moved to git and a branched development model and
> modifying a version file manually is a non-starter (due to conflicts
> on merg) in this development model. We will be driving the version
> number in binaries by tags in revision control.
> This is challenging mainly in that the generated file depends on state
> not known (or knowable) by Boost.Build as opposed to a normal file
> transformation. This results in either not generating the file when
> it should be (a tag is checked out or a file is edited which do not
> affect the code handling the version number, then the build is run) or
> in rebuilding things when it is not actually necessary (which causes
> all tests to be re-run for example).
> I do also understand the 'notfile' rule and I don't think it applies.
> I am actually generating a real file, it just doesn't depend on any
> other sources.

If you can use the print module to generate the file,
then it automatically checks whether the content has
changed. (See b2 --help print for information on
how to use it)

In Christ,
Steven Watanabe

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at