-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
160 lines (135 loc) · 5.34 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
cmake_minimum_required(VERSION 3.2)
project(quicksave)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "-ggdb -O2 -fsanitize=address -I/usr/local/include/antlr4-runtime -L/usr/local/lib")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/generated)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/fuse)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/shared)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/shared/io_quicksave_libbeans)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/rapidjson/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/googletest/googletest/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/googletest/googlemock/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/rabbitmq-c/librabbitmq)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/rabbitmq-c-utils)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/sha1)
#TODO
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/PrivacyGuard)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/abseil)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/cctz/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/io_quicksave_qsql/cppqsql/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/io_quicksave_qsql/cppqsql/generated)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/io_quicksave_libbeans/cppbeans/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/libmemcached)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/sqlpp11/deps/date/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/sqlpp11/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/sqlpp11-connector-sqlite3/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/sqlpp11-connector-postgresql/include)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/sqlpp11)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/sqlpp11-connector-sqlite3)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/sqlpp11-connector-postgresql)
include_directories(/usr/include/python3.6m)
include_directories(/usr/local/include/python3.6m)
include_directories(/usr/include/antlr4-runtime)
SET(CORE_LIBRARIES dl util pthread)
SET(BASE_LIBRARIES glog gflags folly abseil)
SET(DBMS_LIBRARIES sqlpp11-connector-postgresql pq sqlpp11-connector-sqlite3 sqlite3 sqlpp11)
SET(HTTP_LIBRARIES proxygenhttpserver )
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/googletest)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/rabbitmq-c)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/rabbitmq-c-utils)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/sha1)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/deps/libmemcached)
ADD_DEFINITIONS(-DSQLITE_THREADSAFE=1 -Wl,--export-dynamic)
FILE(GLOB_RECURSE PROJECT_QSQL ${CMAKE_CURRENT_SOURCE_DIR}/deps/io_quicksave_qsql/cppqsql/generated/qsql/**.cpp)
ADD_LIBRARY(qsql ${PROJECT_QSQL})
TARGET_LINK_LIBRARIES(qsql dl antlr4-runtime)
FILE(GLOB_RECURSE PROJECT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/api/**.cc)
FILE(GLOB_RECURSE PROJECT_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/source/**.h)
ADD_EXECUTABLE(api
${PROJECT_SOURCES}
${PROJECT_HEADERS})
TARGET_LINK_LIBRARIES(api
qsql antlr4-runtime
libpython3.6m.so
memcached
sha1
stdc++fs
uuid
${CORE_LIBRARIES}
${BASE_LIBRARIES}
${DBMS_LIBRARIES}
${HTTP_LIBRARIES}
)
ADD_EXECUTABLE(cdn cdn/cdn.cc)
TARGET_LINK_LIBRARIES(cdn
memcached
stdc++fs
${CORE_LIBRARIES}
${BASE_LIBRARIES}
${DBMS_LIBRARIES}
${HTTP_LIBRARIES}
)
ADD_EXECUTABLE(oauth oauth/oauth.cc)
TARGET_LINK_LIBRARIES(oauth
memcached
uuid
${CORE_LIBRARIES}
${BASE_LIBRARIES}
${DBMS_LIBRARIES}
${HTTP_LIBRARIES}
)
ADD_EXECUTABLE(post post/post.cc)
TARGET_LINK_LIBRARIES(post
rabbitmq-static
rabbitmq-c-utils
sha1
${CORE_LIBRARIES}
${BASE_LIBRARIES}
${DBMS_LIBRARIES}
${HTTP_LIBRARIES}
)
FILE(GLOB_RECURSE UNIT_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/unit_test/**.cc)
ADD_EXECUTABLE(unit_test ${UNIT_TESTS})
TARGET_LINK_LIBRARIES(unit_test ${PROJECT_LIBRARIES} python3.6m sha1 antlr4-runtime qsql
gtest gmock
curl
uuid
${CORE_LIBRARIES}
${BASE_LIBRARIES}
${DBMS_LIBRARIES}
${HTTP_LIBRARIES}
)
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
FILE(GLOB_RECURSE FUSE_MAIN ${CMAKE_CURRENT_SOURCE_DIR}/fuse/**.cc)
ADD_EXECUTABLE(qsfuse ${FUSE_MAIN})
TARGET_LINK_LIBRARIES(qsfuse
fuse
qsql antlr4-runtime
libpython3.6m.so
memcached
sha1
stdc++fs
${CORE_LIBRARIES}
${BASE_LIBRARIES}
${DBMS_LIBRARIES}
${HTTP_LIBRARIES}
)
FILE(GLOB_RECURSE FUSE_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/fuse_test/**.cc)
FILE(GLOB_RECURSE FUSE_HEAD ${CMAKE_CURRENT_SOURCE_DIR}/fuse/**.h)
ADD_EXECUTABLE(fuse_test ${FUSE_TESTS} ${FUSE_HEAD})
TARGET_LINK_LIBRARIES(fuse_test ${PROJECT_LIBRARIES}
fuse
gtest gmock
qsql antlr4-runtime
libpython3.6m.so
memcached
sha1
stdc++fs
${CORE_LIBRARIES}
${BASE_LIBRARIES}
${DBMS_LIBRARIES}
${HTTP_LIBRARIES}
)