CMake: Adopt find_package2

* Adds support for Boost 1.70

Resolves #14
This commit is contained in:
Dennis Klein
2019-06-27 12:01:56 +02:00
parent 4d49a35690
commit 9a9174cca1
2 changed files with 102 additions and 1 deletions

View File

@@ -28,7 +28,13 @@ option(USE_BOOST_PRETTY_FUNCTION "Use Boost BOOST_PRETTY_FUNCTION macro" OFF)
# Dependency ###################################################################
if(USE_BOOST_PRETTY_FUNCTION)
find_package(Boost REQUIRED)
if(NOT DEFINED Boost_NO_BOOST_CMAKE AND CMAKE_VERSION VERSION_LESS 3.15)
# Since Boost 1.70 a CMake package is shipped by default. Unfortunately, it has a number
# of problems that are only fixed in Boost 1.71 or CMake 3.15. By default we skip the
# BoostConfig lookup. This can be overridden on the command line via -DBoost_NO_BOOST_CMAKE=OFF
set(Boost_NO_BOOST_CMAKE ON)
endif()
find_package2(PUBLIC Boost REQUIRED)
endif()
################################################################################