Boost logo

Boost-Build :

Subject: Re: [Boost-build] Newbie: How to specify a command with relative path in jamfile?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-01-15 12:03:15


AMDG

On 01/14/2013 07:14 AM, Min Wang wrote:
> Hello,
>
> In boost build, we can create our own rule to translate file from one
> format to another, for example, my company has a file format ".pyr", we
> developed a tool called pyr_c to compile ".pyr" file into C++ code. I can
> use Jamfile to handle .pyr file by create a pyr.jam like:
> ---------------------------------
> ...
> type.register PYR : pyr ;
> ...
> generators.register [ new pyr-generator pyr.compile : PYR : CPP H ] ;
>
> actions compile
> {
> pyr_c --cpp_out=$(<[0]:D) $(>)
> }
> ---------------------------------
> It will work and process the .pyr file. But I have to put the pyr_c in a
> known place, such as /usr/local/bin, so that bjam can find it.
>
> If I want to build pyr_c from source code before use it in Jamfile, how to
> do it?
>

The easiest way is

path-constant PYR_C : path/to/pyr_c ;

...

actions compile
{
    $(PYR_C) ...
}

> The difficulty for me is: pyr_c will then sit in a place relative to the
> source code, it is not in PATH, nor can I use absolute path of it in
> Jamfile which may be different in other developer's machine.
>
> Can anyone help?
>

In Christ,
Steven Watanabe


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