diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index 953b395b525..1cca94ff6c8 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -84,13 +84,16 @@ endif() find_package(Threads REQUIRED) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30") + # avoid legacy warning about Boost lookup in CMake + cmake_policy(SET CMP0167 NEW) +endif() + +# we are only using the header-only "container" component so we can unconditionally search for it if(USE_BOOST) - if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30") - # avoid legacy warning about Boost lookup in CMake - cmake_policy(SET CMP0167 NEW) - endif() - # we are using the header-only "container" component - find_package(Boost QUIET) + find_package(Boost REQUIRED) +else() + find_package(Boost) endif() find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint) diff --git a/cmake/options.cmake b/cmake/options.cmake index 32c7ebcd087..c281c1e471f 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -89,7 +89,7 @@ option(DISALLOW_THREAD_EXECUTOR "Disallow usage of ThreadExecutor for -j" if(DISALLOW_THREAD_EXECUTOR AND WIN32) message(FATAL_ERROR "Cannot disable usage of ThreadExecutor on Windows as no other executor implementation is currently available") endif() -option(USE_BOOST "Usage of Boost" OFF) +option(USE_BOOST "Force usage of Boost" OFF) option(USE_BOOST_INT128 "Usage of Boost.Multiprecision 128-bit integer for Mathlib" OFF) if (NOT USE_BOOST AND USE_BOOST_INT128) message(FATAL_ERROR "USE_BOOST_INT128 requires USE_BOOST to be enabled") diff --git a/releasenotes.txt b/releasenotes.txt index d599d9d9107..78f2dfba2a2 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -22,4 +22,5 @@ Other: - added CMake option `ENABLE_CSA_ALPHA` to enable the Clang Static Analyzer alpha checkers - Updated TinyXML-2 to v11.0.0 - The minimum supported Python version has been bumped to 3.7. +- CMake will now unconditionally use Boost.Containers if available. If CMake option `USE_BOOST` is specified it will now bail out when it is not found. -