aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-04-09 12:31:38 +0200
committerDario Lombardo <lomato@gmail.com>2018-04-18 08:57:39 +0000
commit511c2e166a6d3eeb37930a3dd7f40056498456ca (patch)
treeda9d1f74320c65560a2eb4517c9fe78b5a5d886b /cmake/modules
parent88435354c024597601bdbf2cb916f4b07faf2e52 (diff)
tshark: add -G elastic-mapping report.
This option generates an ElasticSearch mapping file as described here: https://www.elastic.co/blog/analyzing-network-packets-with-wireshark-elasticsearch-and-kibana It leverages the Glib-json library. Change-Id: Iff25f991e87d3da07bf06654e353fb785799dde9 Reviewed-on: https://code.wireshark.org/review/26848 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com>
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindJSONGLIB.cmake70
1 files changed, 70 insertions, 0 deletions
diff --git a/cmake/modules/FindJSONGLIB.cmake b/cmake/modules/FindJSONGLIB.cmake
new file mode 100644
index 0000000000..514bbdd6af
--- /dev/null
+++ b/cmake/modules/FindJSONGLIB.cmake
@@ -0,0 +1,70 @@
+# - Try to find JsonGlib-1.0
+# Once done, this will define
+#
+# JSONGLIB_FOUND - system has Glib
+# JSONGLIB_INCLUDE_DIRS - the Glib include directories
+# JSONGLIB_LIBRARIES - link these to use Glib
+
+include(FindWSWinLibs)
+FindWSWinLibs("libjson-glib-.*" "JSONGLIB_HINTS")
+
+find_path(JSONGLIB_INCLUDE_DIR
+ NAMES
+ json-glib/json-glib.h
+ HINTS
+ ${JSONGLIB_HINTS}
+ PATHS
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ ${CMAKE_INCLUDE_PATH}
+ ${CMAKE_INSTALL_PREFIX}/include
+ PATH_SUFFIXES
+ json-glib-1.0
+)
+
+find_library(JSONGLIB_LIBRARY
+ NAMES
+ json-glib-1.0
+ json-glib-1.0-0
+ HINTS
+ ${JSONGLIB_HINTS}
+ PATHS
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+)
+
+if(WIN32)
+ set(JSONGLIB_DLL_DIR "${JSONGLIB_HINTS}/bin"
+ CACHE PATH "Path to libjson-glib DLL"
+ )
+ file(GLOB _libssh_dll RELATIVE "${JSONGLIB_DLL_DIR}"
+ "${JSONGLIB_DLL_DIR}/json-glib-1.0.dll"
+ )
+ set(JSONGLIB_DLL ${_jsonglib_dll}
+ # We're storing filenames only. Should we use STRING instead?
+ CACHE FILEPATH "libjson-glib DLL file name"
+ )
+ mark_as_advanced(JSONGLIB_DLL_DIR JSONGLIB_DLL)
+endif()
+
+if(JSONGLIB_INCLUDE_DIR AND JSONGLIB_LIBRARY)
+ set(JSONGLIB_INCLUDE_DIRS
+ ${JSONGLIB_INCLUDE_DIR}
+ )
+ set(JSONGLIB_LIBRARIES
+ ${JSONGLIB_LIBRARY}
+ )
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set JSONGLIB_FOUND to TRUE if
+# all listed variables are TRUE and the requested version matches.
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(JSONGLIB
+ REQUIRED_VARS JSONGLIB_LIBRARY JSONGLIB_INCLUDE_DIR)