From a7be3e029bd68b837a74cfd7f10c451efdb573ff Mon Sep 17 00:00:00 2001 From: sonofR9 Date: Sat, 30 Dec 2023 14:27:54 +0300 Subject: [PATCH] REF cmake get boost --- cmake/get_boost_lib.cmake | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/cmake/get_boost_lib.cmake b/cmake/get_boost_lib.cmake index 1b0531e..7abcad2 100644 --- a/cmake/get_boost_lib.cmake +++ b/cmake/get_boost_lib.cmake @@ -1,19 +1,26 @@ -# find third party libraries (boost:: beast, asio, system) -find_package(Boost 1.74) +find_package(Boost 1.84 CONFIG COMPONENTS + program_options + # other libs +) if(${Boost_FOUND}) else() + set(BOOST_INCLUDE_LIBRARIES + program_options + # other libs + ) + set(BOOST_ENABLE_CMAKE ON) + include(FetchContent) - FetchContent_Declare(boost URL https://github.com/boostorg/boost/releases/download/boost-1.82.0/boost-1.82.0.tar.xz) - FetchContent_MakeAvailable(boost) + FetchContent_Declare(Boost + URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.7z + USES_TERMINAL_DOWNLOAD TRUE + GIT_PROGRESS TRUE + DOWNLOAD_NO_EXTRACT FALSE + ) + FetchContent_MakeAvailable(Boost) - if(${Boost_INCLUDE_DIRS} STREQUAL "Boost_INCLUDE_DIR-NOTFOUND") + if(Boost_INCLUDE_DIRS STREQUAL "Boost_INCLUDE_DIR-NOTFOUND") set(Boost_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/_deps/boost-build/libs") endif() - - set(Boost_LIBRARIES - "Boost::system" - "Boost::asio" - "Boost::beast" - ) endif()