Skip to content

Commit

Permalink
REF cmake get boost
Browse files Browse the repository at this point in the history
  • Loading branch information
sonofR9 committed Dec 30, 2023
1 parent 2b270fd commit a7be3e0
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions cmake/get_boost_lib.cmake
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit a7be3e0

Please sign in to comment.