|
Boost : |
Subject: Re: [boost] [cmake] Minimum viable cmakeification for Boost
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-06-20 12:00:23
>> I've finished the mockup which can be studied at:
>>
>> https://github.com/ned14/boost-bmv-cmake
>
> So I setup a repo to build and install Boost.System as well, here:
>
> https://github.com/pfultz2/boost-cmake-demo
>
> This is following the best practices as explained in Daniel Pfeiferâs
> âEffective Cmakeâ talk(except the globbing subdirectories, I did that
> just to save time). It also very similar to the boost cmake repo
> written by Daniel Pfeifer and Stephen Kelley.
Half the stuff in your CMakeLists is non-mandatory configuration and can
be relocated to the rootmost CMakeLists where it belongs.
> This example can be used to build and install modular or in the
> superproject. Plus, it produces the find_package files, so you can do
> `find_package(boost_system)`.
"Installation" is non-mandatory configuration and will vary from end
user to end user. It should be implemented in the rootmost CMakeLists.
Not in library-level CMakeLists where it needlessly duplicates logic.
My bare minimum cmake actually implements the bare minimum for
installation, so it tells cmake what would need to be installed per
project and does nothing more. Rootmost CMakeLists can then do whatever
custom installation logic they choose.
Niall
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk