[CMake] Boost system library

Philip Lowman philip at yhbt.com
Thu Mar 12 21:55:15 EDT 2009


On Thu, Mar 12, 2009 at 7:39 PM, Bart Janssens <bart.janssens at lid.kviv.be>wrote:

> Not sure if this ever came up, but I'm struggling with FindBoost and
> the boost system library. The system library is required from boost
> 1.35 onwards, but doesn't exist in earlier versions. Is there a way to
> make CMake only look for the system library if the boost version is
> greater than or equal to 1.35? I'm using CMake 2.6.1.


I've never seen this come up before but you do have a good point about the
System library refactoring causing some people a bit of heartache here.

I've logged a bug report for it here.  I'm pretty sure the best fix would be
to get FindBoost to ignore the system component when it's detected a version
less than 1.35.  I've attached a new FindBoost.cmake to the bug report which
does this, if you could give it a shot?

http://public.kitware.com/Bug/view.php?id=8734




P.S.

A crappier workaround might be to do something like this.  This probably
will fail initially and the user could toggle the option and I think it
would start working on the second configure... kinda sucky though.

OPTION(I_AM_USING_OLDER_BOOST "Set to true if using Boost 1.35" OFF)
IF(I_AM_USING_OLDER_BOOST)
   find_package(Boost 1.30 REQUIRED filesystem)
ELSE()
   find_package(Boost 1.35 REQUIRED filesystem system)
ENDIF()

There might be other ways of faking out FindBoost as well by poking around
with advanced cache variables it relies upon.

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090312/8451f07e/attachment.htm>


More information about the CMake mailing list