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
81 gbp_route_domain_cmds.cpp
91 list(APPEND VOM_SOURCES
99 list(APPEND VOM_SOURCES
102 arp_proxy_binding_cmds.cpp
103 arp_proxy_binding.cpp
104 arp_proxy_config_cmds.cpp
106 bond_group_binding_cmds.cpp
107 bond_group_binding.cpp
108 bond_interface_cmds.cpp
111 bridge_domain_cmds.cpp
113 bridge_domain_arp_entry.cpp
114 bridge_domain_arp_entry_cmds.cpp
115 bridge_domain_entry_cmds.cpp
116 bridge_domain_entry.cpp
127 interface_factory.cpp
128 interface_ip6_nd_cmds.cpp
129 interface_span_cmds.cpp
132 ip_punt_redirect_cmds.cpp
134 ip_unnumbered_cmds.cpp
142 lldp_binding_cmds.cpp
159 route_domain_cmds.cpp
160 sub_interface_cmds.cpp
163 tap_interface_cmds.cpp
164 vxlan_tunnel_cmds.cpp
169 list(APPEND VOM_HEADERS
180 list(APPEND VOM_HEADERS
187 list(APPEND VOM_HEADERS
193 list(APPEND VOM_HEADERS
195 gbp_endpoint_group.hpp
203 list(APPEND VOM_HEADERS
209 list(APPEND VOM_HEADERS
210 arp_proxy_binding.hpp
212 bond_group_binding.hpp
216 bridge_domain_arp_entry.hpp
217 bridge_domain_entry.hpp
250 singular_db_funcs.hpp
258 add_definitions(-Wall -Werror -std=gnu++11)
261 SOURCES ${VOM_SOURCES}
263 INSTALL_HEADERS ${VOM_HEADERS}
265 LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread
266 ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt