-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (50 loc) · 1.44 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
cmake_minimum_required(VERSION 3.5)
project(raft-kv)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE Debug)
add_definitions(-Wall)
add_definitions(-DDEBUG)
include_directories(${CMAKE_SOURCE_DIR})
find_package(PkgConfig REQUIRED)
pkg_check_modules(dependencies
glib-2.0>=2.10 REQUIRED
msgpack REQUIRED
hiredis REQUIRED)
include_directories(${dependencies_INCLUDE_DIRS})
set(LIBS
${dependencies_LIBRARIES})
find_package(Boost REQUIRED COMPONENTS system filesystem)
include_directories(${Boost_INCLUDE_DIRS})
set(LIBS
${LIBS}
pthread
Boost::system
Boost::filesystem
)
add_subdirectory(raft-kv)
pkg_check_modules(GoogleTest gtest_main)
if (GoogleTest_FOUND)
include_directories(${GoogleTest_INCLUDE_DIRS})
set(LIBS
${LIBS}
${GoogleTest_LIBRARIES})
add_subdirectory(tests)
enable_testing()
endif (GoogleTest_FOUND)
configure_file(Procfile.in Procfile)
# rocksdb
pkg_check_modules(RocksDB rocksdb)
if (RocksDB_FOUND)
include_directories(${RocksDB_INCLUDE_DIRS})
# compression lib
find_library(LIB_ZSTD zstd REQUIRED)
find_library(LIB_LZ4 lz4 REQUIRED)
find_library(LIB_BZIP2 bz2 REQUIRED)
find_library(LIB_ZLIB z REQUIRED)
find_library(LIB_SNAPPY snappy REQUIRED)
set(LIBS
${LIBS}
${RocksDB_LIBRARIES}
${LIB_ZSTD} ${LIB_LZ4} ${LIB_BZIP2} ${LIB_ZLIB} ${LIB_SNAPPY}
)
endif(RocksDB_FOUND)