[CMake] Can't get Boost_${COMPONENT}_LIBRARY to work

Philip Lowman philip at yhbt.com
Mon Mar 2 22:50:59 EST 2009


On Mon, Mar 2, 2009 at 9:39 PM, E. Wing <ewmailing at gmail.com> wrote:

>
>> Also, one additional thing.  If you use Boost_LIBRARIES it will
>> automatically contain all of the libraries you specify after the COMPONENTS
>> line (including debug/optimized keywords).  This is often fine for many
>> Boost use-cases.  If it's not and you must link individually, the way you
>> were doing it should work fine, just make the components be UPPERCASE.
>>
>
> So I am building a sub-library (currently static) of a larger project. This
> sub-library only needs the date_time library of the components I listed. I
> don't have a strong opinion either way of whether I link to just date_time
> or the whole thing; it's just that the original Makefile I'm converting from
> singled this out. Do you feel that I'm better off using Boost_LIBRARIES?
>

If you're comfortable with maintaining the dependencies where they are
needed I would recommend doing it the way you were planning on and use
Boost_<COMPONENT>_LIBRARY, it also handles the debug/optimized links for
Visual Studio.  I only mentioned Boost_LIBRARIES so you knew it existed and
a partial theory as to why this documentation bug probably hasn't cropped up
on the mailing list before.  There actually are a couple of good reasons not
to use Boost_LIBRARIES (linking time would in theory be faster, if done
correctly you would know at a glance which libraries of yours depend on
which boost libraries).

That being said most people probably don't really care. :)

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090302/1c124942/attachment.htm>


More information about the CMake mailing list