cmake: Fix plugins .h includes
Change-Id: I90600d000afb02e8969f3c01bcf9e4b5c10a7d39 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
This commit is contained in:
@@ -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})
|
||||
|
||||
@@ -19,4 +19,8 @@ add_vpp_plugin(abf
|
||||
|
||||
API_FILES
|
||||
abf.api
|
||||
|
||||
INSTALL_HEADERS
|
||||
abf_all_api_h.h
|
||||
abf_msg_enum.h
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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}
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -29,4 +29,8 @@ add_vpp_plugin(igmp
|
||||
|
||||
API_FILES
|
||||
igmp.api
|
||||
|
||||
INSTALL_HEADERS
|
||||
igmp_all_api_h.h
|
||||
igmp_msg_enum.h
|
||||
)
|
||||
|
||||
@@ -11,5 +11,11 @@
|
||||
# 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
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,4 +11,10 @@
|
||||
# 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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -15,4 +15,7 @@ add_vpp_plugin(srv6ad
|
||||
SOURCES
|
||||
ad.c
|
||||
node.c
|
||||
|
||||
INSTALL_HEADERS
|
||||
ad.h
|
||||
)
|
||||
|
||||
@@ -15,4 +15,7 @@ add_vpp_plugin(srv6am
|
||||
SOURCES
|
||||
am.c
|
||||
node.c
|
||||
|
||||
INSTALL_HEADERS
|
||||
am.h
|
||||
)
|
||||
|
||||
@@ -15,4 +15,7 @@ add_vpp_plugin(srv6as
|
||||
SOURCES
|
||||
as.c
|
||||
node.c
|
||||
|
||||
INSTALL_HEADERS
|
||||
as.h
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user