Boost logo

Boost :

Subject: Re: [boost] CMake Modularization
From: Peter Dimov (lists_at_[hidden])
Date: 2016-09-27 16:41:10


Philip Woods wrote:
> I created an example project
> https://github.com/Elzair/cmake-boost-filesystem-test to demonstrate my
> ideas. I added CMake build support to the minimum number of modules needed
> to support this demo: https://github.com/Elzair/assert
> https://github.com/Elzair/config https://github.com/Elzair/core
> https://github.com/Elzair/filesystem/tree/master and
> https://github.com/Elzair/system

A few questions come to mind... why is filesystem on master and the others
on develop?

In filesystem/CMakeLists.txt, shouldn't

set(BOOST_SYSTEM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" CACHE
STRING "Location of boost.system headers")

refer to FILESYSTEM instead?

As far as I can see libs/CMakeLists.txt requires the add_subdirectory calls
to be properly ordered. Isn't this inconvenient? I suppose it's fine for
this case where there are only five lines, but not all libraries are like
that.

Why does the Filesystem CMakeLists.txt file require C++11?

Does this actually work? When I do 'make' I get

D:/tmp/cmake-boost-filesystem-test/test.cpp:3:32: fatal error:
boost/filesystem.hpp: No such file or directory
#include <boost/filesystem.hpp>
                                ^

When I fix the above problem in filesystem/CMakeLists.txt, I get:

In file included from
D:/tmp/cmake-boost-filesystem-test/libs/filesystem/include/boost/filesystem/path.hpp:25:0,
                 from
D:/tmp/cmake-boost-filesystem-test/libs/filesystem/include/boost/filesystem.hpp:16,
                 from D:/tmp/cmake-boost-filesystem-test/test.cpp:3:
D:/tmp/cmake-boost-filesystem-test/libs/filesystem/include/boost/filesystem/path_traits.hpp:21:42:
fatal error: boost/type_traits/is_array.hpp: No such file or directory
#include <boost/type_traits/is_array.hpp>
                                          ^

which is correct, there is no type_traits.

You've probably tested in on a machine with a system Boost installation.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk