|
Boost-Build : |
From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-11-20 05:03:00
Mark,
you might find the following bjam code usefull. I use it to link to
the boost libraries. You use it like this, for example:
exe foo : foo.cpp : select-link-library-boost-thread ;
It automatically selects the right build variant and adds that to your
linker command line. You'll have to add another rule for regex but
this should be easy, I hope. Oh, and you probably have to adjust the
stage dir argument in the rules, it is needed to find the libs in the
boost source tree.
HTH, Markus
---%<---
rule select-link-library-boost ( name path variant_dir stage_dir )
{
local boost_root = $(BOOST_ROOT) ;
local full_name = [ join $(PRELIB) $(name) $(SUFLIB) ] ;
local full_path =
[
join-path $(boost_root) $(stage_dir) $(path) "build/bin"
$(full_name) $(variant_dir) $(full_name)
] ;
return <library-file>$(full_path) ;
}
rule select-link-library-boost-thread (
toolset variant : properties * )
{
return $(properties)
[
select-link-library-boost
"boost_thread" "libs/thread" $(properties[0]) "bin/"$(OS)
] ;
}
rule select-link-library-boost-unit-test-framework (
toolset variant : properties * )
{
return $(properties)
[
select-link-library-boost
"unit_test_framework" "libs/test" $(properties[0]) "bin/"$(OS)
] ;
}
--->%---
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