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 find_package ( Boost REQUIRED )
17 add_library ( mod_radius MODULE other/radius/radius.cpp
18 other/radius/server.cpp)
19 target_link_libraries ( mod_radius PRIVATE scriptexecuter logger common )
20 set_target_properties ( mod_radius PROPERTIES PREFIX "" )
22 include ( ExternalProject )
24 ExternalProject_Add ( async-radius
25 GIT_REPOSITORY https://github.com/madf/async-radius.git
29 CMAKE_ARGS -DCMAKE_CXX_FLAGS=-fPIC )
31 ExternalProject_Get_property ( async-radius SOURCE_DIR BINARY_DIR )
33 target_include_directories ( mod_radius PRIVATE "${SOURCE_DIR}/include" )
34 target_link_directories ( mod_radius PRIVATE "${BINARY_DIR}/src" )
36 add_dependencies ( mod_radius async-radius )
38 find_package ( OpenSSL 1.0.0 REQUIRED )
39 target_link_libraries ( mod_radius PRIVATE radproto Boost::boost OpenSSL::Crypto)
42 set_target_properties ( mod_radius PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
44 if ( INCLUDE_WHAT_YOU_USE_EXE )
45 set_target_properties ( mod_radius PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
47 endif ( BUILD_MOD_RADIUS )
50 add_library ( mod_auth_ia MODULE authorization/inetaccess/inetaccess.cpp )
51 target_link_libraries ( mod_auth_ia scriptexecuter crypto logger common )
52 set_target_properties ( mod_auth_ia PROPERTIES PREFIX "" )
53 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
54 set_target_properties ( mod_auth_ia PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
55 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
58 set_target_properties ( mod_auth_ia PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
60 if ( INCLUDE_WHAT_YOU_USE_EXE )
61 set_target_properties ( mod_auth_ia PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
63 endif ( BUILD_MOD_IA )
65 if ( BUILD_MOD_CAP_NF )
66 add_library ( mod_cap_nf MODULE capture/cap_nf/cap_nf.cpp )
67 target_link_libraries ( mod_cap_nf logger common )
68 set_target_properties ( mod_cap_nf PROPERTIES PREFIX "" )
71 set_target_properties ( mod_cap_nf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
73 if ( INCLUDE_WHAT_YOU_USE_EXE )
74 set_target_properties ( mod_cap_nf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
76 endif ( BUILD_MOD_CAP_NF )
78 if ( BUILD_MOD_CAP_DIVERT )
79 add_library ( mod_cap_divert MODULE capture/divert_freebsd/divert_cap.cpp )
80 target_link_libraries ( mod_cap_divert logger common )
81 set_target_properties ( mod_cap_divert PROPERTIES PREFIX "" )
84 set_target_properties ( mod_cap_divert PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
86 if ( INCLUDE_WHAT_YOU_USE_EXE )
87 set_target_properties ( mod_cap_divert PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
89 endif ( BUILD_MOD_CAP_DIVERT )
91 if ( BUILD_MOD_CAP_ETHER_FREEBSD )
92 add_library ( mod_cap_bpf MODULE capture/ether_freebsd/ether_cap.cpp )
93 target_link_libraries ( mod_cap_bpf logger common )
94 set_target_properties ( mod_cap_bpf PROPERTIES PREFIX "" )
97 set_target_properties ( mod_cap_bpf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
99 if ( INCLUDE_WHAT_YOU_USE_EXE )
100 set_target_properties ( mod_cap_bpf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
102 endif ( BUILD_MOD_CAP_ETHER_FREEBSD )
104 if ( BUILD_MOD_CAP_ETHER_LINUX )
105 add_library ( mod_cap_ether MODULE capture/ether_linux/ether_cap.cpp )
106 target_link_libraries ( mod_cap_ether logger common )
107 set_target_properties ( mod_cap_ether PROPERTIES PREFIX "" )
109 if ( CLANG_TIDY_EXE )
110 set_target_properties ( mod_cap_ether PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
112 if ( INCLUDE_WHAT_YOU_USE_EXE )
113 set_target_properties ( mod_cap_ether PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
115 endif ( BUILD_MOD_CAP_ETHER_LINUX )
117 if ( BUILD_MOD_CAP_PCAP )
118 find_package ( PCap REQUIRED )
119 add_library ( mod_cap_pcap MODULE capture/pcap/pcap_cap.cpp )
120 target_link_libraries ( mod_cap_pcap logger common PCap::PCap )
121 set_target_properties ( mod_cap_pcap PROPERTIES PREFIX "" )
123 if ( CLANG_TIDY_EXE )
124 set_target_properties ( mod_cap_pcap PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
126 if ( INCLUDE_WHAT_YOU_USE_EXE )
127 set_target_properties ( mod_cap_pcap PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
129 endif ( BUILD_MOD_CAP_PCAP )
131 if ( BUILD_MOD_CAP_NFQUEUE )
132 find_package ( NFQueue REQUIRED )
133 find_package ( NFNetLink REQUIRED )
134 find_package ( MNL REQUIRED )
135 add_library ( mod_cap_nfqueue MODULE capture/nfqueue/nfqueue.cpp )
136 target_link_libraries ( mod_cap_nfqueue logger common NF::Queue NF::NetLink MNL::MNL )
137 set_target_properties ( mod_cap_nfqueue PROPERTIES PREFIX "" )
139 if ( CLANG_TIDY_EXE )
140 set_target_properties ( mod_cap_nfqueue PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
142 if ( INCLUDE_WHAT_YOU_USE_EXE )
143 set_target_properties ( mod_cap_nfqueue PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
145 endif ( BUILD_MOD_CAP_NFQUEUE )
147 if ( BUILD_MOD_SGCONFIG )
148 find_package ( EXPAT REQUIRED )
149 add_library ( mod_conf_sg MODULE configuration/sgconfig/stgconfig.cpp
150 configuration/sgconfig/conn.cpp
151 configuration/sgconfig/configproto.cpp
152 configuration/sgconfig/parser.cpp
153 configuration/sgconfig/parser_tariffs.cpp
154 configuration/sgconfig/parser_admins.cpp
155 configuration/sgconfig/parser_users.cpp
156 configuration/sgconfig/parser_services.cpp
157 configuration/sgconfig/parser_message.cpp
158 configuration/sgconfig/parser_auth_by.cpp
159 configuration/sgconfig/parser_user_info.cpp
160 configuration/sgconfig/parser_server_info.cpp )
161 target_link_libraries ( mod_conf_sg scriptexecuter crypto logger common EXPAT::EXPAT )
162 set_target_properties ( mod_conf_sg PROPERTIES PREFIX "" )
163 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
164 set_target_properties ( mod_conf_sg PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
165 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
167 if ( CLANG_TIDY_EXE )
168 set_target_properties ( mod_conf_sg PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
170 if ( INCLUDE_WHAT_YOU_USE_EXE )
171 set_target_properties ( mod_conf_sg PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
173 endif ( BUILD_MOD_SGCONFIG )
175 if ( BUILD_MOD_RPCCONFIG )
176 find_package ( XMLRPC 1.58.0 REQUIRED c++2 abyss-server )
177 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 )
178 if ( NOT XMLRPC_C_NO_AUTO_PTR )
179 message ( WARNING ${TRY_COMPILE_OUTPUT} )
180 message ( FATAL_ERROR "Your version of XMLRPC-C library can not be used with C++17. Try upgrading to at least 1.58.0." )
182 include_directories ( ${XMLRPC_INCLUDE_DIRS} )
183 add_library ( mod_conf_rpc MODULE configuration/rpcconfig/rpcconfig.cpp
184 configuration/rpcconfig/user_helper.cpp
185 configuration/rpcconfig/tariff_helper.cpp
186 configuration/rpcconfig/info_methods.cpp
187 configuration/rpcconfig/users_methods.cpp
188 configuration/rpcconfig/tariffs_methods.cpp
189 configuration/rpcconfig/admins_methods.cpp
190 configuration/rpcconfig/messages_methods.cpp )
191 target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} )
192 set_target_properties ( mod_conf_rpc PROPERTIES PREFIX "" )
193 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
194 set_target_properties ( mod_conf_rpc PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
195 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
197 if ( CLANG_TIDY_EXE )
198 set_target_properties ( mod_conf_rpc PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
200 if ( INCLUDE_WHAT_YOU_USE_EXE )
201 set_target_properties ( mod_conf_rpc PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
203 endif ( BUILD_MOD_RPCCONFIG )
205 if ( BUILD_MOD_PING )
206 add_library ( mod_ping MODULE other/ping/ping.cpp )
207 target_link_libraries ( mod_ping scriptexecuter logger pinger common )
208 set_target_properties ( mod_ping PROPERTIES PREFIX "" )
210 if ( CLANG_TIDY_EXE )
211 set_target_properties ( mod_ping PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
213 if ( INCLUDE_WHAT_YOU_USE_EXE )
214 set_target_properties ( mod_ping PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
216 endif ( BUILD_MOD_PING )
218 if ( BUILD_MOD_RSCRYPT )
219 add_library ( mod_remote_script MODULE other/rscript/rscript.cpp other/rscript/nrmap_parser.cpp )
220 target_link_libraries ( mod_remote_script crypto scriptexecuter logger common )
221 set_target_properties ( mod_remote_script PROPERTIES PREFIX "" )
222 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
223 set_target_properties ( mod_remote_script PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
224 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
226 if ( CLANG_TIDY_EXE )
227 set_target_properties ( mod_remote_script PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
229 if ( INCLUDE_WHAT_YOU_USE_EXE )
230 set_target_properties ( mod_remote_script PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
232 endif ( BUILD_MOD_RSCRYPT )
234 if ( BUILD_MOD_SMUX )
235 add_library ( mod_smux MODULE other/smux/smux.cpp
236 other/smux/sensors.cpp
237 other/smux/tables.cpp
238 other/smux/handlers.cpp
240 other/smux/types.cpp )
241 target_link_libraries ( mod_smux scriptexecuter logger smux common )
242 set_target_properties ( mod_smux PROPERTIES PREFIX "" )
244 if ( CLANG_TIDY_EXE )
245 set_target_properties ( mod_smux PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
247 if ( INCLUDE_WHAT_YOU_USE_EXE )
248 set_target_properties ( mod_smux PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
250 endif ( BUILD_MOD_SMUX )
252 if ( BUILD_MOD_STORE_FILES )
253 add_library ( mod_store_files MODULE store/files/file_store.cpp )
254 target_link_libraries ( mod_store_files crypto conffiles logger common )
255 set_target_properties ( mod_store_files PROPERTIES PREFIX "" )
257 if ( CLANG_TIDY_EXE )
258 set_target_properties ( mod_store_files PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
260 if ( INCLUDE_WHAT_YOU_USE_EXE )
261 set_target_properties ( mod_store_files PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
263 endif ( BUILD_MOD_STORE_FILES )
265 if ( BUILD_MOD_STORE_FIREBIRD )
266 find_package ( FBClient REQUIRED )
267 add_library ( mod_store_firebird MODULE store/firebird/firebird_store.cpp
268 store/firebird/firebird_store_admins.cpp
269 store/firebird/firebird_store_corporations.cpp
270 store/firebird/firebird_store_messages.cpp
271 store/firebird/firebird_store_services.cpp
272 store/firebird/firebird_store_tariffs.cpp
273 store/firebird/firebird_store_users.cpp
274 store/firebird/firebird_store_utils.cpp )
275 target_link_libraries ( mod_store_firebird crypto common logger ibpp FBClient::FBClient )
276 set_target_properties ( mod_store_firebird PROPERTIES PREFIX "" )
278 if ( CLANG_TIDY_EXE )
279 set_target_properties ( mod_store_firebird PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
281 if ( INCLUDE_WHAT_YOU_USE_EXE )
282 set_target_properties ( mod_store_firebird PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
284 endif ( BUILD_MOD_STORE_FIREBIRD )
286 if ( BUILD_MOD_STORE_MYSQL )
287 find_package ( MySQLConnector REQUIRED )
288 add_library ( mod_store_mysql MODULE store/mysql/mysql_store.cpp )
289 target_link_libraries ( mod_store_mysql crypto logger common MySQL::Connector )
290 set_target_properties ( mod_store_mysql PROPERTIES PREFIX "" )
292 if ( CLANG_TIDY_EXE )
293 set_target_properties ( mod_store_mysql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
295 if ( INCLUDE_WHAT_YOU_USE_EXE )
296 set_target_properties ( mod_store_mysql PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
298 endif ( BUILD_MOD_STORE_MYSQL )
300 if ( BUILD_MOD_STORE_POSTGRESQL )
301 find_package ( PostgreSQL REQUIRED )
302 include_directories ( ${PostgreSQL_INCLUDE_DIRS} )
303 add_library ( mod_store_postgresql MODULE store/postgresql/postgresql_store.cpp
304 store/postgresql/postgresql_store_admins.cpp
305 store/postgresql/postgresql_store_corporations.cpp
306 store/postgresql/postgresql_store_messages.cpp
307 store/postgresql/postgresql_store_services.cpp
308 store/postgresql/postgresql_store_tariffs.cpp
309 store/postgresql/postgresql_store_users.cpp
310 store/postgresql/postgresql_store_utils.cpp )
311 target_link_libraries ( mod_store_postgresql crypto logger common ${PostgreSQL_LIBRARIES} )
312 set_target_properties ( mod_store_postgresql PROPERTIES PREFIX "" )
313 if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
314 set_target_properties ( mod_store_postgresql PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
315 endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
317 if ( CLANG_TIDY_EXE )
318 set_target_properties ( mod_store_postgresql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
320 if ( INCLUDE_WHAT_YOU_USE_EXE )
321 set_target_properties ( mod_store_postgresql PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
323 endif ( BUILD_MOD_STORE_POSTGRESQL )