This may or may not aid you

 

http://old.nabble.com/Beginner-problems---bjam-td21794467.html

 


From: boost-build-bounces@lists.boost.org [mailto:boost-build-bounces@lists.boost.org] On Behalf Of k h
Sent: 22 January 2010 23:11
To: Boost.Build developer's and user's list
Subject: [Boost-build] Building an executable, then running it

 

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 ] ;