Boost logo

Boost :

Subject: Re: [boost] Proposal for moving Boost to CMake
From: P F (pfultz2_at_[hidden])
Date: 2017-06-20 08:39:46


> On Jun 20, 2017, at 3:32 AM, Mathias Gaunard <mathias.gaunard_at_[hidden]> wrote:
>
> On 20 June 2017 at 07:06, P F via Boost <boost_at_[hidden] <mailto:boost_at_[hidden]>> wrote:
>
> He didn’t enumerate the dependencies because in this example there wasn’t any dependencies. If there are dependencies, it would look something like this:
>
> include(CMakeFindDependencyMacro)
> # Bring in the boost::fusion imported target
> find_dependency(boost_fusion)
> # Bring in the boost::config imported target
> find_dependency(boost_config)
>
> # Snip the computing imported prefix ...
>
> set_target_properties(boost::hana PROPERTIES
> INTERFACE_COMPILE_FEATURES "cxx_std_14"
> INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
> INTERFACE_LINK_LIBRARIES "boost::fusion;boost::config"
> IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
> IMPORTED_LOCATION "${_IMPORT_PREFIX}/lib/libhana.a"
> # Whatever else you need
> )
>
> Alright I see better how this works, but I don't think CMake generates this automatically, does it?
> Can this deal with cyclic dependencies?

That is a good question. Cmake can handle cyclic dependencies, but we might need some extra cmake code to avoid recursive calls to `find_dependency`.


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