Boost logo

Boost-Build :

Subject: [Boost-build] Building an executable, then running it
From: k h (xerceslist.kh_at_[hidden])
Date: 2010-01-22 18:11:03


I would like to compute a tag so it would contain the current version of the
library being built. The version is in a C++ header, so I thought I could:

i) build an executable that prints the version
ii) run it
iii) use the output to determine the tag

The following bjam file will print the version correctly the *second* time
it is run. The first time it says "sh: tmp/showversion: No such file or
directory", then proceeds to build and install tmp/showversion. What am I
doing wrong please? Many thanks.

exe showversion : showversion.cpp : <include>$(BOOST_INCLUDE) ;

install tmp : showversion ;

DEPENDS version : tmp/showversion

rule version ( )
{
    return [ SHELL tmp/showversion ] ;
}

echo [ version ] ;



Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk