]> git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/cmake/SeastarDependencies.cmake
import 15.2.0 Octopus source
[ceph.git] / ceph / src / seastar / cmake / SeastarDependencies.cmake
1 #
2 # This file is open source software, licensed to you under the terms
3 # of the Apache License, Version 2.0 (the "License"). See the NOTICE file
4 # distributed with this work for additional information regarding copyright
5 # ownership. You may not use this file except in compliance with the License.
6 #
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
16 # under the License.
17 #
18
19 #
20 # Copyright (C) 2019 Scylladb, Ltd.
21 #
22
23 #
24 # CMake bundles `FindBoost.cmake`, which is coupled to the Boost version. If
25 # we're on a system without a recent enough version of `FindBoost.cmake`, then
26 # we need to use the one bundled with Seastar.
27 #
28 # The "real" FIND_PACKAGE invocation for Boost is inside SEASTAR_FIND_DEPENDENCIES.
29 #
30
31 # Be consistent in results from FindBoost.cmake.
32 # This is required because cmake-boost may return to Boost_{component}_LIBRARY:
33 # - /usr/lib64/libboost_filesystem.so
34 # - Boost::filesystem
35 set (Boost_NO_BOOST_CMAKE ON)
36
37 # This is the minimum version of Boost we need the CMake-bundled `FindBoost.cmake` to know about.
38 find_package (Boost 1.64 MODULE COMPONENTS filesystem)
39
40 # The imported target is undefined when the version of Boost requested is not
41 # supported by the find-module.
42 if (NOT (TARGET Boost::filesystem))
43 list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/bundled_boost)
44 endif ()
45
46 #
47 # Iterate through the dependency list defined below and execute `find_package`
48 # with the corresponding configuration for each 3rd-party dependency.
49 #
50 macro (seastar_find_dependencies)
51 #
52 # List of Seastar dependencies that is meant to be used
53 # both in Seastar configuration and by clients which
54 # consume Seastar via SeastarConfig.cmake.
55 #
56 set (_seastar_all_dependencies
57 # Public dependencies.
58 Boost
59 c-ares
60 cryptopp
61 dpdk # No version information published.
62 fmt
63 lz4
64 # Private and private/public dependencies.
65 Concepts
66 GnuTLS
67 LinuxMembarrier
68 Protobuf
69 Sanitizers
70 StdAtomic
71 StdFilesystem
72 hwloc
73 lksctp-tools # No version information published.
74 numactl # No version information published.
75 rt
76 yaml-cpp)
77
78 # Arguments to `find_package` for each 3rd-party dependency.
79 # Note that the version specification is a "minimal" version requirement.
80
81 # `unit_test_framework` is not required in the case we are building Seastar
82 # without the testing library, however the component is always specified as required
83 # to keep the CMake code minimalistic and easy-to-use.
84 set (_seastar_dep_args_Boost
85 1.64.0
86 COMPONENTS
87 filesystem
88 program_options
89 thread
90 unit_test_framework
91 REQUIRED)
92
93 set (_seastar_dep_args_c-ares 1.13 REQUIRED)
94 set (_seastar_dep_args_cryptopp 5.6.5 REQUIRED)
95 set (_seastar_dep_args_fmt 5.0.0 REQUIRED)
96 set (_seastar_dep_args_lz4 1.7.3 REQUIRED)
97 set (_seastar_dep_args_GnuTLS 3.3.26 REQUIRED)
98 set (_seastar_dep_args_Protobuf 2.5.0 REQUIRED)
99 set (_seastar_dep_args_StdAtomic REQUIRED)
100 set (_seastar_dep_args_StdFilesystem REQUIRED)
101 set (_seastar_dep_args_hwloc 1.11.2)
102 set (_seastar_dep_args_lksctp-tools REQUIRED)
103 set (_seastar_dep_args_rt REQUIRED)
104 set (_seastar_dep_args_yaml-cpp 0.5.1 REQUIRED)
105
106 foreach (third_party ${_seastar_all_dependencies})
107 find_package ("${third_party}" ${_seastar_dep_args_${third_party}})
108 endforeach ()
109 endmacro ()