2 add_library ( mod_auth_ao MODULE authorization/ao/ao.cpp )
3 target_link_libraries ( mod_auth_ao scriptexecuter logger common )
4 set_target_properties ( mod_auth_ao PROPERTIES PREFIX "" )
7 set_target_properties ( mod_auth_ao PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
9 if ( INCLUDE_WHAT_YOU_USE_EXE )
10 set_target_properties ( mod_auth_ao PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
12 endif ( BUILD_MOD_AO )
14 if ( BUILD_MOD_RADIUS )
15 add_library ( mod_radius MODULE other/radius/radius.cpp )
16 target_link_libraries ( mod_radius scriptexecuter logger common )
17 set_target_properties ( mod_radius PROPERTIES PREFIX "" )
20 set_target_properties ( mod_radius PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
22 if ( INCLUDE_WHAT_YOU_USE_EXE )
23 set_target_properties ( mod_radius PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
25 endif ( BUILD_MOD_RADIUS )
28 add_library ( mod_auth_ia MODULE authorization/inetaccess/inetaccess.cpp )
29 target_link_libraries ( mod_auth_ia scriptexecuter crypto logger common )
30 set_target_properties ( mod_auth_ia PROPERTIES PREFIX "" )
31 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
32 set_target_properties ( mod_auth_ia PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
33 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
36 set_target_properties ( mod_auth_ia PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
38 if ( INCLUDE_WHAT_YOU_USE_EXE )
39 set_target_properties ( mod_auth_ia PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
41 endif ( BUILD_MOD_IA )
43 if ( BUILD_MOD_CAP_NF )
44 add_library ( mod_cap_nf MODULE capture/cap_nf/cap_nf.cpp )
45 target_link_libraries ( mod_cap_nf logger common )
46 set_target_properties ( mod_cap_nf PROPERTIES PREFIX "" )
49 set_target_properties ( mod_cap_nf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
51 if ( INCLUDE_WHAT_YOU_USE_EXE )
52 set_target_properties ( mod_cap_nf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
54 endif ( BUILD_MOD_CAP_NF )
56 if ( BUILD_MOD_CAP_DIVERT )
57 add_library ( mod_cap_divert MODULE capture/divert_freebsd/divert_cap.cpp )
58 target_link_libraries ( mod_cap_divert logger common )
59 set_target_properties ( mod_cap_divert PROPERTIES PREFIX "" )
62 set_target_properties ( mod_cap_divert PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
64 if ( INCLUDE_WHAT_YOU_USE_EXE )
65 set_target_properties ( mod_cap_divert PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
67 endif ( BUILD_MOD_CAP_DIVERT )
69 if ( BUILD_MOD_CAP_ETHER_FREEBSD )
70 add_library ( mod_cap_bpf MODULE capture/ether_freebsd/ether_cap.cpp )
71 target_link_libraries ( mod_cap_bpf logger common )
72 set_target_properties ( mod_cap_bpf PROPERTIES PREFIX "" )
75 set_target_properties ( mod_cap_bpf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
77 if ( INCLUDE_WHAT_YOU_USE_EXE )
78 set_target_properties ( mod_cap_bpf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
80 endif ( BUILD_MOD_CAP_ETHER_FREEBSD )
82 if ( BUILD_MOD_CAP_ETHER_LINUX )
83 add_library ( mod_cap_ether MODULE capture/ether_linux/ether_cap.cpp )
84 target_link_libraries ( mod_cap_ether logger common )
85 set_target_properties ( mod_cap_ether PROPERTIES PREFIX "" )
88 set_target_properties ( mod_cap_ether PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
90 if ( INCLUDE_WHAT_YOU_USE_EXE )
91 set_target_properties ( mod_cap_ether PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
93 endif ( BUILD_MOD_CAP_ETHER_LINUX )
95 if ( BUILD_MOD_CAP_PCAP )
96 find_package ( PCap REQUIRED )
97 add_library ( mod_cap_pcap MODULE capture/pcap/pcap_cap.cpp )
98 target_link_libraries ( mod_cap_pcap logger common PCap::PCap )
99 set_target_properties ( mod_cap_pcap PROPERTIES PREFIX "" )
101 if ( CLANG_TIDY_EXE )
102 set_target_properties ( mod_cap_pcap PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
104 if ( INCLUDE_WHAT_YOU_USE_EXE )
105 set_target_properties ( mod_cap_pcap PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
107 endif ( BUILD_MOD_CAP_PCAP )
109 if ( BUILD_MOD_CAP_NFQUEUE )
110 find_package ( NFQueue REQUIRED )
111 find_package ( NFNetLink REQUIRED )
112 find_package ( MNL REQUIRED )
113 add_library ( mod_cap_nfqueue MODULE capture/nfqueue/nfqueue.cpp )
114 target_link_libraries ( mod_cap_nfqueue logger common NF::Queue NF::NetLink MNL::MNL )
115 set_target_properties ( mod_cap_nfqueue PROPERTIES PREFIX "" )
117 if ( CLANG_TIDY_EXE )
118 set_target_properties ( mod_cap_nfqueue PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
120 if ( INCLUDE_WHAT_YOU_USE_EXE )
121 set_target_properties ( mod_cap_nfqueue PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
123 endif ( BUILD_MOD_CAP_NFQUEUE )
125 if ( BUILD_MOD_SGCONFIG )
126 find_package ( EXPAT REQUIRED )
127 add_library ( mod_conf_sg MODULE configuration/sgconfig/stgconfig.cpp
128 configuration/sgconfig/conn.cpp
129 configuration/sgconfig/configproto.cpp
130 configuration/sgconfig/parser.cpp
131 configuration/sgconfig/parser_tariffs.cpp
132 configuration/sgconfig/parser_admins.cpp
133 configuration/sgconfig/parser_users.cpp
134 configuration/sgconfig/parser_services.cpp
135 configuration/sgconfig/parser_message.cpp
136 configuration/sgconfig/parser_auth_by.cpp
137 configuration/sgconfig/parser_user_info.cpp
138 configuration/sgconfig/parser_server_info.cpp )
139 target_link_libraries ( mod_conf_sg scriptexecuter crypto logger common EXPAT::EXPAT )
140 set_target_properties ( mod_conf_sg PROPERTIES PREFIX "" )
141 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
142 set_target_properties ( mod_conf_sg PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
143 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
145 if ( CLANG_TIDY_EXE )
146 set_target_properties ( mod_conf_sg PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
148 if ( INCLUDE_WHAT_YOU_USE_EXE )
149 set_target_properties ( mod_conf_sg PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
151 endif ( BUILD_MOD_SGCONFIG )
153 if ( BUILD_MOD_RPCCONFIG )
154 find_package ( XMLRPC 1.58.0 REQUIRED c++2 abyss-server )
155 try_compile ( XMLRPC_C_NO_AUTO_PTR ${CMAKE_CURRENT_BINARY_DIR} "${PROJECT_SOURCE_DIR}/checks/xmlrpc-c-auto_ptr.cpp" CMAKE_FLAGS -DINCLUDE_DIRECTORIES=${XMLRPC_INCLUDE_DIRS} LINK_LIBRARIES ${XMLRPC_LIBRARIES} OUTPUT_VARIABLE TRY_COMPILE_OUTPUT )
156 if ( NOT XMLRPC_C_NO_AUTO_PTR )
157 message ( WARNING ${TRY_COMPILE_OUTPUT} )
158 message ( FATAL_ERROR "Your version of XMLRPC-C library can not be used with C++17. Try upgrading to at least 1.58.0." )
160 include_directories ( ${XMLRPC_INCLUDE_DIRS} )
161 add_library ( mod_conf_rpc MODULE configuration/rpcconfig/rpcconfig.cpp
162 configuration/rpcconfig/user_helper.cpp
163 configuration/rpcconfig/tariff_helper.cpp
164 configuration/rpcconfig/info_methods.cpp
165 configuration/rpcconfig/users_methods.cpp
166 configuration/rpcconfig/tariffs_methods.cpp
167 configuration/rpcconfig/admins_methods.cpp
168 configuration/rpcconfig/messages_methods.cpp )
169 target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} )
170 set_target_properties ( mod_conf_rpc PROPERTIES PREFIX "" )
171 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
172 set_target_properties ( mod_conf_rpc PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
173 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
175 if ( CLANG_TIDY_EXE )
176 set_target_properties ( mod_conf_rpc PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
178 if ( INCLUDE_WHAT_YOU_USE_EXE )
179 set_target_properties ( mod_conf_rpc PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
181 endif ( BUILD_MOD_RPCCONFIG )
183 if ( BUILD_MOD_PING )
184 add_library ( mod_ping MODULE other/ping/ping.cpp )
185 target_link_libraries ( mod_ping scriptexecuter logger pinger common )
186 set_target_properties ( mod_ping PROPERTIES PREFIX "" )
188 if ( CLANG_TIDY_EXE )
189 set_target_properties ( mod_ping PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
191 if ( INCLUDE_WHAT_YOU_USE_EXE )
192 set_target_properties ( mod_ping PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
194 endif ( BUILD_MOD_PING )
196 if ( BUILD_MOD_RSCRYPT )
197 add_library ( mod_remote_script MODULE other/rscript/rscript.cpp other/rscript/nrmap_parser.cpp )
198 target_link_libraries ( mod_remote_script crypto scriptexecuter logger common )
199 set_target_properties ( mod_remote_script PROPERTIES PREFIX "" )
200 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
201 set_target_properties ( mod_remote_script PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
202 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
204 if ( CLANG_TIDY_EXE )
205 set_target_properties ( mod_remote_script PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
207 if ( INCLUDE_WHAT_YOU_USE_EXE )
208 set_target_properties ( mod_remote_script PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
210 endif ( BUILD_MOD_RSCRYPT )
212 if ( BUILD_MOD_SMUX )
213 add_library ( mod_smux MODULE other/smux/smux.cpp
214 other/smux/sensors.cpp
215 other/smux/tables.cpp
216 other/smux/handlers.cpp
218 other/smux/types.cpp )
219 target_link_libraries ( mod_smux scriptexecuter logger smux common )
220 set_target_properties ( mod_smux PROPERTIES PREFIX "" )
222 if ( CLANG_TIDY_EXE )
223 set_target_properties ( mod_smux PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
225 if ( INCLUDE_WHAT_YOU_USE_EXE )
226 set_target_properties ( mod_smux PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
228 endif ( BUILD_MOD_SMUX )
230 if ( BUILD_MOD_STORE_FILES )
231 add_library ( mod_store_files MODULE store/files/file_store.cpp )
232 target_link_libraries ( mod_store_files crypto conffiles logger common )
233 set_target_properties ( mod_store_files PROPERTIES PREFIX "" )
235 if ( CLANG_TIDY_EXE )
236 set_target_properties ( mod_store_files PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
238 if ( INCLUDE_WHAT_YOU_USE_EXE )
239 set_target_properties ( mod_store_files PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
241 endif ( BUILD_MOD_STORE_FILES )
243 if ( BUILD_MOD_STORE_FIREBIRD )
244 find_package ( FBClient REQUIRED )
245 add_library ( mod_store_firebird MODULE store/firebird/firebird_store.cpp
246 store/firebird/firebird_store_admins.cpp
247 store/firebird/firebird_store_corporations.cpp
248 store/firebird/firebird_store_messages.cpp
249 store/firebird/firebird_store_services.cpp
250 store/firebird/firebird_store_tariffs.cpp
251 store/firebird/firebird_store_users.cpp
252 store/firebird/firebird_store_utils.cpp )
253 target_link_libraries ( mod_store_firebird crypto common logger ibpp FBClient::FBClient )
254 set_target_properties ( mod_store_firebird PROPERTIES PREFIX "" )
256 if ( CLANG_TIDY_EXE )
257 set_target_properties ( mod_store_firebird PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
259 if ( INCLUDE_WHAT_YOU_USE_EXE )
260 set_target_properties ( mod_store_firebird PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
262 endif ( BUILD_MOD_STORE_FIREBIRD )
264 if ( BUILD_MOD_STORE_MYSQL )
265 find_package ( MySQLConnector REQUIRED )
266 add_library ( mod_store_mysql MODULE store/mysql/mysql_store.cpp )
267 target_link_libraries ( mod_store_mysql crypto logger common MySQL::Connector )
268 set_target_properties ( mod_store_mysql PROPERTIES PREFIX "" )
270 if ( CLANG_TIDY_EXE )
271 set_target_properties ( mod_store_mysql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
273 if ( INCLUDE_WHAT_YOU_USE_EXE )
274 set_target_properties ( mod_store_mysql PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
276 endif ( BUILD_MOD_STORE_MYSQL )
278 if ( BUILD_MOD_STORE_POSTGRESQL )
279 find_package ( PostgreSQL REQUIRED )
280 include_directories ( ${PostgreSQL_INCLUDE_DIRS} )
281 add_library ( mod_store_postgresql MODULE store/postgresql/postgresql_store.cpp
282 store/postgresql/postgresql_store_admins.cpp
283 store/postgresql/postgresql_store_corporations.cpp
284 store/postgresql/postgresql_store_messages.cpp
285 store/postgresql/postgresql_store_services.cpp
286 store/postgresql/postgresql_store_tariffs.cpp
287 store/postgresql/postgresql_store_users.cpp
288 store/postgresql/postgresql_store_utils.cpp )
289 target_link_libraries ( mod_store_postgresql crypto logger common ${PostgreSQL_LIBRARIES} )
290 set_target_properties ( mod_store_postgresql PROPERTIES PREFIX "" )
291 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
292 set_target_properties ( mod_store_postgresql PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
293 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
295 if ( CLANG_TIDY_EXE )
296 set_target_properties ( mod_store_postgresql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
298 if ( INCLUDE_WHAT_YOU_USE_EXE )
299 set_target_properties ( mod_store_postgresql PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
301 endif ( BUILD_MOD_STORE_POSTGRESQL )