Skip to content

Commit

Permalink
CMake: Find Boost using CONFIG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Jul 4, 2024
1 parent 1166e3e commit 91bfa66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake_modules/PagmoFindBoost.cmake
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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()
Expand Down

0 comments on commit 91bfa66

Please sign in to comment.