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()