tags:

views:

196

answers:

2

I have installed the most recent version of boost in /usr/local (with includes in /usr/local/include/boost and libraries in /usr/local/lib/boost) and I am now attempting to install Wt from source, but cmake (version 2.6) can't seem to find the boost installation. It tries to give helpful suggestions about setting BOOST_DIR and Boost_LIBRARYDIR, but I haven't been able to get it to work by tweaking these variables.

The most recent error message that I get is that it can't find the libraries, but it seems to indicate that it is using "/usr/local/include" for the include path, which isn't correct (and I can't seem to fix it). Does anybody have a solution for this off the top of their head, or do I need to go mucking around inside cmake to figure it out?

+1  A: 

You should have a look at FindBoost.cmake script, which handles Boost detection and setting up all Boost variables. It typically resides in /usr/share/cmake-2.6/Modules/. In it you find documentation, to quote:

# These last three variables are available also as environment variables:
#
#   BOOST_ROOT or BOOSTROOT      The preferred installation prefix for searching for
#                                Boost.  Set this if the module has problems finding
#                                the proper Boost installation.
#

In contrast to BOOST_ROOT, the variables you are referring to are actually variables that are set by the FindBoost module. Note that you don't have to (and probably also don't want to) edit your CMake project configuration to set BOOST_ROOT. Instead, you should use the environment variable, e.g. calling

# BOOST_ROOT=/usr/local/... ccmake .

p.s.: CMake sucks.

ypnos
I tried setting BOOST_ROOT to /usr/local and this doesn't seem to fix the problem.I definitely agree with you about cmake, all of these cmake/ant/whatever users and developers need to suck it up and just go learn configure and make instead of polluting the environment with yet another new build system.
BD at Rivenhill
if you install in /usr/local/boost, shouldn't BOOST_ROOT be /usr/local/boost? If that works but fails for the libs (as they are not under /usr/local/boost the way you describe it), try to make a symlink /usr/local/boost/libs -> /usr/local/lib/boost
ypnos
@ypnos: I typed in an incorrect path to the include files in the first sentence, now fixed.
BD at Rivenhill
A: 

After digging around in cmake and experimenting, I determined that cmake was unhappy with the fact that all of my boost libraries were contained in /usr/local/lib/boost and not /usr/local/lib. Once I soft-linked them back out, the build worked.

BD at Rivenhill