diff --git a/CMakeLists.txt b/CMakeLists.txt index a479ada8d0..c17b3971e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,17 +80,21 @@ find_package(ZLIB REQUIRED) find_package(OpenSSL REQUIRED) find_package(Threads) find_package(Cares) -find_package(Boost 1.58 REQUIRED - COMPONENTS +set(PROXYGEN_BOOST_COMPONENTS iostreams context filesystem program_options regex - system thread chrono ) +find_package(Boost 1.58 REQUIRED COMPONENTS ${PROXYGEN_BOOST_COMPONENTS}) +if (Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 69) + list(APPEND PROXYGEN_BOOST_COMPONENTS system) + find_package(Boost 1.58 REQUIRED COMPONENTS ${PROXYGEN_BOOST_COMPONENTS}) +endif() +string(REPLACE ";" " " PROXYGEN_BOOST_COMPONENTS "${PROXYGEN_BOOST_COMPONENTS}") list(APPEND _PROXYGEN_COMMON_COMPILE_OPTIONS diff --git a/cmake/proxygen-config.cmake.in b/cmake/proxygen-config.cmake.in index 6849b0a668..aa90e5d7e0 100644 --- a/cmake/proxygen-config.cmake.in +++ b/cmake/proxygen-config.cmake.in @@ -31,16 +31,7 @@ find_dependency(Fizz) find_dependency(ZLIB) find_dependency(OpenSSL) find_dependency(Threads) -find_dependency(Boost 1.58 REQUIRED - COMPONENTS - iostreams - context - filesystem - program_options - regex - system - thread -) +find_dependency(Boost 1.58 REQUIRED COMPONENTS @PROXYGEN_BOOST_COMPONENTS@) if(NOT TARGET proxygen::proxygen) include("${CMAKE_CURRENT_LIST_DIR}/proxygen-targets.cmake")