aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake
diff options
context:
space:
mode:
authorYohanPipereau <ypiperea@cisco.com>2019-06-17 14:55:16 +0200
committerYohanPipereau <ypiperea@cisco.com>2019-06-17 15:27:32 +0200
commitb7b52e85c1b05a456119c11b9cf8e79d660194cc (patch)
tree3c218784e367bfdb43363fd2b04a4254d48c13a9 /src/cmake
parentec995e056d985f9ef54f92adbcbe626967912592 (diff)
[gnmi] Remove gNMI from sweetcomb
Reasons for removing it: -This gNMI server has been upgraded to a more stable form. -It should live in a separate project because gNMI server is only dependant of sysrepo not of VPP or sweetcomb. -There were strange dependencies to this implementation like an XML parser library. -Capabilities RPC was answering wrong version number (1001 instead of 0.7.0) and encodings (ASCII vs JSON). -Error codes were not return to client in case of problem of configuration. Typically for element not found. -This server uses sysrepo C API though bindings for C++ can be obtained. -Documentation was missing. -Set RPC could not identify a key in a YANG list because a YANG library must be used for this not just a JSON parser. -It would be difficult to adapt this server to support more encodings than JSON. The new gNMI server offers an easier way to add encodings. -Log control level has been implemented in the new gNMI server. -Subscribe RPC has been added to the new server. Link to the new gNMI server: https://github.com/YohanPipereau/sysrepo_gnxi Change-Id: If57ab23c776430552d9d70fea6681db1b56af525 Signed-off-by: YohanPipereau <ypiperea@cisco.com>
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/FindGRPC.cmake76
-rw-r--r--src/cmake/FindJSONCPP.cmake56
-rw-r--r--src/cmake/FindPUGIXML.cmake52
3 files changed, 0 insertions, 184 deletions
diff --git a/src/cmake/FindGRPC.cmake b/src/cmake/FindGRPC.cmake
deleted file mode 100644
index e45f969..0000000
--- a/src/cmake/FindGRPC.cmake
+++ /dev/null
@@ -1,76 +0,0 @@
-# From https://github.com/wastl/cmarmotta/blob/master/cmake/FindGRPC.cmake
-#
-# - Try to find gRPC
-# Once done this will define
-#
-# GRPC_CPP_PLUGIN - Absolute path to grpc c++ plugin
-# GRPCPP_LIBRARY -
-# GPR_LIBRARY -
-#
-# VPP_FOUND - system has VPP
-# VPP_INCLUDE_DIRS - the VPP include directory
-# VPP_LIBRARIES - Link these to use LibSSH
-
-#Absolute path to grpc_cpp_plugin
-find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin)
-
-find_library(GRPC_LIBRARY NAMES grpc)
-find_library(GRPCPP_LIBRARY NAMES grpc++)
-find_library(GPR_LIBRARY NAMES gpr)
-set(GRPC_LIBRARIES ${GRPCPP_LIBRARY} ${GRPC_LIBRARY} ${GPR_LIBRARY})
-
-function(PROTOBUF_GENERATE_GRPC_CPP SRCS HDRS)
- if(NOT ARGN)
- message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files")
- return()
- endif()
-
- if(PROTOBUF_GENERATE_CPP_APPEND_PATH) # This variable is common for all types of output.
- # Create an include path for each file specified
- foreach(FIL ${ARGN})
- get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
- get_filename_component(ABS_PATH ${ABS_FIL} PATH)
- list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
- if(${_contains_already} EQUAL -1)
- list(APPEND _protobuf_include_path -I ${ABS_PATH})
- endif()
- endforeach()
- else()
- set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
- endif()
-
- if(DEFINED PROTOBUF_IMPORT_DIRS)
- foreach(DIR ${PROTOBUF_IMPORT_DIRS})
- get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
- list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
- if(${_contains_already} EQUAL -1)
- list(APPEND _protobuf_include_path -I ${ABS_PATH})
- endif()
- endforeach()
- endif()
-
- set(${SRCS})
- set(${HDRS})
- foreach(FIL ${ARGN})
- get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
- get_filename_component(FIL_WE ${FIL} NAME_WE)
-
- list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.grpc.pb.cc")
- list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.grpc.pb.h")
-
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.grpc.pb.cc"
- "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.grpc.pb.h"
- COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
- ARGS --grpc_out=${CMAKE_CURRENT_BINARY_DIR}
- --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN}
- ${_protobuf_include_path} ${ABS_FIL}
- DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
- COMMENT "Running gRPC C++ protocol buffer compiler on ${FIL}"
- VERBATIM)
- endforeach()
-
- set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
- set(${SRCS} ${${SRCS}} PARENT_SCOPE)
- set(${HDRS} ${${HDRS}} PARENT_SCOPE)
-endfunction()
diff --git a/src/cmake/FindJSONCPP.cmake b/src/cmake/FindJSONCPP.cmake
deleted file mode 100644
index a342f08..0000000
--- a/src/cmake/FindJSONCPP.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
-# - Try to find LibJSONCPP
-# Once done this will define
-#
-# LIBJSONCPP_FOUND - system has LibJSONCPP
-# LIBJSONCPP_INCLUDE_DIRS - the LibJSONCPP include directory
-# LIBJSONCPP_LIBRARIES - Link these to use LIBJSONCPP
-
-
-if (LIBJSONCPP_LIBRARIES AND LIBJSONCPP_INCLUDE_DIRS)
- # in cache already
- set(LIBJSONCPP_FOUND TRUE)
-else (LIBJSONCPP_LIBRARIES AND LIBJSONCPP_INCLUDE_DIRS)
-
- find_path(LIBJSONCPP_INCLUDE_DIR
- NAMES
- json/json.h
- PATHS
- /usr/include
- /usr/local/include
- /usr/include/jsoncpp
- /opt/local/include
- ${CMAKE_INCLUDE_PATH}
- ${CMAKE_INSTALL_PREFIX}/include
- )
-
- find_library(LIBJSONCPP_LIBRARY
- NAMES
- jsoncpp
- PATHS
- /usr/lib
- /usr/lib64
- /usr/lib/x86_64-linux-gnu
- /usr/local/lib
- /usr/local/lib64
- /opt/local/lib
- ${CMAKE_LIBRARY_PATH}
- ${CMAKE_INSTALL_PREFIX}/lib
- )
-
- if (LIBJSONCPP_INCLUDE_DIR AND LIBJSONCPP_LIBRARY)
- set(LIBJSONCPP_FOUND TRUE)
- else (LIBJSONCPP_INCLUDE_DIR AND LIBJSONCPP_LIBRARY)
- set(LIBJSONCPP_FOUND FALSE)
- endif (LIBJSONCPP_INCLUDE_DIR AND LIBJSONCPP_LIBRARY)
-
- set(LIBJSONCPP_INCLUDE_DIRS ${LIBJSONCPP_INCLUDE_DIR})
- set(LIBJSONCPP_LIBRARIES ${LIBJSONCPP_LIBRARY})
-
- # show the LIBJSONCPP_INCLUDE_DIRS and LIBJSONCPP_LIBRARIES variables only in the advanced view
- mark_as_advanced(LIBJSONCPP_INCLUDE_DIRS LIBJSONCPP_LIBRARIES)
-
-endif (LIBJSONCPP_LIBRARIES AND LIBJSONCPP_INCLUDE_DIRS)
-
-
-
-
diff --git a/src/cmake/FindPUGIXML.cmake b/src/cmake/FindPUGIXML.cmake
deleted file mode 100644
index dc7c86b..0000000
--- a/src/cmake/FindPUGIXML.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-# - Try to find LibPUGIXML
-# Once done this will define
-#
-# LIBPUGIXML_FOUND - system has LibPUGIXML
-# LIBPUGIXML_INCLUDE_DIRS - the LibPUGIXML include directory
-# LIBPUGIXML_LIBRARIES - Link these to use LIBPUGIXML
-
-if (LIBPUGIXML_LIBRARIES AND LIBPUGIXML_INCLUDE_DIRS)
- # in cache already
- set(LIBPUGIXML_FOUND TRUE)
-else (LIBPUGIXML_LIBRARIES AND LIBPUGIXML_INCLUDE_DIRS)
-
- find_path(LIBPUGIXML_INCLUDE_DIR
- NAMES
- pugixml.hpp
- PATHS
- /usr/include
- /usr/local/include
- /opt/local/include
- ${CMAKE_INCLUDE_PATH}
- ${CMAKE_INSTALL_PREFIX}/include
- )
-
- find_library(LIBPUGIXML_LIBRARY
- NAMES
- pugixml
- PATHS
- /usr/lib
- /usr/lib64
- /usr/local/lib
- /usr/local/lib64
- /opt/local/lib
- ${CMAKE_LIBRARY_PATH}
- ${CMAKE_INSTALL_PREFIX}/lib
- )
-
- if (LIBPUGIXML_INCLUDE_DIR AND LIBPUGIXML_LIBRARY)
- set(LIBPUGIXML_FOUND TRUE)
- else (LIBPUGIXML_INCLUDE_DIR AND LIBPUGIXML_LIBRARY)
- set(LIBPUGIXML_FOUND FALSE)
- endif (LIBPUGIXML_INCLUDE_DIR AND LIBPUGIXML_LIBRARY)
-
- set(LIBPUGIXML_INCLUDE_DIRS ${LIBPUGIXML_INCLUDE_DIR})
- set(LIBPUGIXML_LIBRARIES ${LIBPUGIXML_LIBRARY})
-
- # show the LIBPUGIXML_INCLUDE_DIRS and LIBPUGIXML_LIBRARIES variables only in the advanced view
- mark_as_advanced(LIBPUGIXML_INCLUDE_DIRS LIBPUGIXML_LIBRARIES)
-
-endif (LIBPUGIXML_LIBRARIES AND LIBPUGIXML_INCLUDE_DIRS)
-
-
-