Follow-up to the CMake follow-up
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
On Jun 30, 2017, at 6:22 PM, Peter Dimov via Boost
wrote: 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.
That looks pretty awesome. A lot of bjam-fu I don’t understand. You should think about writing a tutorial on bjam. Also, can it be ran by doing? cd cmake b2 cmake I wonder what it would take to integrate it into the main install step.
participants (2)
-
P F
-
Peter Dimov