Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2007-08-28 15:07:54


On Aug 28, 2007, at 2:56 PM, ope wrote:
> I've read http://svn.boost.org/trac/boost/wiki/CMakeAddExecutable and
> try to use it - and it doesn't work correct. This macros isn't used in
> the boost cmake build (in real there isn't a wave example as the web
> page promised)!
>

It's right here:

        http://svn.boost.org/trac/boost/browser/sandbox-branches/boost-cmake/
boost_1_34_0/tools/wave/CMakeLists.txt

boost_add_executable is used in several places throughout the Boost
CMake branch, including the regression testing.

> Anyway, I've got the linker error:
> /usr/bin/ld: cannot find -lboost_program_options-static
>
> It should look for libboost_program_options-gcc41-mt-1_34! The part
> responsible is at tools/build/CMake/BoostCore.cmake:
>
> else (LIB MATCHES ".*-.*")
> # The user has given the name of just the library target,
> # e.g., "boost_filesystem". We add on the appropriate variant
> # name(s).
> list(APPEND THIS_EXE_ACTUAL_DEPENDS "${LIB}$
> {VARIANT_TARGET_NAME}")
> list(APPEND THIS_EXE_RELEASE_ACTUAL_DEPENDS
> "${LIB}${RELEASE_VARIANT_TARGET_NAME}")
> list(APPEND THIS_EXE_DEBUG_ACTUAL_DEPENDS
> "${LIB}${DEBUG_VARIANT_TARGET_NAME}")
> endif (LIB MATCHES ".*-.*")
>
> using:
>
> boost_add_executable(...
> DEPENDS boost_program_options-gcc41-mt-1_34 ...
> )
>
> works!
>
> Did I something wrong or is there an error inside boost's
> BoostConfig.cmake?

It sounds like an error in the Boost CMake code. A few quick questions:
        - Are you using the latest from https://svn.boost.org/svn/boost/
sandbox-branches/boost-cmake/boost_1_34_0 ?
        - Which version of CMake are you using?
        - Do you recall which CMake options you changed?

The Boost CMake work is still in a rather preliminary state, but it
typically builds Boost out of the box without this kind of problem.

        - Doug


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net