-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (31 loc) · 1.33 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
# Cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
INCLUDE (CheckIncludeFiles)
# project
PROJECT(molten_agent)
OPTION(ENABLE_DTRACE "build with dtrace" OFF)
# use dtrace -DENABLE_DTRACE
if (ENABLE_SYSTEMTAP)
CHECK_INCLUDE_FILES("sys/sdt.h" HAVE_SYSTEMTAP)
endif()
# config header
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_SOURCE_DIR}/config.h)
SET(CMAKE_C_FLAGS "-std=gnu99")
SET(SRC_LIST worker_pool.c timer.c common.c socket.c protocol/protocol.c sstring.c net_client.c smalloc.c event_loop.c server.c molten_slog.c)
SET(CLIENT_SRC_LIST socket.c protocol/message.c sstring.c net_client.c client.c smalloc.c molten_slog.c)
# with debug info
set(CMAKE_BUILD_TYPE "Debug")
#SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
#SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/protocol/)
# INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../common/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/systemtap/)
if (HAVE_SYSTEMTAP)
SET(SRC_LIST ${SRC_LIST} systemtap/probes.o)
SET(CLIENT_SRC_LIST ${CLIENT_SRC_LIST} systemtap/probes.o)
endif()
ADD_EXECUTABLE(molten_agent ${SRC_LIST})
ADD_EXECUTABLE(molten_client ${CLIENT_SRC_LIST})
TARGET_LINK_LIBRARIES(molten_agent pthread)
MESSAGE(STATUS "Build over")