-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·90 lines (62 loc) · 2.12 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
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 2.8)
project(newframework C CXX)
set(CXX_FLAGS
-g
# -DVALGRIND
-DMUDUO_STD_STRING
-DCHECK_PTHREAD_RETURN_VALUE
-D_FILE_OFFSET_BITS=64
-Wall
-Wextra
-Werror
-Wconversion
-Wno-unused-parameter
-Wold-style-cast
-Woverloaded-virtual
-Wpointer-arith
-Wshadow
-Wwrite-strings
-march=native
# -MMD
# -std=c++0x
-std=c++11
-rdynamic
)
file(GLOB_RECURSE CURRENT_HEADERS *.h *.hpp *.cpp)
source_group("Include" FILES ${CURRENT_HEADERS})
option( _debug "Debug option" ON )
include_directories("${CMAKE_SOURCE_DIR}")
include_directories(${CMAKE_SOURCE_DIR}/thirdpart/rapidjson)
include_directories(${CMAKE_SOURCE_DIR}/thirdpart/thrift/thrift-0.9.3)
include_directories(${CMAKE_SOURCE_DIR}/thirdpart/thrift/thrift-0.9.3/lib/cpp/src)
aux_source_directory(. SRC_LIST)
aux_source_directory(./muduo/base BASE_LIST)
aux_source_directory(./muduo/net NET_LIST)
aux_source_directory(./muduo/net/poller POLLER_LIST)
#aux_source_directory(./poco POCO_LIST)
#add_executable(${PROJECT_NAME} ${SRC_LIST} ${BASE_LIST} ${NET_LIST} ${POLLER_LIST} )
link_directories(${LIBRARY_OUTPUT_PATH})
#link_directories(/usr/lib)
link_directories(/usr/local/lib)
link_directories(/opt/openssl/lib/)
add_subdirectory(thirdpart/thrift)
add_subdirectory(muduo/base)
add_subdirectory(muduo/net)
add_subdirectory(examples)
message("==> CMAKE_SOURCE_DIR")
message(${CMAKE_SOURCE_DIR})
message("==> CMAKE_SOURCE_DIR")
#target_link_libraries(${PROJECT_NAME} uuid pthread log4cplus boost_thread boost_system boost_filesystem )
#target_link_libraries(${PROJECT_NAME} boost_system rt mysqlcppconn )
# if(_debug)
# message("here, build debug version")
# add_definitions(-D_DEBUG_)
# #-std=c++11
# set(CMAKE_BUILD_TYPE Debug)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wno-deprecated -std=c++11")
# # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wno-deprecated ")
# else()
# message("here, build release version")
# set(CMAKE_BUILD_TYPE Release)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-deprecated -std=c++11")
# endif()