Boost logo

Boost Interest :

Subject: Re: [Boost-cmake] RFC: exported targets
From: troy d. straszheim (troy_at_[hidden])
Date: 2009-10-29 16:03:01


Brad King wrote:
> troy d. straszheim wrote:
>> Michael Jackson wrote:
>>> This is THE SINGLE IMPROVEMENT someone could make for those of us
>>> using CMake and are dependent on the boost libraries.
>> I did some work on this. CMake exported targets are really cool. This
>> doesn't solve the entire FindBoost.cmake problem, but it is easy.
>>
>> http://sodium.resophonic.com/boost-cmake/current-docs/exported_targets.html
>
> More documentation appears here:
>
> http://www.cmake.org/Wiki/CMake_2.6_Notes
>
> Of particular interest is the install(EXPORT) feature. It does for
> install trees what the export() command does for build trees.
>

Yes. This is a great cmake feature. Boost.CMake now uses this to
install a $PREFIX/lib/Boost.cmake file. So if you happen to know where
your boost is, you can make use of it with the same code whether your
tree is installed or not. One thing I noticed: if you link to
boost_threads-mt-shared, for instance, with the installed exports you
automagically get -pthread and friends, but with the noninstalled
exports you don't. Is this expected?

-t


Boost-cmake 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