Generate txt file from b2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Generate txt file from b2

Boost - Build mailing list
Hi,

I have a library that builds with Boost.Build. The build output format
is "tagged", so the generated binaries look something like this:
`binaryname_version_compiler.ext`

What I'd like to achieve now, is to write the version number (which is
readily available in the Jamfile) into a newly generated text file
`version.txt`. In fact, preferably I would like to have a template file
and just replace the version number part in that template.

I've read about custom commands but as far as I understand these are all
external programs of some form that are called by b2. So to build the
library on different platforms I would have to add different platform
specific tools or install the same scripting engine on all platforms.

So is there some way to make b2 generate text files without resorting to
external tools to make this trivially portable across platforms
(assuming the same version of Boost.Build on all those platforms)?

thanks,
Norbert
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generate txt file from b2

Boost - Build mailing list
AMDG

On 06/18/2017 01:14 AM, Norbert Wenzel via Boost-build wrote:
>
> So is there some way to make b2 generate text files without resorting to
> external tools to make this trivially portable across platforms
> (assuming the same version of Boost.Build on all those platforms)?
>

Use the print module to define the action.

You can find an example here:
https://github.com/boostorg/build/blob/develop/src/tools/boostbook.jam#L531

It looks like the documentation doesn't show anything
about this, but there's some internal documentation
(accessible via `b2 --help print`).  The rules you'll
need are print.output and print.text.

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generate txt file from b2

Boost - Build mailing list
On 06/19/2017 05:56 PM, Steven Watanabe via Boost-build wrote:
> On 06/18/2017 01:14 AM, Norbert Wenzel via Boost-build wrote:
>> So is there some way to make b2 generate text files without resorting to
>> external tools to make this trivially portable across platforms
>> (assuming the same version of Boost.Build on all those platforms)?
>
> Use the print module to define the action.

Thank you. I will read the documentation and examples you posted.

Norbert
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Loading...