Skip to content

Commit

Permalink
Remove custom Boost finding logic, rely on CONFIG mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni committed Oct 13, 2024
1 parent c52e68c commit 288b6d9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 38 deletions.
16 changes: 14 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,20 @@ endif()
find_package(absl REQUIRED)

# Boost setup.
include(ObakeFindBoost)
# NOTE: stacktrace available since 1.65.0.
set(_OBAKE_MIN_BOOST_VERSION "1.69")
# NOTE: we look for Boost in CONFIG mode first, as that has become the official supported way
# of locating Boost in recent Boost/CMake versions. If we fail, we try again in
# MODULE mode as last resort.
find_package(Boost ${_OBAKE_MIN_BOOST_VERSION} QUIET COMPONENTS serialization CONFIG)
if(NOT ${Boost_FOUND})
message(STATUS "Boost not found in CONFIG mode, retrying in MODULE mode.")
find_package(Boost ${_OBAKE_MIN_BOOST_VERSION} QUIET MODULE COMPONENTS serialization)
endif()
if(NOT ${Boost_FOUND})
message(FATAL_ERROR "Could not locate Boost in either CONFIG or MODULE mode.")
endif()
message(STATUS "Found Boost version ${Boost_VERSION}.")

# libbacktrace.
if(OBAKE_WITH_LIBBACKTRACE)
Expand Down Expand Up @@ -421,7 +434,6 @@ install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindDbgEng.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindTBB.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findlibbacktrace.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ObakeFindBoost.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ObakeFindDl.cmake"
DESTINATION "${OBAKE_INSTALL_LIBDIR}/cmake/obake")
install(EXPORT obake_export NAMESPACE obake:: DESTINATION "${OBAKE_INSTALL_LIBDIR}/cmake/obake")
Expand Down
35 changes: 0 additions & 35 deletions cmake/ObakeFindBoost.cmake

This file was deleted.

1 change: 0 additions & 1 deletion obake-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if(${mp++_VERSION} VERSION_LESS @_OBAKE_MIN_MPPP_VERSION@)
message(FATAL_ERROR "The minimum mp++ version required by obake is @_OBAKE_MIN_MPPP_VERSION@, but version ${mp++_VERSION} was found instead.")
endif()
find_package(absl REQUIRED)
include(ObakeFindBoost)
# TBB. Try to find it first in config mode (supported
# since version 2021 after the oneTBB rename), and, if this
# fails, fall back to our own FindTBB.cmake. This is of course
Expand Down

0 comments on commit 288b6d9

Please sign in to comment.