Boost logo

Boost-Build :

Subject: Re: [Boost-build] Copy file to output directory
From: Ian Emmons (iemmons_at_[hidden])
Date: 2011-04-04 17:20:14


Here is the solution that I used, which may not be as correct, but it's less verbose and it works:

   import common ;

   make FileToCopy.txt : ./FileToCopy.txt : @common.copy ;

That will always copy the file. If the file is only needed by some other target, you can do this:

   import common ;

   explicit FileToCopy.txt ;
   make FileToCopy.txt : ./FileToCopy.txt : @common.copy ;

Then in that other target's build requirements (in my case it's a unit-test target), add this:

   <dependency>FileToCopy.txt

Cheers,

Ian

On Apr 4, 2011, at 4:27 PM, Gevorg Voskanyan wrote:
> sichent wrote:
>> Hello boost build users,
>>
>> maybe someone could please help me, I need to copy the file from source
>> directory (where Jamfile is located) to output directory (where binary is
>> finally built to).
>>
>> Seems quite simple but I am unable to find out the way to specify the output
>> directory as it depends on build variant, address mode and so on.
>>
>> Thanks in advance,
>> sich
>
>
> # WARNING: untested, typed directly in e-mail client
>
> install install-file : file.txt :
> <variant>debug,<address-model>32:<location>bin_debug32
>
> <variant>release,<address-model>32:<location>bin_release32 ; #etc.
>
> , which won't quite work yet unless address-model is set explicitly, or:
>
> install install-file : file.txt : <conditional>@file-install-location ;
>
> import property-set ;
>
> rule file-install-location ( properties * )
> {
> local ps = [ property-set.create $(properties) ] ;
> local variant = [ $(ps).get <variant> ] ;
> local addr-model = [ $(ps).get <address-model> ] ;
> addr-model ?= 32 ; # if <address-model>32 is assumed by default
> return <location>bin_$(variant)$(addr-model) ;
> }
>
> HTH,
> Gevorg
> _______________________________________________
> 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