vat: add infrastructure to align vnet test code and plugin test code
[vpp.git] / src / vat / 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 ##############################################################################
15 # vat plugin shared library
16 ##############################################################################
17 add_vpp_library(vatplugin
18   SOURCES plugin_api.c
19   LINK_LIBRARIES vppinfra
20 )
21
22 ##############################################################################
23 # vpp_api_test
24 ##############################################################################
25 add_vpp_executable(vpp_api_test ENABLE_EXPORTS
26   SOURCES
27   api_format.c
28   main.c
29   plugin.c
30   json_format.c
31   types.c
32   ip_types_api.c
33   ip_types.c
34   protocols.def
35   ../vnet/arp/arp_test.c
36   ../vnet/geneve/geneve_test.c
37
38   DEPENDS api_headers
39
40   LINK_LIBRARIES
41   vlibmemoryclient
42   svm
43   vatplugin
44   vppinfra
45   Threads::Threads
46   rt m dl crypto
47 )
48
49 ##############################################################################
50 #  vpp_json_test
51 ##############################################################################
52 add_vpp_executable(vpp_json_test ENABLE_EXPORTS NO_INSTALL
53   SOURCES json_format.c json_test.c
54   LINK_LIBRARIES vppinfra m
55 )
56
57 ##############################################################################
58 # vat headers
59 ##############################################################################
60 install(
61   FILES vat.h json_format.h
62   DESTINATION include/vat
63   COMPONENT vpp-dev
64 )
65
66 ##############################################################################
67 # restart
68 ##############################################################################
69 add_vpp_executable(vpp_restart
70   SOURCES restart.c
71   LINK_LIBRARIES svm svmdb vppinfra Threads::Threads rt
72 )