[CMake] Support for Boost 1.70.0

Stephan Menzel stephan.menzel at gmail.com
Fri Apr 12 10:31:05 EDT 2019


Hello List,

Boost 1.70.0 was just released and I'm integrating it into our projects. I
notice FindBoost doesn't do the trick on Windows (MSVC141) anymore, on
Linux / G++ it works fine. Here's what I do:

set(Boost_USE_STATIC_LIBS           ON)
set(Boost_USE_MULTITHREADED         ON)
set(Boost_USE_STATIC_RUNTIME       OFF)
set(Boost_USE_DEBUG_LIBS           OFF)
set(Boost_USE_DEBUG_RUNTIME        OFF)

set(BOOST_INCLUDEDIR "${BOOST_ROOT}/include")
set(BOOST_LIBRARYDIR "${BOOST_ROOT}/lib")

find_package(Boost REQUIRED
COMPONENTS
system
filesystem
random
chrono
log
date_time
regex
thread
fiber
exception
program_options
unit_test_framework
)

It complains:
Could not find the following static Boost libraries:

boost_system
boost_log
boost_unit_test_framework

Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.

Previous Boost versions worked. The libs are present as always and the same
code works fine with 1.69.

set(Boost_ADDITIONAL_VERSIONS "1.70.0") doesn't change anything as 1.70.0
appears to be already in the known versions struct in FindBoost.

I have tested with CMake 3.13.4 and 3.14.1. Both fail.

I have worked my way through the FindBoost module but can't figure out what
causes those 3 libs to appear missing. They do appear in the Variables
View, with their correct filenames. Everything seems to be fine but the
error stops execution. When I remove those 3 libs from the list, linking
against imported targets later breaks.

Does anybody have the same issue upgrading? Is there a workaround perhaps?

Cheers,
Stephan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190412/63e6cfa7/attachment.html>


More information about the CMake mailing list