-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathboost.cmake
More file actions
98 lines (88 loc) · 2.32 KB
/
boost.cmake
File metadata and controls
98 lines (88 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
set(BOOST_VERSION 1.78.0)
set(BOOST_INCLUDE_LIBRARIES asio system container lockfree circular_buffer)
set(BOOST_ENABLE_CMAKE ON)
find_package(Boost ${BOOST_VERSION} COMPONENTS system container)
if (NOT Boost_FOUND)
message(STATUS "Boost not found, downloading...")
# Build only the required boost libraries
list(APPEND BOOST_REQD_SUBMODULES
# Asio
"asio"
"align"
"array"
"assert"
"bind"
"chrono"
"typeof"
"ratio"
"rational"
"config"
"core"
"coroutine"
"context"
"pool"
"date_time"
"tokenizer"
"numeric/conversion"
"lexical_cast"
"algorithm"
"unordered"
"range"
"exception"
"function"
"type_index"
"regex"
"smart_ptr"
"system"
"throw_exception"
"type_traits"
"utility"
"io"
# Container
"container"
"intrusive"
"container_hash"
"describe"
"move"
"static_assert"
# System
"system"
"variant2"
"mp11"
"winapi"
# Lock Free
"lockfree"
"atomic"
"preprocessor"
"integer"
"iterator"
"detail"
"conversion"
"mpl"
"parameter"
"optional"
"fusion"
"functional"
"function_types"
"predef"
"tuple"
"lockfree"
# Circular Buffer
"circular_buffer"
"concept_check"
)
list(TRANSFORM BOOST_REQD_SUBMODULES PREPEND "libs/")
list(APPEND BOOST_REQD_SUBMODULES
"tools/build"
"tools/cmake"
)
FetchContent_Declare(
boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-${BOOST_VERSION}
GIT_PROGRESS TRUE
GIT_SUBMODULES ${BOOST_REQD_SUBMODULES}
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(boost)
endif()