Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-10-20 04:54:32


Johan Nilsson wrote:

> How do I use deps/libs/cppunit(d).lib? I've managed to create the jamfile
> in deps/libs:
>
> lib cppunit
> :
> : <file>cppunit.lib <variant>release
> ;

> using it from libs/mylib/tests:
>
> -- Jamfile.v2 ---
> ...
> exe mylib_tests
> : # sources
> $(all_sources)
> //mylib
> ../../../deps/libs//cppunit <= !!!

> The above works, but I was merely wondering if I could make some global
> definition in the top-level Jamfile.v2 to reference the cppunit target
> without the path specification (similar to what I do with mylib above).

You can. Top level Jamfile could look like:

project my_project ;
alias cppunit : deps/libs//cppunit ;

and you'll be able to use "my_project//cppunit" in Jamfiles.

> While I'm at it, a few more related questions:
>
> - Is there a rule available to run the resulting mylib_tests.exe file from
> the above Jamfile?

Yes:
http://boost.org/boost-build2/doc/html/bbv2.advanced.builtins.targets.html#bbv2.builtins.testing

> - Can I specify the output directory of the .exe (it depends on a couple
> of .dlls located in the bin directory)?

No, at least now. You can use the "stage" rule in the meantime.

> - Can I set the output target name(s) to indicate debug/release version
> (e.g. mylib_tests_d.exe, mylib_d.exe)?

Sure, add

<variant>debug:<tag>_d <variant>release:<tag>_r

to target requirements. The "tag.py" test shows this.

>> > - Where did $(SUFLIB) et al go?
>>
>> It's 'type.set-generated-target-suffix'.
>
> Sorry, I'm perhaps a bit slow today, but how would I use that in e.g. the
> deps/libs/ Jamfile.v2 from above?

type.set-generated-target-suffix STATIC_LIB : : libbb ;

That would change the target used when V2 generates a static library -- this
is global setting.

But in "deps/libs" you probably want to recognize additional suffix, right.
Then, you can do:

type.register-suffixes foobar : STATIC_LIB ;

HTH,
Volodya

 


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