Boost logo

Boost Interest :

Subject: Re: [Boost-cmake] Possible linker error
From: troy d. straszheim (troy_at_[hidden])
Date: 2009-10-07 12:54:43


motes motes wrote:
> I am trying to build an application using boost with CMake on Ubuntu
> 9.04. This is the content of my CMakeList.txt file:
>
> IF(Boost_unit_test_framework_LIBRARY)
>

I think it'd be easier to emulate the way some of the other libraries do
it using the unit test framework. See for instance

libs/iostream/test/CMakeLists.txt

where you'll find

boost_test_run(regex_filter_test
   DEPENDS boost_unit_test_framework boost_regex
   COMPILE_FLAGS "-DBOOST_IOSTREAMS_NO_LIB")

This will only have effect if BUILD_TESTING is ON. If BUILD_TESTING is
ON, there will be *lots* of tests generated and this could become
cumbersome. You can have cmake build only tests for your library by
adding it to BOOST_TEST_LIBRARIES. e.g. To work on iostreams,
configure like this:

   cmake ../src -DBUILD_TESTING=ON -DBOOST_TEST_LIBRARIES=iostreams

then 'make' in libs/iostreams/test will build my tests, and
'ctest' in that directory will run them. You could play with this and
then copy the approach in your project.

As usual I'm talking about the cmake branch in git.

-t


Boost-cmake list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk