summaryrefslogtreecommitdiffstats
path: root/java/CMakeLists.txt
diff options
context:
space:
mode:
authorTibor Král <tibor.kral@pantheon.tech>2019-04-12 10:53:49 +0200
committerTibor Král <tibor.kral@pantheon.tech>2019-04-12 12:47:37 +0000
commit34f365fdc926ca9abda25db43a7a45c68e9aeb67 (patch)
tree073046c6c0363ad3d2dcabdbfbf32b533c3c78fc /java/CMakeLists.txt
parentb311cdeb3e816d6836aa93bbcbb3eb4f2353caa2 (diff)
Implementation of jvpp-stats plugin
Change-Id: Ief8bc9f6b8059bbe9d418b46e09229f3a5b5df36 Signed-off-by: Tibor Král <tibor.kral@pantheon.tech> Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'java/CMakeLists.txt')
-rw-r--r--java/CMakeLists.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index cc59910..e0dc673 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -185,6 +185,51 @@ FILE(GLOB_RECURSE files RELATIVE
# message("COREFILES: ${corefiles}")
java_api_binding(core core ${files})
+############# Stats package ##################
+set(PACKAGE_DIR_JVPP_STATS io/fd/jvpp)
+unset(files)
+FILE(GLOB files RELATIVE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/jvpp-stats/${PACKAGE_DIR_JVPP_STATS}/*.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/jvpp-stats/${PACKAGE_DIR_JVPP_STATS}/*/*.java
+ ${CMAKE_CURRENT_SOURCE_DIR}/jvpp-stats/${PACKAGE_DIR_JVPP_STATS}/*/*/*.java
+ )
+
+add_custom_target(jvpp-stats-classes ALL)
+add_dependencies(jvpp-stats-classes jvpp-registry)
+add_custom_command(TARGET jvpp-stats-classes
+ PRE_BUILD
+ COMMAND mkdir -p jvpp-stats/target
+ COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/jvpp-stats
+ COMMAND ${Java_JAVAC_EXECUTABLE}
+ ARGS -source 1.8 -target 1.8 -cp ${CMAKE_CURRENT_BINARY_DIR}/jvpp-registry-${JAPI_LIB_VERSION}.jar
+ -d ${CMAKE_CURRENT_SOURCE_DIR}/jvpp-stats/target -h jvpp-stats ${files}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+add_library(jvpp_stats SHARED jvpp-stats/jvpp_stats.c)
+target_link_libraries(jvpp_stats ${JVPP_LIBS} vppapiclient vppinfra)
+include_directories(jvpp-stats)
+add_dependencies(jvpp_stats jvpp_common jvpp_registry jvpp-stats-classes)
+
+add_custom_target(jvpp-stats ALL)
+add_dependencies(jvpp-stats jvpp_stats jvpp-stats-classes)
+add_custom_command(TARGET jvpp-stats
+ PRE_BUILD
+ COMMAND cp ${CMAKE_BINARY_DIR}/build-root/lib/libjvpp_stats.so jvpp-stats/target
+ COMMAND ${Java_JAR_EXECUTABLE} ARGS cf
+ ${CMAKE_CURRENT_BINARY_DIR}/jvpp-stats-${JAPI_LIB_VERSION}.jar
+ -C jvpp-stats/target .
+ COMMAND rm ARGS -rf jvpp-stats/target
+ jvpp-stats/io_fd_jvpp_*.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "JAR_GEN stats"
+ )
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/jvpp-stats-${JAPI_LIB_VERSION}.jar
+ DESTINATION share/java
+)
+
############ Plugin Packages #######################
unset(files)
unset(pluginfiles)