[CMake] Problems with FindBoost.cmake

Christian Henning chhenning at gmail.com
Tue Jul 31 09:45:38 EDT 2012


Hi Steve,

I think you got me a step further. Thanks. See below:

On Mon, Jul 30, 2012 at 9:11 PM, Steve deRosier <derosier at gmail.com> wrote:
> On Mon, Jul 30, 2012 at 5:44 PM, Christian Henning <chhenning at gmail.com> wrote:
>> Hi there, I'm trying to figure why cmake cannot find my boost
>> installation. Actually, I'm working of some outdated boost's trunk
> ...
>> Can someone spot the problem? For instance I'm not 100% sure what the
>> BOOST_LIBRARYDIR is suppose to point to? Is it the binaries or the cpp
>> files?
>>
>
>
> BOOST_LIBRARY_DIR would point to the location of the built binaries.
> Typically /usr/local/lib if you built boost and did an install on
> Linux or Mac.

Got that!

>
> The biggest problem I had was making sure that the following variables
> are set right:
> set(Boost_USE_STATIC_LIBS        ON)
> set(Boost_USE_MULTITHREADED      ON)
> set(Boost_USE_STATIC_RUNTIME     ON)
>
> FindBoost looks at the filename sufixes of the libraries, like
> *-mt-d-1_49.a to match on and choose the right one.  Also, in more
> extreem cases, sometimes you need to specify the Boost_COMPILER if the
> compiler name is part of the suffix and cmake can't just get it right:

I think that's where the problem lies. The name of my binaries are like:

libboost_thread-vc100-mt-1_50.lib or libboost_thread-vc100-mt-gd-1_50.lib

and I believe that findboost.cmake cannot find names like that. So I
set all the BOOST_USE_XXX flags and now internally I get

_boost_COMPILER = -vc100
_boost_MULTITHREADED = -mt
_boost_RELEASE_ABI_TAG = -s
_boost_DEBUG_ABI_TAG = -sgd

I have no idea where the 's' in the ABI_TAGs is coming from? Is there
a way to change those tags?

I'm building boost like this:

bjam -j4 --toolset=msvc --without-mpi variant=debug link=static
runtime-link=shared define=_CRT_NONSTDC_NO_DEPRECATE
define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE stage

Thanks again,
Christian


More information about the CMake mailing list