diff --git a/CMakeLists.txt b/CMakeLists.txt index e19d18f1b..b99c44d5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,10 +41,8 @@ fb_activate_static_library_option() set(QUIC_FBCODE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) # Dependencies -find_package(Boost 1.62 - REQUIRED COMPONENTS +set(MVFST_BOOST_COMPONENTS iostreams - system thread filesystem regex @@ -52,6 +50,12 @@ find_package(Boost 1.62 date_time program_options ) +find_package(Boost 1.62 REQUIRED COMPONENTS ${MVFST_BOOST_COMPONENTS}) +if (Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 69) + list(APPEND MVFST_BOOST_COMPONENTS system) + find_package(Boost 1.62 REQUIRED COMPONENTS ${MVFST_BOOST_COMPONENTS}) +endif() +string(REPLACE ";" " " MVFST_BOOST_COMPONENTS "${MVFST_BOOST_COMPONENTS}") find_package(fmt REQUIRED) find_package(folly REQUIRED) find_package(Fizz REQUIRED) diff --git a/cmake/mvfst-config.cmake.in b/cmake/mvfst-config.cmake.in index 500fb18ef..220e1a649 100644 --- a/cmake/mvfst-config.cmake.in +++ b/cmake/mvfst-config.cmake.in @@ -20,7 +20,7 @@ include(CMakeFindDependencyMacro) find_dependency(folly) find_dependency(Fizz) find_dependency(Threads) -find_dependency(Boost COMPONENTS iostreams system thread filesystem regex context) +find_dependency(Boost COMPONENTS @MVFST_BOOST_COMPONENTS@) if(NOT TARGET mvfst::mvfst_transport) include("${CMAKE_CURRENT_LIST_DIR}/mvfst-targets.cmake")