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.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
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
20 # Copyright (C) 2019 Scylladb, Ltd.
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.
28 # The "real" FIND_PACKAGE invocation for Boost is inside SEASTAR_FIND_DEPENDENCIES.
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
35 set (Boost_NO_BOOST_CMAKE ON)
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)
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)
47 # Iterate through the dependency list defined below and execute `find_package`
48 # with the corresponding configuration for each 3rd-party dependency.
50 macro (seastar_find_dependencies)
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.
56 set (_seastar_all_dependencies
57 # Public dependencies.
61 dpdk # No version information published.
64 # Private and private/public dependencies.
73 lksctp-tools # No version information published.
74 numactl # No version information published.
78 # Arguments to `find_package` for each 3rd-party dependency.
79 # Note that the version specification is a "minimal" version requirement.
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
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)
106 foreach (third_party ${_seastar_all_dependencies})
107 find_package ("${third_party}" ${_seastar_dep_args_${third_party}})