Boost logo

Boost-Build :

Subject: [Boost-build] Write output of command to file in directory with Jamfile
From: SZALAY Mate (matbbml_at_[hidden])
Date: 2011-09-25 08:30:52


The problem I'm trying to solve is to write the output of the
"svnversion" command to a file.
I want ot update the fine only if the content would change.

I started along these lines:

What I've come up with is this:


cur_ver = [ SHELL "echo '#define SVN_VERSION \"'`svnversion ..`'\"'" ] ;
old_ver = [ SHELL "cat svn_version.h" ] ;
if $(cur_ver) != $(old_ver)
  import notfile ;
  notfile write_svn_version : @write_svn_version_action ;
  actions write_svn_version_action
    echo '#define SVN_VERSION "'`svnversion ..`'"' >svn_version.h
  alias write_svn_version ;


This works as long as I'm running it from the directory containing the
Jamfile (like: $ bjam).
The problem is that I want to depend on this target from several other
projects. I want to do things like:

exe myexe :
  [other deps]

If I try to do this, build_info does the svnversion on the directory
where I run bjam from.
I want it to do build the build_info target from the directory where the
target is ("common" in this case).

Is there a way to specify it?
Another solution would be if I could get the full path of the directory
containing the Jamfile with the build_info target.



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