Boost logo

Boost-Build :

Subject: Re: [Boost-build] make rule with extra variables + figuring out the full target path
From: Will Hagen (willard.hagen_at_[hidden])
Date: 2010-02-09 20:30:03


I was using eclipse and I could not find where to put the library path.  I put it in the library folder.  However, one of my co-workers found that it needs to go in the directory folder as well.  This seems to have solved the issue.

Thanks

--- On Mon, 2/8/10, Vladimir Prus <ghost_at_[hidden]> wrote:

From: Vladimir Prus <ghost_at_[hidden]>
Subject: Re: [Boost-build] make rule with extra variables + figuring out the full target path
To: "Boost.Build developer's and user's list" <boost-build_at_[hidden]>
Date: Monday, February 8, 2010, 10:07 PM

On Friday 05 February 2010 00:44:50 Fadi Beyrouti wrote:

> Hello,
>
> I am using the make rule in the following fashion:
>
>     make my_target_file :
>         my_source_file :
>         @my_action :
>         <location>"dir1/dir2/dir3" ;
>
> actions my_action
> {
>     my_command "$(>)" "$(<)"
> }
>
> However, I would like to introduce an extra variable to include in the command.
> For example:
>
> actions my_action
> {
>     my_command "$(>)" "$(<)" $(EXTRA_VAR)
> }
>
> In order to do that I thought of doing the following after the make statement:
>
> $(EXTRA_VAR) on my_target_file = "SOME VALUE" ;

Let me first explain why this is not working. First, you have a mechanical error.
The thing before "on" should be a variable name. $(EXTRA_VAR) returns a variable
value -- empty at this point. Second, my_target_file would be OK in pure classic
Jam. In Boost.Build, the target passed to 'my_action' has additional decoration
to include the target path, build properties and other things, so it's not just
'my_target_file'.

>
> however, this is not working since I am not able to retrieve the correct path of
> my_target_file. My questions are:
>
> 1. Is there a way to get that path?
> 2. Is there a better/cleaner way of doing what I want to do?

Does it work if you add

    constant EXTRA_VAR : SOME_VALUE ;

somewhere in your Jamfile? In fact, even

    EXTRA_VAR = SOME_VALUE ;

will work, but 'constant' are inherited by child Jamfiles, so is better.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build



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