Boost logo

Boost :

Subject: Re: [boost] Proposal for moving Boost to CMake
From: Peter Dimov (lists_at_[hidden])
Date: 2017-06-20 02:24:35


Louis Dionne wrote:
> 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

Thanks, this gives me an idea what you were proposing. One thing I notice is
that you don't enumerate any dependencies. This would work fine in the case
where all our header-only libraries are installed into the same include/ as
one -I would be as good as any other, I suppose.

> Then, each Boost library would simply provide a file like this and install
> it to the appropriate location when the library is installed.

So, if I understand correctly, you're saying that after `b2 install` in
addition to the headers in $prefix/include and the built libraries in
$prefix/lib, we should also copy these boost_*-config.cmake files (along
with the corresponding -version files maybe?) into $prefix/lib/cmake?

Which would then presumably enable find_package(boost_pumpkin)?


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