-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (26 loc) · 1.07 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
cmake_minimum_required(VERSION 3.10.0)
project (KVS)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# dir to include
set(KVS_INCLUDE_DIRECTORIES include)
# set(ASAN_OPTIONS "fast_unwind_on_fatal=1")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address")
add_compile_options("-Wall" "-W" "-Wextra" "-fPIC" "-g3")
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
find_package(glog REQUIRED)
find_package(gflags REQUIRED)
# headers to install
file(GLOB_RECURSE KVS_PUBLIC_HEADER include/*)
# source for the lib
file(GLOB_RECURSE KVS_SOURCE src/*)
add_library(kvs_obj STATIC ${KVS_SOURCE})
target_include_directories(kvs_obj PUBLIC ${KVS_INCLUDE_DIRECTORIES})
target_include_directories(kvs_obj INTERFACE ${GLOG_INCLUDE_DIRS})
target_link_libraries(kvs_obj INTERFACE pthread)
target_link_libraries(kvs_obj INTERFACE ${GLOG_LIBRARIES})
target_link_libraries(kvs_obj PUBLIC ${GFLAGS_LIBRARIES})
add_subdirectory(test)
add_subdirectory(unittest)
add_subdirectory(bench)