Boost logo

Boost :

Subject: Re: [boost] [cmake] Pull request announcement
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2018-09-19 18:31:40


On 19.09.18 15:08, James E. King III via Boost wrote:
> On Mon, Sep 17, 2018 at 12:02 PM Peter Dimov via Boost <
> boost_at_[hidden]> wrote:
>
>> Mike Dev wrote:
>>>> I'd like to see an example of how a CMake project using Boost (f.ex.
>>>> System) would look like, assuming your proposed pull requests are
>>>> accepted.
>>>
>>> Sure. You can have a look at
>> https://github.com/Mike-Devel/DummyBoostUsage
>>
>> Thanks.
>>
>>> file(GLOB boost_lib_cmake_files libs/*/CMakeLists.txt)
>>
>> I wonder what would happen if Hana, Yap or Beast are present. :-)
>>
>>
> Absolutely, positively do NOT use GLOB for project build chains or for
> header or source discovery.
> There are well documented reasons not to do this. You must express the
> dependency chain in
> linear order in libs/CMakeLists.txt.
>
> I would have the boostorg/CMakeLists.txt call:
>
> add_subdirectories ( libs )
> after it has included all the things libs depends on.
>
> Then have libs/CMakeLists.txt call add_subdirectories in dependency order.
> That is the only way you can reasonably ensure a linear dependency chain.

Maintaining the topological order at $boost/libs level is difficult and
error prone.

I've a solution that works well for this. Please have a look there, all
is explained:

https://github.com/raffienficiaud/boost-cmake

In particular, I use additional files like this one:
https://github.com/raffienficiaud/boost-cmake/blob/master/boost/libs/test/build/boost-decl.cmake

that for instance indicate that the "doc" component of "test" requires
the "build" of quickbook. After that, everything gets included in the
right order.

Raffi


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