-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
175 lines (129 loc) · 3.56 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# Configures CMAKE
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
# Sets the C++ Version
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Configures the project
PROJECT(fsmtp_server C CXX)
# ----
# Compiles the real library's
# ----
# ----
# Compiles the sub libraries
# ----
ADD_LIBRARY(
lib_db STATIC
src/db/cassandra.src.hpp
src/db/cassandra.src.cpp
# The helpers
src/db/mime-helpers.src.cpp
src/db/mime-helpers.src.hpp
)
ADD_LIBRARY(
server STATIC
# Server itself
src/server/server.src.hpp
src/server/server.src.cpp
# The server message parser
src/server/parse-message.src.cpp
src/server/parse-message.src.hpp
# The server commands
src/server/commands.src.cpp
src/server/commands.src.hpp
# The server response header
src/server/responses.src.hpp
# The modules
src/server/modules/esmtp.src.hpp
src/server/modules/esmtp.src.cpp
src/server/modules/esmtp-auth.src.hpp
src/server/modules/esmtp-auth.src.cpp
)
ADD_LIBRARY(
models STATIC
# The email models
src/email.src.cpp
src/email.src.hpp
src/queued-email.src.cpp
src/queued-email.src.hpp
src/inbox-emails-quick-access.src.cpp
src/inbox-emails-quick-access.src.hpp
# The user
src/user.src.cpp
src/user.src.hpp
)
ADD_LIBRARY(
sender STATIC
src/sender/sender.src.cpp
src/sender/sender.src.hpp
)
ADD_LIBRARY(
logger STATIC
src/logger.src.cpp
src/logger.src.hpp
)
ADD_LIBRARY(
parsers STATIC
# The mime parser
src/parsers/mime-parser.src.hpp
src/parsers/mime-parser.src.cpp
)
ADD_LIBRARY(
ossl STATIC
src/ossl/sha1.src.cpp
src/ossl/sha256.src.cpp
src/ossl/ossl.src.hpp
src/ossl/rsa-sha256.src.cpp
)
ADD_LIBRARY(
types STATIC
src/types/mime.src.hpp
)
ADD_LIBRARY(
debug STATIC
src/debug/timer.src.hpp
)
ADD_LIBRARY(
ds_api
src/ds-api/server.src.hpp
src/ds-api/server.src.cpp
)
ADD_LIBRARY(
mailer
# The message composer
src/mailer/mime-composer/mime-composer.src.cpp
src/mailer/mime-composer/mime-composer.src.hpp
src/mailer/mime-composer/generators.src.cpp
src/mailer/mime-composer/generators.src.hpp
# The mailer itself
src/mailer/mailer.src.cpp
src/mailer/mailer.src.hpp
# The commands
src/mailer/commands.src.hpp
src/mailer/commands.src.cpp
# Handles events on the sockets
src/mailer/socket-handler.cpp
src/mailer/socket-handler.hpp
# Resolves DNS crap
src/mailer/resolver.src.cpp
src/mailer/resolver.src.hpp
# Dkim signer
src/mailer/dkim/canonicalization/relaxed.src.cpp
src/mailer/dkim/dkim.src.cpp
src/mailer/dkim/dkim.src.hpp
src/mailer/dkim/parsers.src.cpp
)
SET_TARGET_PROPERTIES(types PROPERTIES LINKER_LANGUAGE CXX)
SET_TARGET_PROPERTIES(debug PROPERTIES LINKER_LANGUAGE CXX)
# The libraries array
SET(libs sender mailer ds_api server parsers models logger lib_db ossl debug)
# ----
# The executable, and linking
# ----
# Creates the main executable
ADD_EXECUTABLE(
${PROJECT_NAME}
main.cpp
mongoose/mongoose.o
)
# Links the libraries
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${binaries} ${libs} -lresolv -lssl -lcrypto -lpthread -lcassandra -lfannst_libcompose -lfannst_libencoding)