diff options
Diffstat (limited to 'src/cmake/library.cmake')
-rw-r--r-- | src/cmake/library.cmake | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/cmake/library.cmake b/src/cmake/library.cmake index a5b6c76d2d1..3f17e30daab 100644 --- a/src/cmake/library.cmake +++ b/src/cmake/library.cmake @@ -57,6 +57,8 @@ macro(add_vpp_library lib) FILES ${file} ${CMAKE_CURRENT_BINARY_DIR}/${file}.h ${CMAKE_CURRENT_BINARY_DIR}/${file}_enum.h ${CMAKE_CURRENT_BINARY_DIR}/${file}_types.h + ${CMAKE_CURRENT_BINARY_DIR}/${file}_tojson.h + ${CMAKE_CURRENT_BINARY_DIR}/${file}_fromjson.h DESTINATION include/${lib}/${dir} COMPONENT vpp-dev ) @@ -93,3 +95,33 @@ function (add_vpp_headers path) ) endforeach() endfunction() + +macro(add_vpp_test_library lib) + cmake_parse_arguments(TEST + "" + "" + ${ARGN} + ) + + foreach(file ${ARGN}) + get_filename_component(name ${file} NAME_WE) + set(test_lib ${lib}_${name}_plugin) + add_library(${test_lib} SHARED ${file}_test2.c) + if(NOT VPP_EXTERNAL_PROJECT) + add_dependencies(${test_lib} api_headers) + endif() + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + set_target_properties(${test_lib} PROPERTIES NO_SONAME 1) + set_target_properties(${test_lib} PROPERTIES + PREFIX "" + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vat2_plugins) + + # Later: Install and package + # install .so + #install( + # TARGETS ${test_lib} + # DESTINATION ${VPP_LIBRARY_DIR}/vat2_plugins + # #COMPONENT ${ARG_COMPONENT} + # ) + endforeach() +endmacro() |