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 (VPPAPICLIENT_LIB)
15 unset (VAPICLIENT_LIB)
24 find_library(VPPAPICLIENT_LIB NAMES vppapiclient REQUIRED)
25 find_path(VPPAPICLIENT_INCLUDE_DIR NAMES vpp-api/client/vppapiclient.h)
26 find_library(VAPICLIENT_LIB NAMES vapiclient REQUIRED)
27 find_path(VAPICLIENT_INCLUDE_DIR NAMES vapi/vapi.hpp)
30 if(NOT VPPAPICLIENT_INCLUDE_DIR OR NOT VPPAPICLIENT_LIB)
31 message(FATAL_ERROR "Cannot find vppapiclient library and/or headers")
33 if(NOT VAPICLIENT_INCLUDE_DIR OR NOT VAPICLIENT_LIB)
34 message(FATAL_ERROR "Cannot find vapiclient library and/or headers")
37 include_directories(${VPPAPICLIENT_INCLUDE_DIR})
38 include_directories(${VAPICLIENT_INCLUDE_DIR})
39 include_directories(${CMAKE_SOURCE_DIR})
41 find_file(ACL_FILE NAMES acl.api.vapi.hpp PATH_SUFFIXES vapi)
42 find_file(NAT_FILE NAMES nat.api.vapi.hpp PATH_SUFFIXES vapi)
43 find_file(L2E_FILE NAMES l2e.api.vapi.hpp PATH_SUFFIXES vapi)
44 find_file(GBP_FILE NAMES gbp.api.vapi.hpp PATH_SUFFIXES vapi)
45 find_file(IGMP_FILE NAMES igmp.api.vapi.hpp PATH_SUFFIXES vapi)
48 list(APPEND VOM_SOURCES
51 acl_ethertype_cmds.cpp
62 list(APPEND VOM_SOURCES
71 list(APPEND VOM_SOURCES
78 list(APPEND VOM_SOURCES
81 gbp_bridge_domain_cmds.cpp
85 gbp_endpoint_group_cmds.cpp
86 gbp_endpoint_group.cpp
91 gbp_route_domain_cmds.cpp
102 list(APPEND VOM_SOURCES
103 igmp_binding_cmds.cpp
110 list(APPEND VOM_SOURCES
113 arp_proxy_binding_cmds.cpp
114 arp_proxy_binding.cpp
115 arp_proxy_config_cmds.cpp
117 bond_group_binding_cmds.cpp
118 bond_group_binding.cpp
119 bond_interface_cmds.cpp
122 bridge_domain_cmds.cpp
124 bridge_domain_arp_entry.cpp
125 bridge_domain_arp_entry_cmds.cpp
126 bridge_domain_entry_cmds.cpp
127 bridge_domain_entry.cpp
138 interface_factory.cpp
139 interface_ip6_nd_cmds.cpp
140 interface_span_cmds.cpp
143 ip_punt_redirect_cmds.cpp
145 ip_unnumbered_cmds.cpp
153 lldp_binding_cmds.cpp
170 route_domain_cmds.cpp
173 sub_interface_cmds.cpp
176 tap_interface_cmds.cpp
177 vxlan_gbp_tunnel_cmds.cpp
178 vxlan_tunnel_cmds.cpp
183 list(APPEND VOM_HEADERS
194 list(APPEND VOM_HEADERS
201 list(APPEND VOM_HEADERS
207 list(APPEND VOM_HEADERS
209 gbp_bridge_domain.hpp
211 gbp_endpoint_group.hpp
222 list(APPEND VOM_HEADERS
228 list(APPEND VOM_HEADERS
229 arp_proxy_binding.hpp
231 bond_group_binding.hpp
235 bridge_domain_arp_entry.hpp
236 bridge_domain_entry.hpp
269 singular_db_funcs.hpp
279 add_definitions(-Wall -Werror -std=gnu++11)
282 SOURCES ${VOM_SOURCES}
284 INSTALL_HEADERS ${VOM_HEADERS}
286 LINK_LIBRARIES ${VPPAPICLIENT_LIB} ${VAPICLIENT_LIB} Threads::Threads
287 ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} m rt
293 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
294 add_definitions(-stdlib=libstdc++)
296 add_executable(vom_stats_test test_stats.cpp)
297 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
298 target_link_libraries(vom_stats_test vom stdc++)
300 target_link_libraries(vom_stats_test vom)