cmake: Fix plugins .h includes 06/14506/1
authorMohsin Kazmi <sykazmi@cisco.com>
Mon, 27 Aug 2018 14:11:59 +0000 (16:11 +0200)
committerMohsin Kazmi <sykazmi@cisco.com>
Mon, 27 Aug 2018 14:28:15 +0000 (16:28 +0200)
Change-Id: I90600d000afb02e8969f3c01bcf9e4b5c10a7d39
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
25 files changed:
src/cmake/plugin.cmake
src/plugins/abf/CMakeLists.txt
src/plugins/acl/CMakeLists.txt
src/plugins/avf/CMakeLists.txt
src/plugins/cdp/CMakeLists.txt
src/plugins/dpdk/CMakeLists.txt
src/plugins/flowprobe/CMakeLists.txt
src/plugins/gbp/CMakeLists.txt
src/plugins/gtpu/CMakeLists.txt
src/plugins/igmp/CMakeLists.txt
src/plugins/ila/CMakeLists.txt
src/plugins/ioam/CMakeLists.txt
src/plugins/ixge/CMakeLists.txt
src/plugins/l2e/CMakeLists.txt
src/plugins/lacp/CMakeLists.txt
src/plugins/lb/CMakeLists.txt
src/plugins/mactime/CMakeLists.txt
src/plugins/map/CMakeLists.txt
src/plugins/memif/CMakeLists.txt
src/plugins/nat/CMakeLists.txt
src/plugins/pppoe/CMakeLists.txt
src/plugins/srv6-ad/CMakeLists.txt
src/plugins/srv6-am/CMakeLists.txt
src/plugins/srv6-as/CMakeLists.txt
src/plugins/stn/CMakeLists.txt

index a5b4bf5..6cae5e0 100644 (file)
@@ -15,16 +15,19 @@ macro(add_vpp_plugin name)
   cmake_parse_arguments(PLUGIN
     ""
     "LINK_FLAGS"
-    "SOURCES;API_FILES;MULTIARCH_SOURCES;LINK_LIBRARIES;API_TEST_SOURCES"
+    "SOURCES;API_FILES;MULTIARCH_SOURCES;LINK_LIBRARIES;INSTALL_HEADERS;API_TEST_SOURCES"
     ${ARGN}
   )
   set(plugin_name ${name}_plugin)
   set(api_headers)
   file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
   foreach(f ${PLUGIN_API_FILES})
+    get_filename_component(dir ${f} DIRECTORY)
     vpp_generate_api_header(${f} plugins)
     list(APPEND api_headers ${f}.h ${f}.json)
     set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${f})
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}.h DESTINATION
+      include/vpp_plugins/${name}/${dir})
   endforeach()
   add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_headers})
   add_dependencies(${plugin_name} vpp_version_h api_headers)
@@ -40,6 +43,12 @@ macro(add_vpp_plugin name)
   if(PLUGIN_LINK_FLAGS)
     set_target_properties(${plugin_name} PROPERTIES LINK_FLAGS "${PLUGIN_LINK_FLAGS}")
   endif()
+  if(PLUGIN_INSTALL_HEADERS)
+    foreach(file ${PLUGIN_INSTALL_HEADERS})
+      get_filename_component(dir ${file} DIRECTORY)
+      install(FILES ${file} DESTINATION include/vpp_plugins/${name}/${dir})
+    endforeach()
+  endif()
   if(PLUGIN_API_TEST_SOURCES)
     set(test_plugin_name ${name}_test_plugin)
     add_library(${test_plugin_name} SHARED ${PLUGIN_API_TEST_SOURCES} ${api_headers})
index 5db9757..54eeecf 100644 (file)
@@ -19,4 +19,8 @@ add_vpp_plugin(abf
 
   API_FILES
   abf.api
+
+  INSTALL_HEADERS
+  abf_all_api_h.h
+  abf_msg_enum.h
 )
index c6ccb3b..75a1221 100644 (file)
@@ -24,4 +24,9 @@ add_vpp_plugin(acl
 
   API_TEST_SOURCES
   acl_test.c
+
+  INSTALL_HEADERS
+  acl_all_api_h.h
+  acl_msg_enum.h
+  manual_fns.h
 )
index 8547fb7..66e6904 100644 (file)
@@ -30,4 +30,8 @@ add_vpp_plugin(avf
 
   API_TEST_SOURCES
   avf_test.c
+
+  INSTALL_HEADERS
+  avf_all_api_h.h
+  avf_msg_enum.h
 )
index 0f3ade8..53542f0 100644 (file)
@@ -23,5 +23,11 @@ add_vpp_plugin(cdp
 
   API_TEST_SOURCES
   cdp_test.c
+
+  INSTALL_HEADERS
+  cdp_all_api_h.h
+  cdp.h
+  cdp_msg_enum.h
+  cdp_protocol.h
 )
 
index ce07f45..72b85c1 100644 (file)
@@ -122,6 +122,11 @@ if(DPDK_INCLUDE_DIR AND DPDK_LIB)
     API_TEST_SOURCES
     api/dpdk_test.c
 
+    INSTALL_HEADERS
+    device/dpdk.h
+    api/dpdk_all_api_h.h
+    ipsec/ipsec.h
+
     LINK_FLAGS
     ${DPDK_LINK_FLAGS}
   )
index 4c1d4f3..b6e4996 100644 (file)
@@ -19,6 +19,10 @@ add_vpp_plugin(flowprobe
   API_FILES
   flowprobe.api
 
+  INSTALL_HEADERS
+  flowprobe_all_api_h.h
+  flowprobe_msg_enum.h
+
   API_TEST_SOURCES
   flowprobe_test.c
 )
index 738154a..c099060 100644 (file)
@@ -27,4 +27,9 @@ add_vpp_plugin(gbp
 
   API_FILES
   gbp.api
+
+  INSTALL_HEADERS
+  gbp.h
+  gbp_all_api_h.h
+  gbp_msg_enum.h
 )
index 2ad38eb..0a599bb 100644 (file)
@@ -21,6 +21,10 @@ add_vpp_plugin(gtpu
   API_FILES
   gtpu.api
 
+  INSTALL_HEADERS
+  gtpu_all_api_h.h
+  gtpu_msg_enum.h
+
   API_TEST_SOURCES
   gtpu_test.c
 )
index 8ed8c48..089046e 100644 (file)
@@ -29,4 +29,8 @@ add_vpp_plugin(igmp
 
   API_FILES
   igmp.api
+
+  INSTALL_HEADERS
+  igmp_all_api_h.h
+  igmp_msg_enum.h
 )
index f03655b..cf5f34c 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-add_vpp_plugin(ila SOURCES ila.c)
+add_vpp_plugin(ila
+  SOURCES
+  ila.c
+
+  INSTALL_HEADERS
+  ila.h
+)
 
index 97381c5..3f46559 100644 (file)
@@ -74,6 +74,37 @@ add_vpp_plugin(ioam
   ip6/ioam_cache.api
   udp-ping/udp_ping.api
 
+  INSTALL_HEADERS
+  lib-pot/pot_all_api_h.h
+  lib-pot/pot_msg_enum.h
+  lib-pot/pot_util.h
+  lib-pot/math64.h
+  export/ioam_export_all_api_h.h
+  export/ioam_export_msg_enum.h
+  lib-trace/trace_all_api_h.h
+  lib-trace/trace_msg_enum.h
+  lib-trace/trace_util.h
+  encap/ip6_ioam_trace.h
+  lib-trace/trace_config.h
+  export-common/ioam_export.h
+  lib-vxlan-gpe/vxlan_gpe_all_api_h.h
+  lib-vxlan-gpe/vxlan_gpe_msg_enum.h
+  lib-vxlan-gpe/vxlan_gpe_ioam_util.h
+  lib-vxlan-gpe/vxlan_gpe_ioam_packet.h
+  lib-vxlan-gpe/vxlan_gpe_ioam.h
+  export-vxlan-gpe/vxlan_gpe_ioam_export_all_api_h.h
+  export-vxlan-gpe/vxlan_gpe_ioam_export_msg_enum.h
+  encap/ip6_ioam_e2e.h
+  encap/ip6_ioam_seqno.h
+  lib-e2e/ioam_seqno_lib.h
+  ip6/ioam_cache_all_api_h.h
+  ip6/ioam_cache_msg_enum.h
+  udp-ping/udp_ping_packet.h
+  udp-ping/udp_ping.h
+  udp-ping/udp_ping_util.h
+  udp-ping/udp_ping_all_api_h.h
+  udp-ping/udp_ping_msg_enum.h
+
   API_TEST_SOURCES
   ioam_test.c
   lib-pot/pot_test.c
index 14d101e..226652c 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-add_vpp_plugin(ixge SOURCES ixge.c)
+add_vpp_plugin(ixge
+  SOURCES
+  ixge.c
+
+  INSTALL_HEADERS
+  ixge.h
+)
index 27d5659..e063f7d 100644 (file)
@@ -18,4 +18,9 @@ add_vpp_plugin(l2e
 
   API_FILES
   l2e.api
+
+  INSTALL_HEADERS
+  l2e.h
+  l2e_all_api_h.h
+  l2e_msg_enum.h
 )
index 253786e..fd0413c 100644 (file)
@@ -27,6 +27,16 @@ add_vpp_plugin(lacp
   API_FILES
   lacp.api
 
+  INSTALL_HEADERS
+  machine.h
+  rx_machine.h
+  tx_machine.h
+  mux_machine.h
+  ptx_machine.h
+  node.h
+  lacp_all_api_h.h
+  lacp_msg_enum.h
+
   API_TEST_SOURCES
   lacp_test.c
 )
index 85acb62..406b16a 100644 (file)
@@ -22,6 +22,11 @@ add_vpp_plugin(lb
   API_FILES
   lb.api
 
+  INSTALL_HEADERS
+  lb.h
+  util.h
+  lbhash.h
+
   API_TEST_SOURCES
   lb_test.c
 )
index ac5077d..9f5d431 100644 (file)
@@ -19,6 +19,10 @@ add_vpp_plugin(mactime
   API_FILES
   mactime.api
 
+  INSTALL_HEADERS
+  mactime_all_api_h.h
+  mactime_msg_enum.h
+
   API_TEST_SOURCES
   mactime_test.c
 )
index 9db0987..5bce036 100644 (file)
@@ -26,4 +26,10 @@ add_vpp_plugin(map
 
   API_TEST_SOURCES
   map_test.c
+
+  INSTALL_HEADERS
+  map_all_api_h.h
+  map_msg_enum.h
+  map_dpo.h
+  map.h
 )
index e704fd1..c0d6f0d 100644 (file)
@@ -29,4 +29,9 @@ add_vpp_plugin(memif
   MULTIARCH_SOURCES
   device.c
   node.c
+
+  INSTALL_HEADERS
+  memif.h
+  memif_all_api_h.h
+  memif_msg_enum.h
 )
index ef59961..ef82213 100644 (file)
@@ -44,4 +44,8 @@ add_vpp_plugin(nat
 
   API_TEST_SOURCES
   nat_test.c
+
+  INSTALL_HEADERS
+  nat_all_api_h.h
+  nat_msg_enum.h
 )
index 13b6b54..61ed7a4 100644 (file)
@@ -22,6 +22,10 @@ add_vpp_plugin(pppoe
   API_FILES
   pppoe.api
 
+  INSTALL_HEADERS
+  pppoe_all_api_h.h
+  pppoe_msg_enum.h
+
   API_TEST_SOURCES
   pppoe_test.c
 )
index dc222bf..98662e2 100644 (file)
@@ -15,4 +15,7 @@ add_vpp_plugin(srv6ad
   SOURCES
   ad.c
   node.c
+
+  INSTALL_HEADERS
+  ad.h
 )
index 650142f..821c232 100644 (file)
@@ -15,4 +15,7 @@ add_vpp_plugin(srv6am
   SOURCES
   am.c
   node.c
+
+  INSTALL_HEADERS
+  am.h
 )
index 3140c9d..036b86f 100644 (file)
@@ -15,4 +15,7 @@ add_vpp_plugin(srv6as
   SOURCES
   as.c
   node.c
+
+  INSTALL_HEADERS
+  as.h
 )
index 38eda9b..8d6279c 100644 (file)
@@ -19,6 +19,11 @@ add_vpp_plugin(stn
   API_FILES
   stn.api
 
+  INSTALL_HEADERS
+  stn.h
+  stn_all_api_h.h
+  stn_msg_enum.h
+
   API_TEST_SOURCES
   stn_test.c
 )