vom: Add ip punt redirect
[vpp.git] / extras / vom / vom / CMakeLists.txt
1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 unset (VAPICLIENT_LIB)
15 unset (ACL_FILE)
16 unset (NAT_FILE)
17 unset (L2E_FILE)
18 unset (GBP_FILE)
19 unset (VOM_SOURCES)
20 unset (VOM_HEADERS)
21
22 find_library(VAPICLIENT_LIB NAMES vapiclient REQUIRED)
23 find_path(VAPICLIENT_INCLUDE_DIR NAMES vapi/vapi.hpp)
24
25 if(NOT VAPICLIENT_INCLUDE_DIR OR NOT VAPICLIENT_LIB)
26   message(FATAL_ERROR "Cannot find vapiclient library and/or headers")
27 endif()
28
29 include_directories(${VAPICLIENT_INCLUDE_DIR})
30 include_directories(${CMAKE_SOURCE_DIR})
31
32 find_file(ACL_FILE NAMES acl.api.vapi.hpp PATH_SUFFIXES vapi)
33 find_file(NAT_FILE NAMES nat.api.vapi.hpp PATH_SUFFIXES vapi)
34 find_file(L2E_FILE NAMES l2e.api.vapi.hpp PATH_SUFFIXES vapi)
35 find_file(GBP_FILE NAMES gbp.api.vapi.hpp PATH_SUFFIXES vapi)
36
37 if(ACL_FILE)
38   list(APPEND VOM_SOURCES
39     acl_binding_cmds.cpp
40     acl_binding.cpp
41     acl_ethertype_cmds.cpp
42     acl_ethertype.cpp
43     acl_l2_rule.cpp
44     acl_l3_rule.cpp
45     acl_list_cmds.cpp
46     acl_list.cpp
47     acl_types.cpp
48   )
49 endif()
50
51 if(NAT_FILE)
52   list(APPEND VOM_SOURCES
53     nat_static.cpp
54     nat_static_cmds.cpp
55     nat_binding.cpp
56     nat_binding_cmds.cpp
57   )
58 endif()
59
60 if (L2E_FILE)
61   list(APPEND VOM_SOURCES
62     l2_emulation_cmds.cpp
63     l2_emulation.cpp
64   )
65 endif()
66
67 if(GBP_FILE)
68   list(APPEND VOM_SOURCES
69     gbp_recirc_cmds.cpp
70     gbp_recirc.cpp
71     gbp_subnet_cmds.cpp
72     gbp_subnet.cpp
73     gbp_endpoint_cmds.cpp
74     gbp_endpoint.cpp
75     gbp_endpoint_group_cmds.cpp
76     gbp_endpoint_group.cpp
77     gbp_contract_cmds.cpp
78     gbp_contract.cpp
79   )
80 endif()
81
82 list(APPEND VOM_SOURCES
83   types.cpp
84   api_types.cpp
85   arp_proxy_binding_cmds.cpp
86   arp_proxy_binding.cpp
87   arp_proxy_config_cmds.cpp
88   arp_proxy_config.cpp
89   bond_group_binding_cmds.cpp
90   bond_group_binding.cpp
91   bond_interface_cmds.cpp
92   bond_interface.cpp
93   bond_member.cpp
94   bridge_domain_cmds.cpp
95   bridge_domain.cpp
96   bridge_domain_arp_entry.cpp
97   bridge_domain_arp_entry_cmds.cpp
98   bridge_domain_entry_cmds.cpp
99   bridge_domain_entry.cpp
100   client_db.cpp
101   cmd.cpp
102   connection.cpp
103   dhcp_client_cmds.cpp
104   dhcp_client.cpp
105   hw_cmds.cpp
106   hw.cpp
107   inspect.cpp
108   interface_cmds.cpp
109   interface.cpp
110   interface_factory.cpp
111   interface_ip6_nd_cmds.cpp
112   interface_span_cmds.cpp
113   interface_span.cpp
114   interface_types.cpp
115   ip_punt_redirect_cmds.cpp
116   ip_punt_redirect.cpp
117   ip_unnumbered_cmds.cpp
118   ip_unnumbered.cpp
119   l2_binding_cmds.cpp
120   l2_binding.cpp
121   l2_xconnect_cmds.cpp
122   l2_xconnect.cpp
123   l3_binding_cmds.cpp
124   l3_binding.cpp
125   lldp_binding_cmds.cpp
126   lldp_binding.cpp
127   lldp_global_cmds.cpp
128   lldp_global.cpp
129   logger.cpp
130   neighbour.cpp
131   neighbour_cmds.cpp
132   object_base.cpp
133   om.cpp
134   pipe.cpp
135   pipe_cmds.cpp
136   prefix.cpp
137   ra_config.cpp
138   ra_prefix.cpp
139   route.cpp
140   route_cmds.cpp
141   route_domain.cpp
142   route_domain_cmds.cpp
143   sub_interface_cmds.cpp
144   sub_interface.cpp
145   tap_interface.cpp
146   tap_interface_cmds.cpp
147   vxlan_tunnel_cmds.cpp
148   vxlan_tunnel.cpp
149 )
150
151 if(ACL_FILE)
152   list(APPEND VOM_HEADERS
153     acl_binding.hpp
154     acl_ethertype.hpp
155     acl_l2_rule.hpp
156     acl_l3_rule.hpp
157     acl_list.hpp
158     acl_types.hpp
159   )
160 endif()
161
162 if(NAT_FILE)
163   list(APPEND VOM_HEADERS
164     nat_static.hpp
165     nat_binding.hpp
166   )
167 endif()
168
169 if(L2E_FILE)
170   list(APPEND VOM_HEADERS
171     l2_emulation.hpp
172   )
173 endif()
174
175 if(GBP_FILE)
176   list(APPEND VOM_HEADERS
177     gbp_endpoint.hpp
178     gbp_endpoint_group.hpp
179     gbp_subnet.hpp
180     gbp_recirc.hpp
181     gbp_contract.hpp
182   )
183 endif()
184
185 list(APPEND VOM_HEADERS
186   arp_proxy_binding.hpp
187   arp_proxy_config.hpp
188   bond_group_binding.hpp
189   bond_interface.hpp
190   bond_member.hpp
191   bridge_domain.hpp
192   bridge_domain_arp_entry.hpp
193   bridge_domain_entry.hpp
194   client_db.hpp
195   cmd.hpp
196   connection.hpp
197   dhcp_client.hpp
198   dump_cmd.hpp
199   enum_base.hpp
200   event_cmd.hpp
201   hw.hpp
202   inspect.hpp
203   interface.hpp
204   interface_cmds.hpp
205   interface_ip6_nd.hpp
206   interface_span.hpp
207   ip_punt_redirect.hpp
208   ip_unnumbered.hpp
209   l2_binding.hpp
210   l2_xconnect.hpp
211   l3_binding.hpp
212   lldp_binding.hpp
213   lldp_global.hpp
214   logger.hpp
215   neighbour.hpp
216   object_base.hpp
217   om.hpp
218   pipe.hpp
219   prefix.hpp
220   ra_config.hpp
221   ra_prefix.hpp
222   route.hpp
223   route_domain.hpp
224   rpc_cmd.hpp
225   singular_db.hpp
226   singular_db_funcs.hpp
227   sub_interface.hpp
228   tap_interface.hpp
229   types.hpp
230   api_types.hpp
231   vxlan_tunnel.hpp
232 )
233
234 add_definitions(-Wall -Werror -std=gnu++11)
235
236 add_vpp_library(vom
237   SOURCES ${VOM_SOURCES}
238
239   INSTALL_HEADERS ${VOM_HEADERS}
240
241   LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread
242     ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt
243
244   COMPONENT libvom
245 )