[CMake] FindBoost: FIND_PACKAGE ( Boost COMPONENTS filesystem )

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Nov 3 05:04:36 EST 2009


Hi Philip,

  That's where I stop understanding. I cannot state this:

FIND_PACKAGE ( Boost COMPONENTS filesystem REQUIRED) # ideal

  If I follow your suggestion I need to express an internal
dependencie at user level:

FIND_PACKAGE ( Boost COMPONENTS filesystem system REQUIRED)

  which fails for Boost 1.34 with:

...
CMake Error at Cmake/FindBoost.cmake:894 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.34.1

  Boost include path: /usr/include

  The following Boost libraries could not be found:

          boost_system

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:33 (FIND_PACKAGE)
...

Thanks

On Mon, Nov 2, 2009 at 6:24 PM, Philip Lowman <philip at yhbt.com> wrote:
> Add system to the list of components.  FindBoost should silently omit it on
> older versions of boost w/o a system library.  At least I think.
>
> Sorry for brief messages, typing on mobile :)
>
> On Nov 2, 2009 11:30 AM, "Mathieu Malaterre" <mathieu.malaterre at gmail.com>
> wrote:
>
> I can reproduce with CMake / CVS.
>
> FIND_PACKAGE ( Boost COMPONENTS filesystem )
>
> ADD_LIBRARY( bla SHARED bla_use_filesystem.cxx)
> TARGET_LINK_LIBRARIES( bla ${Boost_LIBRARIES}   )
>
> ->
>
> CMakeFiles/Csm.dir/Common/csmPathSet.cc.o: In function
> `__static_initialization_and_destruction_0':
> /usr/include/boost/system/error_code.hpp:205: undefined reference to
> `boost::system::get_system_category()'
> /usr/include/boost/system/error_code.hpp:206: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:211: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:212: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:213: undefined reference to
> `boost::system::get_system_category()'
> CMakeFiles/Csm.dir/IO/csmGraphLoader.cc.o: In function
> `__static_initialization_and_destruction_0':
> /usr/include/boost/system/error_code.hpp:205: undefined reference to
> `boost::system::get_system_category()'
> /usr/include/boost/system/error_code.hpp:206: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:211: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:212: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:213: undefined reference to
> `boost::system::get_system_category()'
> CMakeFiles/Csm.dir/IO/csmChessBoardLoader.cc.o: In function
> `__static_initialization_and_destruction_0':
> /usr/include/boost/system/error_code.hpp:205: undefined reference to
> `boost::system::get_system_category()'
> /usr/include/boost/system/error_code.hpp:206: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:211: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:212: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:213: undefined reference to
> `boost::system::get_system_category()'
> CMakeFiles/Csm.dir/IO/csmModelLoader.cc.o: In function
> `__static_initialization_and_destruction_0':
> /usr/include/boost/system/error_code.hpp:205: undefined reference to
> `boost::system::get_system_category()'
> /usr/include/boost/system/error_code.hpp:206: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:211: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:212: undefined reference to
> `boost::system::get_generic_category()'
> /usr/include/boost/system/error_code.hpp:213: undefined reference to
> `boost::system::get_system_category()'
>
>
> What should have I been writing instead ?
>
> Thanks !
>
> On Mon, Nov 2, 2009 at 4:41 PM, Philip Lowman <philip at yhbt.com> wrote: >
> Which FindBoost are you u...
>
> --
> Mathieu
>



-- 
Mathieu


More information about the CMake mailing list