CMake: Add Cmake support for Vat
[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_library(vatplugin SHARED plugin_api.c)
18 target_link_libraries(vatplugin vppinfra)
19 add_dependencies (vatplugin vppinfra)
20 install(TARGETS vatplugin DESTINATION lib)
21
22 ##############################################################################
23 # vpp_api_test
24 ##############################################################################
25 add_executable (vpp_api_test
26   api_format.c
27   main.c
28   plugin.c
29   json_format.c
30   vat.h
31   json_format.h
32 )
33 target_link_libraries (vpp_api_test vlibmemoryclient svm vatplugin vppinfra
34                        Threads::Threads rt m dl crypto)
35 set_target_properties(vpp_api_test PROPERTIES ENABLE_EXPORTS 1)
36 install(TARGETS vpp_api_test DESTINATION bin)
37
38 ##############################################################################
39 #  vpp_json_test
40 ##############################################################################
41 add_executable (vpp_json_test
42   json_format.h
43   json_format.c
44   json_test.c)
45 target_link_libraries(vpp_json_test vppinfra m)
46 set_target_properties(vpp_json_test PROPERTIES ENABLE_EXPORTS 1)
47 install(TARGETS vpp_json_test DESTINATION bin)
48
49 ##############################################################################
50 # vat headers
51 ##############################################################################
52 vpp_add_header_files(vat
53   vat.h
54   json_format.h
55 )
56
57 ##############################################################################
58 # restart
59 ##############################################################################
60 add_executable (vpp_restart restart.c)
61 target_link_libraries (vpp_restart svmdb svm vppinfra pthread rt)
62 install(TARGETS vpp_restart DESTINATION bin )
63