Due to the strong interest in my previous follow-up, I'm following it up
with a more complete implementation of the support required for CMake
scenario #1, installing configuration files during "b2 install" such that
subsequent "find_package" calls work (assuming a suitably set
CMAKE_PREFIX_PATH).
You can find it in branch "feature/install-cmake-config" in the superproject
(boostorg/boost).
In other words,
git clone --recursive --depth 64 -b feature/install-cmake-config
https://githib.com/boostorg/boost
bootstrap
b2 headers
b2 install cmake//install variant=debug,release link=static,shared
runtime-link=static,shared
This doesn't yet support installation with more than one toolset, and I'm
sure that some libraries don't work, but a simple test using Filesystem and
ProgramOptions does.
/// CMakeLists.txt: ///
cmake_minimum_required(VERSION 3.5)
project(cmake_demo CXX)
list(APPEND CMAKE_PREFIX_PATH C:/Boost)
find_package(boost_filesystem 1.63.0)
find_package(boost_program_options 1.63.0)
# disable autolink globally
# could also do it per-target
add_definitions(-DBOOST_ALL_NO_LIB=1)
# sample program
add_executable(cmake_demo cmake_demo.cpp)
target_link_libraries(cmake_demo boost::filesystem boost::program_options)
/// cmake_demo.cpp: ///
#include