[cmake-developers] Adding custom namespaces to FindBoost

Chuck Atkins chuck.atkins at kitware.com
Wed Feb 12 15:56:11 EST 2014


Given the complicated nature of FindBoost and it's many many use cases, I'd
like to run this by the list for inclusion in to the FindBoost.cmake
module.  First let me preface this with the note that this patch maintains
100% backwards compatibility and will default to the current behaviour.
That being said, here's the patch.

Justification:
Often when using a private copy of boost you'll want to extract a small
subset and build it with a custom namespace instead of boost::.  This
generally involves a different name for the libraries as well.  This is
usually to remove any symbol conflicts either with external dependencies
also built with boost or with being used as a dependency in something else
that needs it's own version of boost.  Luckiliy, the boost distribution
contains a tool, bcp, to do all of this for you.  It will extract a subset
of boost, change it's namespace to one you specify, and rename the
libraries it builds accordingly.

Patch description:
The FindBoost module currently assumes all boost libraries will be named
boost_foo and currently will not find these renamed libraries.  This patch
ds a Boost_NAMESPACE option to allo myboost_foo to be found instead.

Patch attached

- Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140212/60f7d751/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-suport-for-custom-namespaces-in-FindBoost.patch
Type: text/x-patch
Size: 8165 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140212/60f7d751/attachment.bin>


More information about the cmake-developers mailing list