[CMake] FindBoost.cmake updated on the bugtracker

Mike Jackson imikejackson at gmail.com
Sat Apr 12 11:18:31 EDT 2008


Ok. I downloaded the latest CMake nightly (2.7-20080412) and gave this
FindBoost a shot with a MinGW current Stable release, which is I think
3.14, at least according to the _mingw.h file.

It didn't work. Here are the changes. Sorry, but I don't have a decent
diff generator on this windows box so you will have to merge stuff in:

Around line 347:
  IF (MINGW)
    EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
        ARGS --version
        OUTPUT_VARIABLE _boost_COMPILER_VERSION
    )
    STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9] .*" "\\1\\2"
           _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
    SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
  ENDIF(MINGW)

This is because Boost throws in the GCC version.

Next around line 385:
  SET( _boost_STATIC_TAG "")
  IF (WIN32)
    IF (MSVC)
        SET (_boost_ABI_TAG "g")
    ENDIF (MSVC)
    IF( Boost_USE_STATIC_LIBS )
      SET( _boost_STATIC_TAG "-s")
    ENDIF( Boost_USE_STATIC_LIBS )
  ENDIF(WIN32)
  SET (_boost_ABI_TAG "${_boost_ABI_TAG}d")

It seems that only MSVC uses the "g" ABI tag, at least that is what I
found through trial and error on my system.

Adding these changes results in the FindBoost.cmake looking for
libraries of the form:
#-- Release
libboost_filesystem-mgw34-mt-1_34_1
libboost_filesystem-mgw34-mt-s-1_34_1
libboost_filesystem-mt
libboost_filesystem-mt-s
libboost_filesystem
#-- Debug
libboost_filesystem-mgw34-mt-d-1_34_1
libboost_filesystem-mgw34-mt-sd-1_34_1
libboost_filesystem-mt-d
libboost_filesystem-mt-sd
libboost_filesystem-d

Which correspond to what is on my system, at least for the static case.

Someone want to put these changes into this? I also added these notes
to the bug tracker.

----
Thanks
Mike Jackson

On Sat, Apr 12, 2008 at 4:07 AM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 11.04.08 11:24:11, Doug Gregor wrote:
> > On Wed, Apr 9, 2008 at 5:51 AM, Andreas Pakulat <apaku at gmx.de> wrote:
> > >  Did so and of course a few small changes where needed :) I'll attach a
> > >  diff of those needed changes. With those changes cmake properly finds
> > >  the static libs if I provide the Boost_USE_STATIC_LIBS and it finds the
> > >  import libraries for the .dll's if I don't provide it (which I assume is
> > >  the right thing). It also properly finds debug vs. release versions of
> > >  the libraries.
> >
> > With these changes, things have been working very well for me on both
> > Mac and Windows.
>
> Good. Thanks for the testing.
>
> > >  If you need a test with MinGW too that will take a bit as I'll have to
> > >  set that up and compile boost first for that (not sure if its even
> > >  supported from boost's side).
> >
> > IIRC, Boost works with MinGW, but we don't put much effort into
> > testing or maintaining it.
>
> <personal opinion>
> My experience with MinGW so far is that its simply not ready yet for
> projects such as boost or KDE, they still need some time. Thats why
> I won't do work on getting KDevelop4 working on MinGW - at least not
> without someone paying for it.
> </personal opinion>
>
> > Frankly, I think we should put this new FindBoost into 2.6.0, assuming
> > there's another RC. I'm attaching the latest version (only typo fixes
> > from the diff Andreas sent out).
>
> If it gets into 2.6.0 that would be awesome. It would mean that this
> module could be dropped from KDE4 as soon as it depends on CMake 2.6
> (probably with KDE 4.2).
>
> Andreas
>
> --
> You will probably marry after a very brief courtship.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Mike Jackson
imikejackson _at_ gee-mail dot com


More information about the CMake mailing list