> Hi everybody
>
> I'm creating python modules with boost, and I'm using bjam to compile them
> (because, as written in the doc, it is the easiest way to compile python
> module created with boost.python). Actually, my jam script is specific to my
> directory structure.
>
> If I want to change my directory structure, or shared my project with
> someone who haven't the same directory structure (which is always the case),
> my jam files need to be changed.
>
> My jam files are at the end of this post.
>
> I tried to use environment variables without success. If I create a
> BOOST_ROOT env var, I can't use it in my JamRoot file, because $(BOOST_DIR)
> is always empty.
Did you check Boost.Build documentation? See:
http://www.boost.org/boost-build2/doc/html/bbv2/faq/envar.html
- Volodya
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
How about complete 3rd party setup? What If I need to specify include path
library path, libraries to link with list and set of defines?
Gennadiy
>> http://www.boost.org/boost-build2/doc/html/bbv2/faq/envar.html
>>
>> - Volodya
>
> How about complete 3rd party setup? What If I need to specify include path
> library path, libraries to link with list and set of defines?
You'd need 4 environment variables and a lib target in our project that will
use those variables to define things. Alternatively, you can declare a library
target in user-config.jam, something like this:
project user-config ;
lib third_party
: # sources
: # requirements
<name>third_party <search>some-library-path
: # default build
: # usage requirements
<include>some-include-path <define>some-define
;
and you can refer to this from your project using
/user-config//third_party
notation. More complex, but unlimately best approach is creating
file third_party.jam, with the following content:
project.initialize $(__name__) ;
project third_party ;
rule init ( name : library-path : include-path : defines * )
{
lib third_party
: # sources
: # requirements
<name>$(name) <search>$(library-path)
: # default build
: # usage requirements
<include>$(include-path) <define>$(defines)
;
}
and add
using third_party : .... ;
to user-config.jam and refer to this library as
/third_party//third_party
The last approach is better because the 'init' rule can do smart things --
like adding some defines automatically, or accepting just 'install root'
and computing library paths and includes paths from that, etc.
Does this answer your question?
- Volodya
Gennadiy Rozental wrote:
>> http://www.boost.org/boost-build2/doc/html/bbv2/faq/envar.html
>>
>> - Volodya
>
> How about complete 3rd party setup? What If I need to specify include path
> library path, libraries to link with list and set of defines?
...
Does this answer your question?
On Fri, Oct 3, 2008 at 2:36 AM, Vladimir Prus <vlad...@codesourcery.com> wrote:
> notation. More complex, but unlimately best approach is creating
> file third_party.jam, with the following content:
> project.initialize $(__name__) ;
> project third_party ;
> rule init ( name : library-path : include-path : defines * )
> {
> lib third_party
> : # sources
> : # requirements
> <name>$(name) <search>$(library-path)
> : # default build
> : # usage requirements
> <include>$(include-path) <define>$(defines)
> ;
> }
> and add
> using third_party : .... ;
Thanks for the example on how to initialize standalone 3rd party
projects. Base on the comments in project.jam I eventually figured
out how to do it myself although slightly less elegant and without
'using'.
I'm just wondering is there somewhere a cookbook style set of examples
of how various things can be done using boost build (something beyond
the included examples with boost build that is). I really like boost
build, it solves a lot of problems for me out of the box which I
previously had with other make replacements but the documentation is
sometimes a bit brief.
Also is there somewhere a document which gives an overview of some of
the design ideas behind boost build?
Thanks,
Sebastian
> > How about complete 3rd party setup? What If I need to specify include path
> > library path, libraries to link with list and set of defines?
>
> You'd need 4 environment variables and a lib target in our project that will
> use those variables to define things.
I've got only one "unknown" - env var 3RD_PARTY_LIB_HOME. The rest is deducible.
The list of libs to link with and list of defines I know.
> Alternatively, you can declare a library
> target in user-config.jam, something like this:
I don't think user-config is an option here. I need to setup my Jamfile so that
user only need to set 1 env var for it to work.
> project user-config ;
>
> lib third_party
> : # sources
> : # requirements
> <name>third_party <search>some-library-path
> : # default build
> : # usage requirements
> <include>some-include-path <define>some-define
> ;
How do I list all the libraries to link with? Some static some dynamic.
> and you can refer to this from your project using
>
> /user-config//third_party
>
> notation. More complex, but unlimately best approach is creating
> file third_party.jam, with the following content:
Can I put this file along with my own Jamfile? How will I refer to it?
[...]
> The last approach is better because the 'init' rule can do smart things --
> like adding some defines automatically, or accepting just 'install root'
> and computing library paths and includes paths from that, etc.
Why Can't I do a deduction in regular lib rule? in most cases it's just simple
$(HOME)/include and $(HOME)/lib
Gennadiy
There was something on boost wiki, but I'm not sure it has much. At this
point, things like above can probably go into main documentation.
> Also is there somewhere a document which gives an overview of some of
> the design ideas behind boost build?
(Re)writing overview section of the doc is on my todo list, very close to the
top -- it seems like documentation starts to become the most critical part
of boost.build.
- Volodya