-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
31 lines (23 loc) · 956 Bytes
/
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
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
project(Sherman)
# disable boost warning
add_definitions(-DBOOST_COROUTINES_NO_DEPRECATION_WARNING)
#Compiler options
set(CMAKE_C_FLAGS "-Wall -Wno-deprecated-declarations -Wsign-compare -O3 -g")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11")
# Link Options
set(LINKS_FLAGS "-lcityhash -lboost_system -lboost_coroutine -lpthread -libverbs -lmemcached")
set(INCLUDE_BASE ${PROJECT_SOURCE_DIR}/include)
include_directories(${INCLUDE_BASE})
#Source file define
set(COMMON_SRC ${PROJECT_SOURCE_DIR}/src)
#Used by both server and clients
file(GLOB_RECURSE COMMON_FILE ${COMMON_SRC}/*.cpp)
add_library(sherman STATIC ${COMMON_FILE})
link_libraries(sherman)
file(GLOB TEST_SRC ${PROJECT_SOURCE_DIR}/test/*.cpp)
foreach (TEST ${TEST_SRC})
get_filename_component(TEST_NAME ${TEST} NAME_WE)
add_executable(${TEST_NAME} ${TEST})
target_link_libraries(${TEST_NAME} ${LINKS_FLAGS})
endforeach()