X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp%2FCMakeLists.txt;h=6f58e8db8ecd98ab964dd30910a5480b96839d74;hb=4c64b6edc86f7732f4a160b948b3386e4021a265;hp=8799d26f4c88c66d9966315461c28b2f24893086;hpb=2bfdda76d8b1cffcd8e30ca6855f293b1b1953c5;p=vpp.git diff --git a/src/vpp/CMakeLists.txt b/src/vpp/CMakeLists.txt index 8799d26f4c8..6f58e8db8ec 100644 --- a/src/vpp/CMakeLists.txt +++ b/src/vpp/CMakeLists.txt @@ -33,12 +33,22 @@ add_custom_target(vpp_version_h ############################################################################## option(VPP_API_TEST_BUILTIN "Use builtin VPP API test." ON) -vpp_add_api_files(vpp_api_headers +set(VPP_API_FILES api/vpe.api stats/stats.api oam/oam.api ) +vpp_add_api_files(vpp ${VPP_API_FILES}) + +foreach(file ${VPP_API_FILES}) + get_filename_component(dir ${file} DIRECTORY) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.h + DESTINATION include/vpp/${dir} + ) +endforeach() + set(VPP_SOURCES vnet/main.c app/vpe_cli.c @@ -61,15 +71,14 @@ if(VPP_API_TEST_BUILTIN) add_definitions(-DVPP_API_TEST_BUILTIN=1) endif() -add_executable (vpp ${VPP_SOURCES}) - -target_link_libraries(vpp svm vlib vppinfra vlibmemory vnet Threads::Threads - ${CMAKE_DL_LIBS}) -add_dependencies(vpp vpp_version_h api_headers) -set_target_properties(vpp PROPERTIES ENABLE_EXPORTS 1) -install(TARGETS vpp DESTINATION bin) +add_vpp_executable(vpp + ENABLE_EXPORTS + SOURCES ${VPP_SOURCES} + LINK_LIBRARIES svm vlib vppinfra vlibmemory vnet Threads::Threads ${CMAKE_DL_LIBS} + DEPENDS vpp_version_h api_headers +) -vpp_add_header_files(vpp +add_vpp_headers(vpp api/vpe_msg_enum.h api/vpe_all_api_h.h ) @@ -77,28 +86,32 @@ vpp_add_header_files(vpp ############################################################################## # vppctl binary ############################################################################## -add_executable(vppctl app/vppctl.c) -target_link_libraries(vppctl vppinfra) -install(TARGETS vppctl DESTINATION bin) +add_vpp_executable(vppctl + SOURCES app/vppctl.c + LINK_LIBRARIES vppinfra +) ############################################################################## # vpp_get_metrics binary ############################################################################## -add_executable (vpp_get_metrics api/vpp_get_metrics.c ${VPP_API_HDRS}) -target_link_libraries (vpp_get_metrics vppinfra svm svmdb) -install(TARGETS vpp_get_metrics DESTINATION bin) +add_vpp_executable(vpp_get_metrics + SOURCES api/vpp_get_metrics.c + LINK_LIBRARIES vppinfra svm svmdb + DEPENDS api_headers +) ############################################################################## # stats binaries ############################################################################## -add_executable(summary_stats_client api/summary_stats_client.c) -add_executable(stat_client app/stat_client.c) -add_dependencies(summary_stats_client api_headers) -add_dependencies(stat_client api_headers) -target_link_libraries(summary_stats_client vppinfra svm vlibmemoryclient) -target_link_libraries(stat_client vppinfra svm vlibmemoryclient) +add_vpp_executable(summary_stats_client + SOURCES api/summary_stats_client.c + LINK_LIBRARIES vppinfra svm vlibmemoryclient + DEPENDS api_headers +) -############################################################################## -# install -############################################################################## +add_vpp_executable(stat_client + SOURCES app/stat_client.c + LINK_LIBRARIES vppinfra svm vlibmemoryclient + DEPENDS api_headers +)