[CMake] FindBoost.cmake oddities

Andreas Pakulat apaku at gmx.de
Thu Dec 11 14:00:28 EST 2008


On 11.12.08 13:42:38, Mike Jackson wrote:
>
>
> Andreas Pakulat wrote:
>> On 11.12.08 11:38:38, Mike Jackson wrote:
>>> Up a bit further I see the culprit:
>>>
>>>   IF ( WIN32 AND Boost_USE_STATIC_LIBS )
>>>     SET (Boost_LIB_PREFIX "lib")
>>>   ENDIF ( WIN32 AND Boost_USE_STATIC_LIBS )
>>>
>>> So I guess I need some logic in my own cmake files that says if Boost 
>>>  was NOT found, set Boost_USE_STATIC_LIBS to TRUE and try again, only 
>>> if  we are on Win32. I am sure I am missing something simple...
>>
>> The problem is with mixed boost installations, i.e. you have shared and
>> static libs. If you have that there's no way to force cmake into finding
>> the static version other than changing the suffix variable as cmake will
>> always prefer shared over static libraries.
>>
>> I'm not sure about the lib prefix above, it might be that this is only
>> really needed for mingw and not for VS.
>
> I think it is only needed for msvc. MinGW uses the more unix way (I  
> think) of naming libraries. libFoo.so?

No it doesn't, it cannot decide how to do this, because it doesn't have
control over the runtime lookup of things. So mingw produces foo.dll (or
was ist libfoo, can't recall) for shared libraries, a libfoo.dll.a as
import library and if you want that a libfoo.lib as static library

Andreas

-- 
You will remember something that you should not have forgotten.


More information about the CMake mailing list