This repository has been archived by the owner on Jan 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 216
/
logdevice-deps.cmake
87 lines (81 loc) · 3.18 KB
/
logdevice-deps.cmake
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
# Copyright (c) 2017-present, Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# Python version can be chosen by specifying e.g.:
set(LD_PYTHON_VERSION 3.5 CACHE STRING "Python version")
find_package(PythonInterp ${LD_PYTHON_VERSION} REQUIRED)
find_package(PythonLibs ${LD_PYTHON_VERSION} REQUIRED)
set(_boost_py_component
python-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
message(STATUS "Boost Python Component ${_boost_py_component}")
find_package(Boost 1.55.0 MODULE
COMPONENTS
context
chrono
date_time
filesystem
program_options
regex
system
thread
${_boost_py_component}
REQUIRED
)
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Libunwind REQUIRED)
find_package(JeMalloc REQUIRED)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Zstd REQUIRED)
find_package(LibLZMA REQUIRED)
find_package(LibEvent REQUIRED)
find_package(LibDl REQUIRED)
find_package(DoubleConversion REQUIRED)
find_package(Zookeeper REQUIRED)
find_package(BZip2 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Glog REQUIRED)
find_package(LZ4 REQUIRED)
find_package(Sqlite REQUIRED)
find_package(Snappy REQUIRED)
find_package(GFlags REQUIRED)
find_package(LibIberty REQUIRED)
include_directories(${JEMALLOC_INCLUDE_DIR})
include_directories(${FOLLY_INCLUDE_DIR})
include_directories(${LIBUNWIND_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${JEMALLOC_INCLUDE_DIR})
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${ZSTD_INCLUDE_DIR})
include_directories(${LIBEVENT_INCLUDE_DIR})
include_directories(${LIBDL_INCLUDE_DIRS})
include_directories(${DOUBLE_CONVERSION_INCLUDE_DIR})
include_directories(${Zookeeper_INCLUDE_DIR})
include_directories(${LIBGLOG_INCLUDE_DIR})
include_directories(${LZ4_INCLUDE_DIR})
include_directories(${SQLITE_INCLUDE_DIR})
include_directories(${BZIP2_INCLUDE_DIR})
include_directories(${ZLIB_INCLUDE_DIR})
include_directories(${SNAPPY_INCLUDE_DIR})
include_directories(${ROCKSDB_INCLUDE_DIRS})
include_directories(${LIBLZMA_INCLUDE_DIRS})
include_directories(${LIBGFLAGS_INCLUDE_DIR})
# Figure out where to install the Python library
# Some packages (e.g. OpenCV) also install to dist-packages (Debian)
# instead of site-packages. We will use the default as well.
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig \
import get_python_lib; \
print(get_python_lib(prefix='', plat_specific=True))"
OUTPUT_VARIABLE _python_dist_path
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Debian systems will return dist-packages here
# Other platforms rely on site-packages
set(_python_major_minor "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
if("${_python_dist_path}" MATCHES "site-packages")
set(_python_dist_path "python${_python_major_minor}/site-packages")
else() #debian based assumed, install to the dist-packages.
set(_python_dist_path "python${_python_major_minor}/dist-packages")
endif()
set(PYTHON_MODULE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${_python_dist_path}")