Boost logo

Boost :

Subject: [boost] Boost CMake support - Request for Comment
From: Mike Dev (mike.dev_at_[hidden])
Date: 2018-10-08 09:24:23


> -----Original Message-----
> From: Boost <boost-bounces_at_[hidden]> On Behalf Of Robert Ramey via
> Boost
> Sent: Monday, October 1, 2018 7:07 PM
>
> [...]
>
> a) A discussion on the boost developers mailing list with the goal of
> reaching a consensus as to what benefits CMake can and should provide to
> users and developers of Boost. This effort will commence with the
> posting of this notice. I hope that this discussion can be more or less
> resolved within 30 days.

Personally, I hope to gain two things by this effort:

1) I would like to be able to clone the boost super project and/or
individual boost libraries into a subfolder of my cmake based app and use
those libraries along the lines of
  - add_subdirectory( libs/boost ) // assuming the super projects resides in \
                                     (<app_root>/libs/boost)
  - target_link_libraries( my_app
        PRIVATE
            Boost::static_assert
            Boost::filesystem
            Boost::circular_buffer )

  Which should make sure that
  a) All used boost libraries are built with the compiler flags specified
     in my cmake toolchain file, or the top level CMakeLists.txt file from
     my app project.
    (In particular c++ version and anything that influences ABI/API)
  b) Headers are found at their original location without any need to copy
     them to some installation/staging directory
  c) (Which is probably the same as b)) My IDE (that understands CMake files)
     should be able to find and parse the source and header files (e.g. for
     "go to definition" operations)

2) It should be possible to compile and install a boost release via the customary
   - cmake <path to boost_root> \
        -DCMAKE_INSTALL_PREFIX=<path> \
        -DCMAKE_TOOLCHAIN_FILE=<path> \
        [other options]
   - cmake --build .
   - cmake --build . --target install
   Again respecting all compilation flags specified in the toolchain file and
   installing a) headers, b) compiled libraries c) the respective library
   cmake config files. The goal is to provide a cmake based installation
   procedure that can be easily used by package managers like conan, vcpkg,
   apt, cget and so on.

In addition to those points, it would probably be prudent to also allow tests
(for a individual library as well as the whole boost release) to be run via
cmake / ctest and cdash, but this is less important for me as a user and I
have no opinions on the details of that.
   
Best

Mike


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