Boost logo

Boost :

Subject: Re: [boost] Proposal for moving Boost to CMake
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2017-06-20 01:28:57


> Louis Dionne wrote:
>
> > What's actionable is that if the Boost library requirements contain
> this,
> > you'll have to go implement it in your own library.
>
> Contain what?

Contain the requirement that a XYZConfig.cmake module be installed along
with every Boost.XYZ library. The name of the file and the exact wording are
subject to bikeshedding.

> What do I need to implement?

See below.

> How?

By writing it manually or using a script to generate it. Exactly how to do
this should be decided upon by CMake experts as mentioned elsewhere, not by
myself. I expect it might be possible to automate this for projects based on
Boost.Build, but I don't know Boost.Build well enough to be sure.

> I already asked Niall this, I'm asking you. Pick one representative
> header-only library and one representative non-header-only library as
> examples and show us what needs to be done. Please.

Sorry for making you wait, the pre-Toronto mailing deadline was this morning
and you can guess what I did all day :-). I'm going to show you something,
but PLEASE keep in mind this is probably not perfect and CMake experts can
probably poke holes in it. I don't claim to have the full solution right
away, but the following should give an idea of what needs to be done.

So, normally, for a project based on CMake, these XYZConfig.cmake files can
be generated automatically by using `install(EXPORT ...)`. The resulting
file looks like this (for Hana):

 
https://gist.github.com/ldionne/df7b6888752097e25bfc2333f6d897ca#file-what-gets-generated-for-hana-cmake

Basically, we'd want to replicate the functionality provided by this module
without necessarily all the boilerplate (since that's generated
automatically). Here's a minimal file for Hana (a header only library):

 
https://gist.github.com/ldionne/df7b6888752097e25bfc2333f6d897ca#file-minimal-handwritten-config-header-only-cmake

And here's a minimal XYZConfig.cmake file for a library with compiled
sources (I added source files to Hana and turned it into a static library to
check this):

 
https://gist.github.com/ldionne/df7b6888752097e25bfc2333f6d897ca#file-minimal-handwritten-config-static-cmake

Then, each Boost library would simply provide a file like this and install
it to the appropriate location when the library is installed. Again, please
keep in mind this is only the gist of what would need to be done, not an
actual template.

Louis

--
View this message in context: http://boost.2283326.n4.nabble.com/Proposal-for-moving-Boost-to-CMake-tp4695623p4695833.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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