]> git.stg.codes - stg.git/blob - stargazer/plugins/CMakeLists.txt
1d205898f9fa8a3c1fca14e2359b686232486e35
[stg.git] / stargazer / plugins / CMakeLists.txt
1 if ( BUILD_MOD_AO )
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 "" )
5 endif ( BUILD_MOD_AO )
6
7 if ( BUILD_MOD_IA )
8     add_library ( mod_auth_ia MODULE authorization/inetaccess/inetaccess.cpp )
9     target_link_libraries ( mod_auth_ia scriptexecuter crypto logger common )
10     set_target_properties ( mod_auth_ia PROPERTIES PREFIX "" )
11     if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
12         set_target_properties ( mod_auth_ia PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
13     endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
14 endif ( BUILD_MOD_IA )
15
16 if ( BUILD_MOD_CAP_NF )
17     add_library ( mod_cap_nf MODULE capture/cap_nf/cap_nf.cpp )
18     target_link_libraries ( mod_cap_nf logger common )
19     set_target_properties ( mod_cap_nf PROPERTIES PREFIX "" )
20 endif ( BUILD_MOD_CAP_NF )
21
22 if ( BUILD_MOD_CAP_DIVERT )
23     add_library ( mod_cap_divert MODULE capture/divert_freebsd/divert_cap.cpp )
24     target_link_libraries ( mod_cap_divert logger common )
25     set_target_properties ( mod_cap_divert PROPERTIES PREFIX "" )
26 endif ( BUILD_MOD_CAP_DIVERT )
27
28 if ( BUILD_MOD_CAP_ETHER_FREEBSD )
29     add_library ( mod_cap_bpf MODULE capture/ether_freebsd/ether_cap.cpp )
30     target_link_libraries ( mod_cap_bpf logger common )
31     set_target_properties ( mod_cap_bpf PROPERTIES PREFIX "" )
32 endif ( BUILD_MOD_CAP_ETHER_FREEBSD )
33
34 if ( BUILD_MOD_CAP_ETHER_LINUX )
35     add_library ( mod_cap_ether MODULE capture/ether_linux/ether_cap.cpp )
36     target_link_libraries ( mod_cap_ether logger common )
37     set_target_properties ( mod_cap_ether PROPERTIES PREFIX "" )
38 endif ( BUILD_MOD_CAP_ETHER_LINUX )
39
40 if ( BUILD_MOD_CAP_PCAP )
41     find_package ( PCap REQUIRED )
42     add_library ( mod_cap_pcap MODULE capture/pcap/pcap_cap.cpp )
43     target_link_libraries ( mod_cap_pcap logger common PCap::PCap )
44     set_target_properties ( mod_cap_pcap PROPERTIES PREFIX "" )
45 endif ( BUILD_MOD_CAP_PCAP )
46
47 if ( BUILD_MOD_CAP_NFQUEUE )
48     find_package ( NFQueue REQUIRED )
49     find_package ( NFNetLink REQUIRED )
50     find_package ( MNL REQUIRED )
51     add_library ( mod_cap_nfqueue MODULE capture/nfqueue/nfqueue.cpp )
52     target_link_libraries ( mod_cap_nfqueue logger common NF::Queue NF::NetLink MNL::MNL )
53     set_target_properties ( mod_cap_nfqueue PROPERTIES PREFIX "" )
54 endif ( BUILD_MOD_CAP_NFQUEUE )
55
56 if ( BUILD_MOD_SGCONFIG )
57     find_package ( EXPAT REQUIRED )
58     add_library ( mod_conf_sg MODULE configuration/sgconfig/stgconfig.cpp
59                                      configuration/sgconfig/conn.cpp
60                                      configuration/sgconfig/configproto.cpp
61                                      configuration/sgconfig/parser.cpp
62                                      configuration/sgconfig/parser_tariffs.cpp
63                                      configuration/sgconfig/parser_admins.cpp
64                                      configuration/sgconfig/parser_users.cpp
65                                      configuration/sgconfig/parser_services.cpp
66                                      configuration/sgconfig/parser_message.cpp
67                                      configuration/sgconfig/parser_auth_by.cpp
68                                      configuration/sgconfig/parser_user_info.cpp
69                                      configuration/sgconfig/parser_server_info.cpp )
70     target_link_libraries ( mod_conf_sg scriptexecuter crypto logger common EXPAT::EXPAT )
71     set_target_properties ( mod_conf_sg PROPERTIES PREFIX "" )
72     if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
73         set_target_properties ( mod_conf_sg PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
74     endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
75 endif ( BUILD_MOD_SGCONFIG )
76
77 if ( BUILD_MOD_RPCCONFIG )
78     find_package ( XMLRPC REQUIRED c++ abyss-server )
79     add_library ( mod_conf_rpc MODULE configuration/rpcconfig/rpcconfig.cpp
80                                       configuration/rpcconfig/user_helper.cpp
81                                       configuration/rpcconfig/tariff_helper.cpp
82                                       configuration/rpcconfig/info_methods.cpp
83                                       configuration/rpcconfig/users_methods.cpp
84                                       configuration/rpcconfig/tariffs_methods.cpp
85                                       configuration/rpcconfig/admins_methods.cpp
86                                       configuration/rpcconfig/messages_methods.cpp )
87     target_link_libraries ( mod_conf_rpc scriptexecuter logger common xmlrpc_server_abyss++ )
88     set_target_properties ( mod_conf_rpc PROPERTIES PREFIX "" )
89 endif ( BUILD_MOD_RPCCONFIG )
90
91 if ( BUILD_MOD_PING )
92     add_library ( mod_ping MODULE other/ping/ping.cpp )
93     target_link_libraries ( mod_ping scriptexecuter logger pinger common )
94     set_target_properties ( mod_ping PROPERTIES PREFIX "" )
95 endif ( BUILD_MOD_PING )
96
97 if ( BUILD_MOD_RADIUS )
98     find_package ( YAJL REQUIRED )
99     add_library ( mod_radius MODULE other/radius/radius.cpp
100                                     other/radius/config.cpp
101                                     other/radius/conn.cpp )
102     target_link_libraries ( mod_radius logger json common YAJL::YAJL )
103     set_target_properties ( mod_radius PROPERTIES PREFIX "" )
104 endif ( BUILD_MOD_RADIUS )
105
106 if ( BUILD_MOD_RSCRYPT )
107     add_library ( mod_remote_script MODULE other/rscript/rscript.cpp other/rscript/nrmap_parser.cpp )
108     target_link_libraries ( mod_remote_script crypto scriptexecuter logger common )
109     set_target_properties ( mod_remote_script PROPERTIES PREFIX "" )
110     if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
111         set_target_properties ( mod_remote_script PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
112     endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
113 endif ( BUILD_MOD_RSCRYPT )
114
115 if ( BUILD_MOD_SMUX )
116     add_library ( mod_smux MODULE other/smux/smux.cpp
117                                   other/smux/sensors.cpp
118                                   other/smux/tables.cpp
119                                   other/smux/handlers.cpp
120                                   other/smux/utils.cpp
121                                   other/smux/types.cpp )
122     target_link_libraries ( mod_smux scriptexecuter logger smux common )
123     set_target_properties ( mod_smux PROPERTIES PREFIX "" )
124 endif ( BUILD_MOD_SMUX )
125
126 if ( BUILD_MOD_STORE_FILES )
127     add_library ( mod_store_files MODULE store/files/file_store.cpp )
128     target_link_libraries ( mod_store_files crypto conffiles logger common )
129     set_target_properties ( mod_store_files PROPERTIES PREFIX "" )
130 endif ( BUILD_MOD_STORE_FILES )
131
132 if ( BUILD_MOD_STORE_FIREBIRD )
133     find_package ( FBClient REQUIRED )
134     add_library ( mod_store_firebird MODULE store/firebird/firebird_store.cpp
135                                             store/firebird/firebird_store_admins.cpp
136                                             store/firebird/firebird_store_corporations.cpp
137                                             store/firebird/firebird_store_messages.cpp
138                                             store/firebird/firebird_store_services.cpp
139                                             store/firebird/firebird_store_tariffs.cpp
140                                             store/firebird/firebird_store_users.cpp
141                                             store/firebird/firebird_store_utils.cpp )
142     target_link_libraries ( mod_store_firebird crypto common logger ibpp FBClient::FBClient )
143     set_target_properties ( mod_store_firebird PROPERTIES PREFIX "" )
144 endif ( BUILD_MOD_STORE_FIREBIRD )
145
146 if ( BUILD_MOD_STORE_MYSQL )
147     find_package ( MySQLConnector REQUIRED )
148     add_library ( mod_store_mysql MODULE store/mysql/mysql_store.cpp )
149     target_link_libraries ( mod_store_mysql crypto logger common MySQL::Connector )
150     set_target_properties ( mod_store_mysql PROPERTIES PREFIX "" )
151 endif ( BUILD_MOD_STORE_MYSQL )
152
153 if ( BUILD_MOD_STORE_POSTGRESQL )
154     find_package ( PostgreSQL REQUIRED )
155     include_directories ( ${PostgreSQL_INCLUDE_DIRS} )
156     add_library ( mod_store_postgresql MODULE store/postgresql/postgresql_store.cpp
157                                               store/postgresql/postgresql_store_admins.cpp
158                                               store/postgresql/postgresql_store_corporations.cpp
159                                               store/postgresql/postgresql_store_messages.cpp
160                                               store/postgresql/postgresql_store_services.cpp
161                                               store/postgresql/postgresql_store_tariffs.cpp
162                                               store/postgresql/postgresql_store_users.cpp
163                                               store/postgresql/postgresql_store_utils.cpp )
164                                       target_link_libraries ( mod_store_postgresql crypto logger common ${PostgreSQL_LIBRARIES} )
165     set_target_properties ( mod_store_postgresql PROPERTIES PREFIX "" )
166 endif ( BUILD_MOD_STORE_POSTGRESQL )