-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
75 lines (65 loc) · 2.06 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
#------------------------------------------------------------------------------
# CMake file for Multiverse
#
# Copyright (c) 2016 The Multiverse developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#------------------------------------------------------------------------------
project(Multiverse LANGUAGES CXX)
cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE PATH "The path to the cmake directory")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_DIR})
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_BUILD_TYPE STREQUAL Release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
endif()
# packages
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.58.0 REQUIRED COMPONENTS
program_options
filesystem
system
thread
date_time
regex
unit_test_framework
timer
)
find_package(OpenSSL 1.0.0 REQUIRED)
find_package(sodium 1.0.8 REQUIRED)
find_package(Readline 5.0 REQUIRED)
set(Protobuf_USE_STATIC_LIBS ON)
find_package(Protobuf 3.3.0 REQUIRED)
if(OPENSSL_VERSION VERSION_EQUAL 1.1.0 OR
(OPENSSL_VERSION VERSION_GREATER 1.1.0 AND OPENSSL_VERSION VERSION_LESS 1.2.0))
add_definitions(-DUSE_SSL_110)
endif()
# libs
if(WIN32)
add_definitions(-DWIN32_LEAN_AND_MEAN)
find_library(WS2_32_LIB NAMES ws2_32)
find_library(WSSOCK32_LIB NAMES wsock32)
elseif(UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lrt")
endif()
# sub directories
add_subdirectory(src)
add_subdirectory(walleve)
add_subdirectory(crypto)
add_subdirectory(common)
add_subdirectory(mpvss)
add_subdirectory(storage)
add_subdirectory(network)
add_subdirectory(test)
add_subdirectory(delegate)
add_subdirectory(leveldb)
add_subdirectory(jsonrpc)
add_subdirectory(snappy)