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)
42 vpp_add_api_files(vpp ${VPP_API_FILES})
44 foreach(file ${VPP_API_FILES})
45 get_filename_component(dir ${file} DIRECTORY)
47 FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.h
48 DESTINATION include/vpp/${dir}
59 stats/stats_to_be_deprecated.c
67 if(VPP_API_TEST_BUILTIN)
68 list(APPEND VPP_SOURCES
74 add_definitions(-DVPP_API_TEST_BUILTIN=1)
77 add_vpp_executable(vpp
79 SOURCES ${VPP_SOURCES}
80 LINK_LIBRARIES svm vlib vppinfra vlibmemory vnet Threads::Threads ${CMAKE_DL_LIBS}
81 DEPENDS vpp_version_h api_headers
90 ##############################################################################
92 ##############################################################################
93 add_vpp_executable(vppctl
95 LINK_LIBRARIES vppinfra
98 ##############################################################################
99 # vpp_get_metrics binary
100 ##############################################################################
101 add_vpp_executable(vpp_get_metrics
102 SOURCES api/vpp_get_metrics.c
103 LINK_LIBRARIES vppinfra svm svmdb
107 ##############################################################################
109 ##############################################################################
110 add_vpp_executable(summary_stats_client
111 SOURCES api/summary_stats_client.c
112 LINK_LIBRARIES vppinfra svm vlibmemoryclient
117 add_vpp_executable(vpp_get_stats
118 SOURCES app/vpp_get_stats.c
119 LINK_LIBRARIES vppapiclient vppinfra
123 add_vpp_executable(vpp_prometheus_export
124 SOURCES app/vpp_prometheus_export.c
125 LINK_LIBRARIES vppapiclient vppinfra svm vlibmemoryclient