[C++-sig] Re: bjam help for embedding

David Abrahams dave at boost-consulting.com
Sun Dec 29 16:49:43 CET 2002

Dirk Gerrits <dirk at gerrits.homeip.net> writes:

> wtrenker at hotmail.com wrote:
>  > I've been experimenting with Dirk's embedding.cpp and have
>  > created my own stand-alone test program but don't know how
>  > to build it.  I'm getting lost figuring out how to make a
>  > Jamfile that builds an executable rather than an extension.
>  > A simple example would be greatly appreciated.
> Hi Bill,
> I haven't looking into creating a Jamfile for my little
> example yet. I just added the file to a MSVC project and
> built it from there. Perhaps you should look at
> /libs/python/test/Jamfile. I think that might give a clue.
> In any case, a template Jamfile for embedding would be a
> great addition to my embedding tutorial to help people like
> yourself. Let me know what you come up with.

Could've sworn I'd already posted this:

------ schnipp -------

subproject libs/python/user ;

# bring in the rules for python
SEARCH on python.jam = $(BOOST_BUILD_PATH) ;
include python.jam ;
# bring in rules for testing

exe embedding
  : #sources
     ../test/embedding.cpp <dll>../build/boost_python
  : # requirements
    <find-library>$(PYTHON_EMBEDDED_LIBRARY) ;

------ schnapp --------

of course if you want to build from outside the boost project tree
you'll need to remove <dll>../build/boost_python from the sources
section and add something like

   <find-library>boost_python <library-path>path-to-boost-python

to the requirements section.

                       David Abrahams
   dave at boost-consulting.com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

More information about the Cplusplus-sig mailing list