From 91bfa66060a08ec13dd34d77e287dccbdf54a40f Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Thu, 4 Jul 2024 11:01:04 +0200 Subject: [PATCH] CMake: Find Boost using CONFIG mode --- cmake_modules/PagmoFindBoost.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_modules/PagmoFindBoost.cmake b/cmake_modules/PagmoFindBoost.cmake index 1839ee8d7..23743f7ea 100644 --- a/cmake_modules/PagmoFindBoost.cmake +++ b/cmake_modules/PagmoFindBoost.cmake @@ -1,7 +1,7 @@ # Run a first pass for finding the headers only, # and establishing the Boost version. set(_PAGMO_BOOST_MINIMUM_VERSION 1.68.0) -find_package(Boost ${_PAGMO_BOOST_MINIMUM_VERSION} QUIET REQUIRED) +find_package(Boost ${_PAGMO_BOOST_MINIMUM_VERSION} QUIET REQUIRED CONFIG) set(_PAGMO_REQUIRED_BOOST_LIBS serialization) @@ -11,7 +11,7 @@ if(_PAGMO_FIND_BOOST_UNIT_TEST_FRAMEWORK) endif() message(STATUS "Required Boost libraries: ${_PAGMO_REQUIRED_BOOST_LIBS}") -find_package(Boost ${_PAGMO_BOOST_MINIMUM_VERSION} REQUIRED COMPONENTS ${_PAGMO_REQUIRED_BOOST_LIBS}) +find_package(Boost ${_PAGMO_BOOST_MINIMUM_VERSION} REQUIRED CONFIG COMPONENTS ${_PAGMO_REQUIRED_BOOST_LIBS}) if(NOT Boost_FOUND) message(FATAL_ERROR "Not all requested Boost components were found, exiting.") endif()