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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 unset (VAPICLIENT_LIB)
23 find_library(VAPICLIENT_LIB NAMES vapiclient REQUIRED)
24 find_path(VAPICLIENT_INCLUDE_DIR NAMES vapi/vapi.hpp)
26 if(NOT VAPICLIENT_INCLUDE_DIR OR NOT VAPICLIENT_LIB)
27 message(FATAL_ERROR "Cannot find vapiclient library and/or headers")
30 include_directories(${VAPICLIENT_INCLUDE_DIR})
31 include_directories(${CMAKE_SOURCE_DIR})
33 find_file(ACL_FILE NAMES acl.api.vapi.hpp PATH_SUFFIXES vapi)
34 find_file(NAT_FILE NAMES nat.api.vapi.hpp PATH_SUFFIXES vapi)
35 find_file(L2E_FILE NAMES l2e.api.vapi.hpp PATH_SUFFIXES vapi)
36 find_file(GBP_FILE NAMES gbp.api.vapi.hpp PATH_SUFFIXES vapi)
37 find_file(IGMP_FILE NAMES igmp.api.vapi.hpp PATH_SUFFIXES vapi)
40 list(APPEND VOM_SOURCES
43 acl_ethertype_cmds.cpp
54 list(APPEND VOM_SOURCES
63 list(APPEND VOM_SOURCES
70 list(APPEND VOM_SOURCES
73 gbp_bridge_domain_cmds.cpp
77 gbp_endpoint_group_cmds.cpp
78 gbp_endpoint_group.cpp
83 gbp_route_domain_cmds.cpp
94 list(APPEND VOM_SOURCES
102 list(APPEND VOM_SOURCES
105 arp_proxy_binding_cmds.cpp
106 arp_proxy_binding.cpp
107 arp_proxy_config_cmds.cpp
109 bond_group_binding_cmds.cpp
110 bond_group_binding.cpp
111 bond_interface_cmds.cpp
114 bridge_domain_cmds.cpp
116 bridge_domain_arp_entry.cpp
117 bridge_domain_arp_entry_cmds.cpp
118 bridge_domain_entry_cmds.cpp
119 bridge_domain_entry.cpp
130 interface_factory.cpp
131 interface_ip6_nd_cmds.cpp
132 interface_span_cmds.cpp
135 ip_punt_redirect_cmds.cpp
137 ip_unnumbered_cmds.cpp
145 lldp_binding_cmds.cpp
162 route_domain_cmds.cpp
163 sub_interface_cmds.cpp
166 tap_interface_cmds.cpp
167 vxlan_tunnel_cmds.cpp
172 list(APPEND VOM_HEADERS
183 list(APPEND VOM_HEADERS
190 list(APPEND VOM_HEADERS
196 list(APPEND VOM_HEADERS
198 gbp_bridge_domain.hpp
200 gbp_endpoint_group.hpp
211 list(APPEND VOM_HEADERS
217 list(APPEND VOM_HEADERS
218 arp_proxy_binding.hpp
220 bond_group_binding.hpp
224 bridge_domain_arp_entry.hpp
225 bridge_domain_entry.hpp
258 singular_db_funcs.hpp
266 add_definitions(-Wall -Werror -std=gnu++11)
269 SOURCES ${VOM_SOURCES}
271 INSTALL_HEADERS ${VOM_HEADERS}
273 LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread
274 ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt