Boost logo

Boost Users :

Subject: Re: [Boost-users] autoconf/automake and boost
From: Riccardo Murri (riccardo.murri_at_[hidden])
Date: 2012-09-26 09:36:32


On Tue, Sep 25, 2012 at 11:55 PM, ilya shlyakhter <ilyawebmail_at_[hidden]> wrote:
> Can you point me to instructions for specifying dependency on Boost in
> an autoconf/automake project? I'd like the configure script to have
> an option --with-boost=... to point to a Boost installation, to specify a minimum
> required Boost version, and to require the presence of particular
> Boost libraries.

I use Tsuna's `boost.m4`, which allows you to do what you want with
code like the following:

    # check for needed Boost libraries
    BOOST_REQUIRE([1.45])
    BOOST_STATIC
    BOOST_SERIALIZATION
    BOOST_STATICASSERT
    BOOST_TEST([],
        [have_boost_test=no;
            AC_MSG_WARN([Could not find a usable Boost.Test library;
not compiling test programs.])],
        [have_boost_test=yes])
    AM_CONDITIONAL([HAVE_BOOST_TEST], [test "_$have_boost_test" = '_yes'])

You can download `boost.m4` from its Guthub repo:
https://github.com/tsuna/boost.m4

Cheers,
Riccardo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net