forked from smfrpc/smf
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt.in
413 lines (381 loc) · 13.2 KB
/
CMakeLists.txt.in
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
cmake_minimum_required(VERSION 3.7.0)
project(build-deps NONE)
cmake_host_system_information(
RESULT build_concurrency_factor
QUERY NUMBER_OF_LOGICAL_CORES)
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON CACHE "" INTERNAL FORCE)
set(CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY ON CACHE "" INTERNAL FORCE)
set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY ON CACHE "" INTERNAL FORCE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(autotools_flags
CFLAGS=-I@SMF_DEPS_INSTALL_DIR@/include
CXXFLAGS=-I@SMF_DEPS_INSTALL_DIR@/include
LDFLAGS=-L@SMF_DEPS_INSTALL_DIR@/lib)
set(PKG_CONFIG_PATH PKG_CONFIG_PATH=@SMF_DEPS_INSTALL_DIR@/lib/pkgconfig)
set(make_command make -j ${build_concurrency_factor})
set(info_dir --infodir=@SMF_DEPS_INSTALL_DIR@/share/info)
include(ExternalProject)
ExternalProject_Add(boost
# The 1.67.0 release has a bug in Boost Lockfree around a missing header.
URL https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
URL_MD5 319c6ffbbeccc366f14bb68767a6db79
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
PATCH_COMMAND
./bootstrap.sh
--prefix=@SMF_DEPS_INSTALL_DIR@
--with-libraries=atomic,chrono,date_time,filesystem,program_options,system,test,thread
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND
${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
./b2
-j ${build_concurrency_factor}
--layout=system
--build-dir=<BINARY_DIR>
install
variant=release
cflags=-fPIC
cxxflags=-fPIC
link=static
threading=multi
hardcode-dll-paths=true
dll-path=@SMF_DEPS_INSTALL_DIR@/lib)
ExternalProject_Add(fmt
URL https://github.com/fmtlib/fmt/archive/9e554999ce02cf86fcdfe74fe740c4fe3f5a56d5.tar.gz
URL_MD5 e2869a5032a6cc35b4d14008b6125ed9
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DFMT_INSTALL=ON
-DFMT_DOC=OFF
-DFMT_TEST=OFF)
ExternalProject_Add(zlib
URL https://zlib.net/zlib-1.2.11.tar.gz
URL_MD5 1c9f62f0778697a09d36121ead88e08e
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install)
ExternalProject_Add(protobuf
DEPENDS zlib
URL https://github.com/protocolbuffers/protobuf/archive/v3.7.0.tar.gz
URL_MD5 99ab003ca0e98c9dc40edbd60dd43633
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
SOURCE_SUBDIR cmake
CMAKE_ARGS
-Dprotobuf_BUILD_TESTS=OFF
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>)
# FIXME: this setup seems to cause dpdk to rebuild each time
set(dpdk_quadruple ${CMAKE_SYSTEM_PROCESSOR}-native-linuxapp-gcc)
set (dpdk_args
EXTRA_CFLAGS=-Wno-error
O=<BINARY_DIR>
DESTDIR=@SMF_DEPS_INSTALL_DIR@
T=${dpdk_quadruple})
ExternalProject_Add(dpdk
URL https://github.com/scylladb/dpdk/archive/a1774652fbbb1fe7c0ff392d5e66de60a0154df6.tar.gz
URL_MD5 2af337f9ed29955362845808d6cdaa3e
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
COMMAND
${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
make ${dpdk_args} config
COMMAND
${CMAKE_COMMAND}
-DSeastar_DPDK_CONFIG_FILE_IN=<BINARY_DIR>/.config
-DSeastar_DPDK_CONFIG_FILE_CHANGES=@CMAKE_CURRENT_SOURCE_DIR@/dpdk_config
-DSeastar_DPDK_CONFIG_FILE_OUT=<BINARY_DIR>/${dpdk_quadruple}/.config
-P @CMAKE_CURRENT_SOURCE_DIR@/cmake/dpdk_configure.cmake
BUILD_COMMAND ""
INSTALL_COMMAND
${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
${make_command} ${dpdk_args} install)
ExternalProject_Add(c-ares
URL https://github.com/c-ares/c-ares/archive/cares-1_14_0.tar.gz
URL_MD5 79dcc4f2adaff431920755d9cafc9933
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCARES_VERSION="1.14.0"
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCARES_INSTALL=ON)
ExternalProject_Add(yaml-cpp
URL https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.0.tar.gz
URL_MD5 8adc0ae6c2698a61ab086606cc7cf562
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DYAML_CPP_BUILD_TOOLS=OFF
-DYAML_CPP_BUILD_TESTS=OFF
-DBUILD_SHARED_LIBS=OFF
DEPENDS boost)
ExternalProject_Add(gmp
URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
URL_MD5 8ddbb26dc3bd4e2302984debba1406a5
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--srcdir=<SOURCE_DIR>
${info_dir}/gmp
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install)
ExternalProject_Add(nettle
URL https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz
URL_MD5 dc0f13028264992f58e67b4e8915f53d
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--srcdir=<SOURCE_DIR>
--libdir=<INSTALL_DIR>/lib
${info_dir}/nettle
${autotools_flags}
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install
DEPENDS gmp)
ExternalProject_Add(gnutls
URL https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.18.tar.xz
URL_MD5 c2d93d305ecbc55939bc2a8ed4a76a3d
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
${CMAKE_COMMAND} -E env ${PKG_CONFIG_PATH}
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--srcdir=<SOURCE_DIR>
--with-included-unistring
--with-included-libtasn1
--without-idn
--without-p11-kit
# https://lists.gnupg.org/pipermail/gnutls-help/2016-February/004085.html
--disable-non-suiteb-curves
--disable-doc
${autotools_flags}
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install
DEPENDS gmp nettle)
ExternalProject_Add(lz4
URL https://github.com/lz4/lz4/archive/v1.8.3.tar.gz
URL_MD5 d5ce78f7b1b76002bbfffa6f78a5fc4e
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
SOURCE_SUBDIR contrib/cmake_unofficial
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>)
ExternalProject_Add(numactl
URL https://github.com/numactl/numactl/releases/download/v2.0.12/numactl-2.0.12.tar.gz
URL_MD5 2ba9777d78bfd7d408a387e53bc33ebc
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--srcdir=<SOURCE_DIR>
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install)
ExternalProject_Add(libpciaccess
URL https://www.x.org/releases/individual/lib/libpciaccess-0.13.4.tar.gz
URL_MD5 cc1fad87da60682af1d5fa43a5da45a4
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--srcdir=<SOURCE_DIR>
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install)
ExternalProject_Add(hwloc
URL https://download.open-mpi.org/release/hwloc/v1.11/hwloc-1.11.5.tar.gz
URL_MD5 8f5fe6a9be2eb478409ad5e640b2d3ba
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--srcdir=<SOURCE_DIR>
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install
DEPENDS numactl libpciaccess)
ExternalProject_Add(xz
URL https://github.com/xz-mirror/xz/releases/download/v5.2.2/xz-5.2.2.tar.gz
URL_MD5 7cf6a8544a7dae8e8106fdf7addfa28c
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install)
ExternalProject_Add(xml2
URL https://github.com/GNOME/libxml2/archive/f8a8c1f59db355b46962577e7b74f1a1e8149dc6.tar.gz
URL_MD5 8717ac0b233af3ed1e47236afa6e7946
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CONFIGURE_COMMAND
COMMAND
${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
${CMAKE_COMMAND} -E env NOCONFIGURE=true ./autogen.sh
COMMAND
<SOURCE_DIR>/configure
--without-python
--prefix=<INSTALL_DIR>
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install
DEPENDS xz zlib)
ExternalProject_Add(cryptopp
URL https://github.com/weidai11/cryptopp/archive/CRYPTOPP_5_6_5.tar.gz
URL_MD5 88224d9c0322f63aa1fb5b8ae78170f0
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DBUILD_TESTING=OFF)
ExternalProject_Add(lksctp-tools
# Note: 1.0.18 has a bug w/ the build/configuration system that does not
# produce sctp.h.in -> sctp.h and instead install sctp.h.in
URL https://github.com/sctp/lksctp-tools/archive/lksctp-tools-1.0.17.tar.gz
URL_MD5 910a4f1d4024d71149b91f50f97eae23
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
PATCH_COMMAND ./bootstrap
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
--prefix=<INSTALL_DIR>
--srcdir=<SOURCE_DIR>
BUILD_COMMAND ${make_command}
INSTALL_COMMAND ${make_command} install)
ExternalProject_Add(seastar
URL https://github.com/vectorizedio/seastar/archive/319d359.tar.gz
URL_MD5 341f15559319f93463961db03978d45c
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DSeastar_INSTALL=ON
-DSeastar_DPDK=OFF
-DSeastar_APPS=OFF
-DSeastar_DEMOS=OFF
-DSeastar_DOCS=OFF
-DSeastar_TESTING=OFF
-DSeastar_CXX_FLAGS=-Wno-error
-DSeastar_LD_FLAGS=-pthread
-DSeastar_STD_OPTIONAL_VARIANT_STRINGVIEW=ON
-DSeastar_CXX_DIALECT=c++17
-DSeastar_UNUSED_RESULT_ERROR=ON
DEPENDS
fmt
boost
protobuf
dpdk
yaml-cpp
c-ares
gnutls
lz4
hwloc
numactl
xml2
xz
cryptopp
lksctp-tools
zlib)
ExternalProject_Add(zstd
URL https://github.com/facebook/zstd/archive/470344d33e1d52a2ada75d278466da8d4ee2faf6.tar.gz
URL_MD5 52368c486e11c0f21990c8f2d4b556f9
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
SOURCE_SUBDIR build/cmake
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DZSTD_MULTITHREAD_SUPPORT=OFF
-DZSTD_LEGACY_SUPPORT=OFF
-DZSTD_BUILD_STATIC=ON
-DZSTD_BUILD_SHARED=OFF
-DZSTD_BUILD_PROGRAMS=OFF)
ExternalProject_Add(HdrHistogram
URL https://github.com/HdrHistogram/HdrHistogram_c/archive/7381c1bf78d462917cf31b736d5d9e700bfedb0f.tar.gz
URL_MD5 7e9776c558fa9385776cb8c1e5ac7d1a
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DHDR_HISTOGRAM_BUILD_PROGRAMS=OFF
-DHDR_HISTOGRAM_BUILD_SHARED=OFF
DEPENDS zlib)
ExternalProject_Add(xxhash
URL https://github.com/Cyan4973/xxHash/archive/c9970b8ec4155e789f1c3682da923869a496ba9d.tar.gz
URL_MD5 c1c87865e98f79144814a1d57db47751
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
SOURCE_SUBDIR cmake_unofficial
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DBUILD_XXHSUM=OFF
-DBUILD_SHARED_LIBS=OFF
-DBUILD_ENABLE_INLINE_API=ON)
ExternalProject_Add(gtest
URL https://github.com/google/googletest/archive/644319b9f06f6ca9bf69fe791be399061044bc3d.tar.gz
URL_MD5 e4cfcbe80bf32cb8caa8a7666ebc206c
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>)
ExternalProject_Add(gflags
URL https://github.com/gflags/gflags/archive/1005485222e8b0feff822c5723ddcaa5abadc01a.tar.gz
URL_MD5 25582b81561bb2f1d2c05e05b4b566a8
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DBUILD_SHARED_LIBS=OFF
-DBUILD_STATIC_LIBS=ON
-DBUILD_gflags_LIB=ON
-DBUILD_TESTING=OFF
-DBUILD_PACKAGING=OFF)
ExternalProject_Add(glog
URL https://github.com/google/glog/archive/5d46e1bcfc92bf06a9ca3b3f1c5bb1dc024d9ecd.tar.gz
URL_MD5 548900b10c18b2b7a43ae8960ec3a777
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DBUILD_SHARED_LIBS=OFF
-DWITH_GFLAGS=ON
DEPENDS gflags)
ExternalProject_Add(googlebenchmark
URL https://github.com/google/benchmark/archive/eec9a8e4976a397988c15e5a4b71a542375a2240.tar.gz
URL_MD5 81f6af37a81753cb9d799012b62ae04d
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DBENCHMARK_ENABLE_GTEST_TESTS=OFF
-DBENCHMARK_ENABLE_TESTING=OFF
DEPENDS gflags)
# note about master
ExternalProject_Add(flatbuffers
URL https://github.com/google/flatbuffers/archive/bc7ede8fb3a754a04e507992d5514b528270ee06.tar.gz
URL_MD5 e424cde3f805ebd36895d049d1611d40
INSTALL_DIR @SMF_DEPS_INSTALL_DIR@
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@
-DCMAKE_PREFIX_PATH=<INSTALL_DIR>
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DFLATBUFFERS_INSTALL=ON
-DFLATBUFFERS_BUILD_FLATC=ON
-DFLATBUFFERS_BUILD_TESTS=OFF
-DFLATBUFFERS_BUILD_FLATHASH=OFF)