This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
/
CMakeLists.txt
81 lines (63 loc) · 2.01 KB
/
CMakeLists.txt
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
#
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.2)
if (NOT DEFINED PACKAGE_VERSION)
set(PACKAGE_VERSION 1.0.0)
endif()
if (NOT DEFINED SO_VERSION)
set(SO_VERSION 1)
endif()
project(fbzmq)
if (UNIX AND (APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD"))
add_definitions(-DIS_BSD)
endif()
set(INCLUDE_INSTALL_DIR include CACHE STRING
"The subdirectory where header files should be installed")
set(LIB_INSTALL_DIR lib CACHE STRING
"The subdirectory where libraries should be installed")
if (NOT DEFINED CPACK_GENERATOR)
set(CPACK_GENERATOR "RPM")
endif()
include(CPack)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wno-noexcept-type ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wno-deprecated-declarations ${CMAKE_CXX_FLAGS}")
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_BINARY_DIR})
set(
CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/build/fbcode_builder/CMake"
${CMAKE_MODULE_PATH}
)
include(FBThriftCppLibrary)
# External third-party libraries
find_library(DOUBLECONV double-conversion)
find_package(Gflags REQUIRED)
find_package(Glog REQUIRED)
find_library(PTHREAD pthread)
find_library(ZMQ zmq)
find_package(Threads REQUIRED)
set(REQ_BOOST_COMPONENTS ${REQ_BOOST_COMPONENTS} system thread context filesystem program_options regex)
find_package(Boost 1.65.0 MODULE
COMPONENTS
${REQ_BOOST_COMPONENTS}
REQUIRED
)
find_path(ZMQ_INCLUDE_DIR zmq.h)
include_directories(${Boost_INCLUDE_DIRS} ${ZMQ_INCLUDE_DIR})
# Facebook specific libraries
find_package(folly CONFIG REQUIRED)
find_library(ZSTD zstd)
find_package(fizz CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(wangle CONFIG REQUIRED)
find_package(FBThrift CONFIG REQUIRED)
# Include Thrift
include_directories(${FBTHRIFT_INCLUDE_DIR})
add_subdirectory(fbzmq)