Boost logo

Boost Interest :

Subject: [Boost-cmake] Variant Builds and missing libraries
From: Michael Jackson (mike.jackson_at_[hidden])
Date: 2008-11-12 08:54:49

Came across an interesting situation while doing some testing on the
CMake build system. I configured my build tree to be SHARED+MULTI-
THREADED+DEBUG. When I built I was almost immediately getting an error
about not being able to link against boost_test_exec_monitor-mt-
shared. Which is wrong because test_exec_monitor is a static-only
library. As I walked through the CMake code to track down what was the
problem I basically discovered for myself that if you have
BUILD_STATIC=OFF then NO static libraries will be built, which has the
side effect of disabling any regression test that relies on the

    Question: Is this desired behavior? (I wouldn't think so but I
would rather hear that from a boost dev)

   Comment: I have a solution in place where I added another optional
argument to the boost_add_library macro that is located in
BoostCore.cmake. The argument is FORCE_VARIANTS followed by the type
of variant that you want to make. So the call to this macro for the
test_exec_monitor looks like the following:


This takes care of case where boost_test_exec_monitor was NOT being
built but I still have the case of adding a regression test does not
work. From boost/libs/config/test/CMakeLists.txt:

boost_test_run(limits_test DEPENDS boost_test_exec_monitor)

which will still fail because the current cmake code will look for
some other variant (MT-SHARED) of the boost_test_exec_monitor library.

Question: Should I somehow hard code into boost_test_run() a
conditional test for the test_exec_monitor library being needed and
link to the proper library? Somehow seems "wrong" to do it that way. I
really feel like I am missing something that probably was already

Thanks for any feedback or comments.
Mike Jackson mike.jackson_at_[hidden]
BlueQuartz Software
Principal Software Engineer Dayton, Ohio

Boost-cmake list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at