Boost logo

Boost :

Subject: [boost] Follow-up to the follow-up of the CMake follow-up
From: Peter Dimov (lists_at_[hidden])
Date: 2017-07-05 18:39:13


In branch feature/install-cmake-config-2 of the superproject, you can find
an improved version of the award-winning work presented in my previous
follow-up. This one integrates into the top-level "b2 install" and "b2
stage" and installs (or, respectively, stages) the CMake configuration files
necessary for find_package to work.

The instructions for trying it out are the same as last time:

git clone --recursive --depth 64 -b feature/install-cmake-config-2
https://githib.com/boostorg/boost
bootstrap
b2 headers
b2 install

then add the installation prefix to CMAKE_PREFIX_PATH. An example
CMakeLists.txt could look like this:

cmake_minimum_required(VERSION 3.5)

project(cmake_demo CXX)

list(APPEND CMAKE_PREFIX_PATH C:/Boost)

find_package(boost_filesystem 1.63.0 REQUIRED)
find_package(boost_program_options 1.63.0 REQUIRED)

# disable autolink

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)


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