[CMake] FindBoost.cmake: please test

Mike Jackson imikejackson at gmail.com
Sun Jan 20 10:57:57 EST 2008


On Jan 20, 2008, at 9:51 AM, Andreas Pakulat wrote:

> On 20.01.08 13:15:47, Hendrik Sattler wrote:
>> Am Sonntag 20 Januar 2008 schrieb Andreas Pakulat:
>>> On 20.01.08 11:15:33, Hendrik Sattler wrote:
>>>> http://www.boost.org/more/getting_started/windows.html#get-boost
>>>> (slightly wrong link in there) ->
>>>> http://www.boost-consulting.com/products/free
>>>>
>>>> That installer offers several variations.
>>>>
>>> :( That means I can't really look at the stuff myself. However  
>>> looking
>>>
>>> at the original project files for boost it seems those binaries  
>>> are not
>>> exactly the same as would be built with the boost sources. The MSVC7
>>> build files don't mention any "-s", only "-gd".
>>
>> -s simply means static according to the above pages. Is static  
>> linking to
>> boost not supported by the module?
>
> Unfortunately cmake doesn't allow to easily choose between static and
> shared library to link to. At least not when using find_library. (I've
> already filed a report about that). On *nix boost simply builds a .a
> file for a static library and apparently this is different with  
> MSVC on
> win32 where both types of library have the same filename extension.
>
> So on unix you have to remove the shared libs to have cmake find the
> static versions.
>
> One could add some hack to do s/.so/.a/ on the libraries, but IMHO it
> should rather be fixed in cmake than adding such ugly workarounds.
>
> Ok, I've got a new version, which hopefully supports the binary
> installation (it also has a couple of bugfixes I found when using a
> self-compiled boost). Please test.
>
> Andreas
>
>


Note also on windows the naming convention used:


These are for the dynamic library, debug, multi-threaded, dynamically  
linked to C++ Runtime
boost_filesystem-vc71-mt-gd-1_34_1.dll
boost_filesystem-vc71-mt-gd-1_34_1.lib

And this is for the static boost lib, but same as above. Note the  
addition of the prefix 'lib'
libboost_filesystem-vc71-mt-gd-1_34_1.lib

At least on windows, one can test for this prefix and decide what to  
do: Look for the dll or not.


-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services




More information about the CMake mailing list