Re: Changed (wrong?) behavior with make/common.copy in master

"Chambers, Matthew via Boost-build" <[email protected]>
Newsgroups gmane.comp.lib.boost.build
Message-ID <[email protected]>

On 7/7/2018 12:17 AM, Steven Watanabe via Boost-build wrote:
>> Thanks for the quick answer Steven. There's aspect of the old behavior I
>> haven't been able to reproduce:
>>
>> If I make a target depend on copied.txt from a different project
>> (directory), how do I get the copied.txt's <location> to be based on the
>> dependent target rather than the path components of the project that
>> copied.txt is defined in?
>>
>    I'm not sure I understand what you're trying to do
> here.  I realize that sometimes files may need to be
> in the same directory, but if the dependent target is
> in a different project, then that automatically means
> that you get different build directories.

OK, a more complete example:

    src/Jamfile:

    make copied.txt : others/others.txt : common.copy ;
    exe foo : foo.cpp : <dependency>copied.txt ;

    tests/Jamfile:
    run testfoo testfoo.cpp : input.txt : : <dependency>../src//foo <dependency>../src//copied ;

Suppose in order for foo and testfoo to run, they need to have copied.txt in the same directory as the executable. For foo, I can do that by 
making it depend on a compiled target, like:

    src/Jamfile:
    obj foo_o : foo.cpp ;
    make copied.txt : others/others.txt : common.copy : <dependency>foo_o ;
    exe foo : foo_o : <dependency>copied.txt ;

Annoying, but better than <relevant>[every single feature that can go in a build path]. But how can I do the same for testfoo? Is there a 
shortcut like <relevant>all ? Or can that be implemented easily?

Thanks,
-Matt

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.