Boost logo

Boost-Build :

Subject: Re: [Boost-build] Copy previous build target into current unit test directory
From: Chambers, Matthew (matt.chambers42_at_[hidden])
Date: 2017-08-01 15:55:32


Hi Steven,

I am in a similar situation as the OP. I have a unit-test but don't see an obvious way to copy my lib target's output to the unit-test
directory. I dug back through the archives and found this post as the closest explanation of how to do what I want without making deeper
modifications to Boost.Build.

The lib is a SQLite extension (shared object or DLL), so the unit test needs to know the path to it to load it (and I'd rather avoid the
complexity of changing to a run target and passing the lib target as an input file). This would apply to dynamic plugin systems in general,
too. Where do I put the @common.copy to get the lib copied? Do I have to convert the lib target to a make target, or is the `make mylib.dll`
below supposed to be in addition to an implied `lib mylib` target?

Thanks,
-Matt

On 3/31/2014 2:18 PM, Steven Watanabe wrote:
> AMDG
>
> On 03/31/2014 11:41 AM, tr1gun wrote:
>> i need to load a build com dll with an embedded manifest in a unit test.
>> The manifest loading requires the dll in the same directory as the build
>> unit test exe.
>> Is it possible to copy the build dll and another manifest file into the
>> created unit test directory?
>>
> Copying files is easy. Just use make with common.copy.
> The problem is knowing the destination directory.
> The easiest way is to use the unit-test rule instead
> of run and use common.copy without an explicit <location>.
> This will create a copy of the file in the build directory.
> To handle run, you need to set <location-prefix> to
> match the run rule. Actually getting this safely
> is a bit painful, unless you're willing to rely on
> knowing that testing.jam uses <location-prefix>$(target-name).test
>
> local target = [ run test.cpp : : : <dependency>mylib.dll ] ;
> local properties = [ $(target).requirements ] ;
> local location-prefix = [ $(properties).get <location-prefix> ] ;
> make mylib.dll : source-of-mylib : @common.copy :
> <location-prefix>$(location-prefix) ;
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> 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