Boost logo

Boost :

Subject: Re: [boost] Strawman proposals for CMake support
From: paul (pfultz2_at_[hidden])
Date: 2017-07-19 16:16:31


On Wed, 2017-07-19 at 17:06 +0200, Raffi Enficiaud via Boost wrote:
> Le 19.07.17 à 16:39, paul via Boost a écrit :
> >
> > On Wed, 2017-07-19 at 14:37 +0200, Raffi Enficiaud via Boost wrote:
> > >
> > > Le 19.07.17 à 03:09, Louis Dionne via Boost a écrit :
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I'd like to expose two strawman proposals for adding CMake support
> > > > to Boost. Both proposals would solve the following problems, with
> > > > different advantages and disadvantages:
> > > >
> > > > (1) Users have a hard time integrating Boost into their build system,
> > > >     which is CMake more often than not.
> > > >
> > > > (2) Prospective Boost developers are sometimes driven away from
> > > >     submitting because they would have to learn Boost.Build, which
> > > >     is not widely used and has a limited knowledge base.
> > > >
> > > > FIRST PROPOSAL
> > > > ==============
> > > > The first proposal is to move completely to CMake and to render
> > > > Boost.Build support optional. The possible rollout plan would
> > > > look something like:
> > > >
> > > > 1. We start requiring that new libraries support both Boost.Build
> > > >    and CMake.
> > > >
> > > > 2. We start adding CMake support to existing libraries.
> > > >    This will take time.
> > > > 2.1 We start moving our infrastructure to be CMake-based.
> > > >
> > > > 3. We release Boost with dual support for a while, letting time
> > > >    for things to bake.
> > > >
> > > > 4. We remove the requirement that Boot libraries can be built
> > > >    with B2. Libraries (existing and new ones) are free to provide
> > > >    such support, but they are not required to.
> > > >
> > > > This would bring CMake to the status of "primary" build system
> > > > for Boost. This could be based on Paul Fultz's work in progress
> > > > at [1]. This has the following advantages (in the long term):
> > > > - Less technical debt because we only have one "official" build
> > > >   system to maintain.
> > > > - The build system is uniform across all of Boost, which means
> > > >   it's easier for folks to maintain it and understand it.
> > > > - It gives maximal flexibility to CMake-based users.
> > > >
> > > > However, it has the following drawbacks:
> > > > - We'll need to do a wholesale migration to build system XYZ when
> > > >   CMake is not cool anymore.
> > > > - It's harder to get buy-in from some developers that love
> > > >   Boost.Build
> > > I personally believe that "anything" between the tool (cmake or
> > > boost.build) and the developers should be avoided, whether it is a "good
> > > idea" or not. So I will not be in favour of libraries such as, no
> > > offense (**), BCM.
> > The point of BCM is not to abstract away the tool(although some developers
> > would like it to do that). Only to provide some functions for the
> > boilerplate
> > in involved in generation of package configuration, to help provide
> > consistency with the testing, and provide support for documentation(ss
> > cmake
> > does not provide modules for boost documentation).
> What I also really dislike in this approach is to have a very hard 
> dependencies to whatever library that is lying in the superproject. My 
> goal is to be able to distribute boost.test (library and tests parts) 
> independently of boost as well.

Yes, it doesnt prevent that. In the standalone builds, BCM is just another
dependency the user would install(either manually or through a package
manager). This is why a file would start with `find_package(BCM)` so it will
search for the installed BCM, in the same way it would search for Boost.Config
when you call `find_package(boost_config)`.

Unless by independent, you mean zero dependencies. In this scenario, you can
call to `find_package(BCM)`, if not found do something else besides calling
the bcm module functions. Of course, creating zero dependency libraries should
not be the focus of the cmake. These are boost libraries that will be
integrated into boost infrastructure. I think it should up to the each
individual author to support zero-dependency library, while overall all boost
libraries should support standalone installation.

>
> Again that is to me the core of the problem: what CMake variables (or 
> interface) is needed in individual libraries and in the superproject to 
> have a decent global infrastructure?

There is no variables that need to be defined, but we want to create a target
for the library, an alias target with the namespace, install the target and
header files, and generate the package configuration.

>
> >
> >
> > >
> > >
> > > I would welcome a tool that dissects the Jamfiles and generates even a
> > > rough/approximate CMakeLists.txt to start with.
> > >
> > > But I would "really" rather focus on the interface between the
> > > superproject and the libraries, and among the libraries themselves to
> > > cover the inner dependencies (flow of information basically: expected
> > > targets, naming conventions, build variants, etc).
> > I think any cmake should follow closely this:
> >
> > https://github.com/boost-cmake/boost
> >
> I will be honest: for the boost.test part, I will just rewrite 
> everything in there. This is just an empty shell that is providing the 
> very easy part, the tip of the iceberg.
>
> And this is exactly my point that is not addressed in your reply: what 
> is supposed to be in the CMakeLists.txt in terms of inter dependencies? 

What do mean "interdependencies"? 

> For generating the doc?

We will definitely need a cmake module for this as cmake doesn't support boost
doc directly.

> for testing and sharing their results?

That should all happen within CTest.

> for being 
> able to unit test the CMakeLists.txt itself?

Building, testing and installing should be enough to test the cmake scripts.

>
> I believe, and this is certainly better done in another thread, that the 
> provided example does not address any of the main concerns, it just 
> declares a target, and adds a couple of dependencies to its interface.
>
> That is not enough.
>
> Raffi
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boo
> st


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