[CMake] FindBoost problem

Nico Schlömer nico.schloemer at gmail.com
Wed May 26 13:52:12 EDT 2010


Hi all,

I'd like to use CMake for an application that I'm developing on an
Ubuntu machine which needs to link against Boost, i.e., a
custom-compiled installation at /opt/boost/1.43.0/.

I compiled and installed CMake 2.8.1, FindBoost.cmake comes in handy.
Ubuntu ships with its own Boost development package (1.40.0) which I
cannot remove because it's used by other packages. By default, CMake
finds the stock-Boost (I guess b/c it sits in those default folders),
so I call cmake with

  cmake -DBOOST_ROOT:PATH=/opt/boost/1.43.0/ /path/to/source/

Boost is found, and the variables are set in CMakeCache.txt, e.g.,

    Boost_INCLUDE_DIR:PATH=/opt/boost/1.43.0/include

I however also notice that the actual libraries are *not* set correctly, as

    Boost_FILESYSTEM_LIBRARY:FILEPATH=/usr/lib/libboost_filesystem-mt.so

This makes the build fail. Setting BOOST_LIBRARYDIR does not help.

Could that be a bug in CMake?

Cheers,
Nico


More information about the CMake mailing list