I've finished the mockup which can be studied at:
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/