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 ##############################################################################
15 # Generate vpp/app/version.h
16 ##############################################################################
18 OUTPUT ${CMAKE_BINARY_DIR}/include/vpp/app/version.h
19 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
21 ARGS -p ${CMAKE_BINARY_DIR}/include/vpp/app
22 COMMAND scripts/generate_version_h
23 ARGS ${CMAKE_BINARY_DIR}/include/vpp/app/version.h
24 COMMENT "Generating VPP version.h"
27 add_custom_target(vpp_version_h
28 DEPENDS ${CMAKE_BINARY_DIR}/include/vpp/app/version.h
31 ##############################################################################
33 ##############################################################################
34 option(VPP_API_TEST_BUILTIN "Use builtin VPP API test." ON)
36 vpp_add_api_files(vpp_api_headers
55 if(VPP_API_TEST_BUILTIN)
56 list(APPEND VPP_SOURCES
61 add_definitions(-DVPP_API_TEST_BUILTIN=1)
64 add_executable (vpp ${VPP_SOURCES})
66 target_link_libraries(vpp svm vlib vppinfra vlibmemory vnet Threads::Threads
68 add_dependencies(vpp vpp_version_h api_headers)
69 set_target_properties(vpp PROPERTIES ENABLE_EXPORTS 1)
70 install(TARGETS vpp DESTINATION bin)
72 vpp_add_header_files(vpp
77 ##############################################################################
79 ##############################################################################
80 add_executable(vppctl app/vppctl.c)
81 target_link_libraries(vppctl vppinfra)
82 install(TARGETS vppctl DESTINATION bin)
84 ##############################################################################
85 # vpp_get_metrics binary
86 ##############################################################################
87 add_executable (vpp_get_metrics api/vpp_get_metrics.c ${VPP_API_HDRS})
88 target_link_libraries (vpp_get_metrics vppinfra svm svmdb)
89 install(TARGETS vpp_get_metrics DESTINATION bin)
91 ##############################################################################
93 ##############################################################################
94 add_executable(summary_stats_client api/summary_stats_client.c)
95 add_executable(stat_client app/stat_client.c)
96 add_dependencies(summary_stats_client api_headers)
97 add_dependencies(stat_client api_headers)
98 target_link_libraries(summary_stats_client vppinfra svm vlibmemoryclient)
99 target_link_libraries(stat_client vppinfra svm vlibmemoryclient)
101 ##############################################################################
103 ##############################################################################