Boost logo

Boost :

Subject: Re: [boost] [cmake] Minimum viable cmakeification for Boost
From: P F (pfultz2_at_[hidden])
Date: 2017-06-20 06:27:32


> On Jun 19, 2017, at 6:42 PM, Niall Douglas via Boost <boost_at_[hidden]> wrote:
>
> I've finished the mockup which can be studied at:
>
> https://github.com/ned14/boost-bmv-cmake
>
> Just Boost.System was cmakeified. Extensive comments are throughout to
> explain every single line of cmake and why it's there. A small sample
> program is in the root of the repo to show how this cmake would be used
> by end user programs.

Here some feedback, I have:

- Having things like `::hl` or `::sl` is quite strange. In cmake, I set `BUILD_SHARED_LIBS=On` when I want a shared library or I set it to `BUILD_SHARED_LIBS=Off` when I want a static library. There should only be one target `boost::config` or `boost::system` that I use.

- Each project do things like `include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/BoostVersion.cmake”)` which is broken when built on its own.

- Doing `if(NOT TARGET boost::assert::hl)` is wrong. A target does not have to exists to be able to link against it. Plus, it should call `find_package(boost_assert)` to bring in the target for when its not built in the superproject.

- There is no installation of the targets

- Doing `target_include_directories(boost_core-hl INTERFACE "include”)` is wrong as this will only add the include directories for the build. The include directories should be added for the build and for the installation.


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