aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2022-04-19 15:19:50 -0700
committerGerald Combs <gerald@wireshark.org>2022-04-25 12:07:48 -0700
commitdbf3ac370113ed7b06b2452705eecfdc6a7b35e9 (patch)
treec6417107a7bc8819e4646247d3ef6e4b3b43334b /cmake/modules
parentfc2cc05dde517957799f912331d5c2ac31867444 (diff)
CMake+Logwolf: Populate our Falco plugin directory.
Create plugins/<version>/falco and copy over the Cloudtrail plugin.
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindSinsp.cmake27
1 files changed, 20 insertions, 7 deletions
diff --git a/cmake/modules/FindSinsp.cmake b/cmake/modules/FindSinsp.cmake
index 894e99bdb5..4b6699ae5e 100644
--- a/cmake/modules/FindSinsp.cmake
+++ b/cmake/modules/FindSinsp.cmake
@@ -3,8 +3,9 @@
# Find libsinsp and libscap includes and libraries
# Adapted from FindZSTD.cmake.
#
-# SINSP_INCLUDE_DIRS - where to find sinsp.h, scap.h, etc.
+# SINSP_INCLUDE_DIRS - Where to find sinsp.h, scap.h, etc.
# SINSP_LIBRARIES - List of libraries when using libsinsp.
+# SINSP_PLUGINS - List of plugins.
# SINSP_FOUND - True if libsinsp found.
# SINSP_DLL_DIR - (Windows) Path to the libsinsp and libscap DLLs
# SINSP_DLL - (Windows) Name of the libsinsp and libscap DLLs
@@ -33,6 +34,11 @@ find_path(SCAP_INCLUDE_DIR
/usr/local/include
)
+find_path(SINSP_PLUGIN_DIR
+ NAMES registry.yaml
+ HINTS "${SINSP_PLUGINDIR}"
+)
+
find_library(SINSP_LIBRARY
NAMES sinsp
HINTS "${SINSP_LIBDIR}" "${SINSP_HINTS}/lib"
@@ -97,17 +103,23 @@ find_library(TBB_LIBRARY
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Sinsp
- REQUIRED_VARS
- SINSP_LIBRARY SINSP_INCLUDE_DIR
- SCAP_LIBRARY SCAP_INCLUDE_DIR
- JSONCPP_LIBRARY JSON_INCLUDE_DIR
- TBB_LIBRARY TBB_INCLUDE_DIR
+ REQUIRED_VARS
+ SINSP_LIBRARY SINSP_INCLUDE_DIR
+ SCAP_LIBRARY SCAP_INCLUDE_DIR
+ JSONCPP_LIBRARY JSON_INCLUDE_DIR
+ TBB_LIBRARY TBB_INCLUDE_DIR
+ SINSP_PLUGIN_DIR
# VERSION_VAR SINSP_VERSION
)
if( SINSP_FOUND )
set( SINSP_INCLUDE_DIRS ${SINSP_INCLUDE_DIR} ${SCAP_INCLUDE_DIR} ${JSON_INCLUDE_DIR} ${TBB_INCLUDE_DIR} )
set( SINSP_LIBRARIES ${SINSP_LIBRARY} ${SCAP_LIBRARY} ${JSONCPP_LIBRARY} ${TBB_LIBRARY} )
+ if (WIN32)
+ set( SINSP_PLUGINS ${SINSP_PLUGIN_DIR}/plugins/cloudtrail/cloudtrail.dll )
+ else()
+ set( SINSP_PLUGINS ${SINSP_PLUGIN_DIR}/plugins/cloudtrail/libcloudtrail.so )
+ endif()
# if (WIN32)
# set ( SINSP_DLL_DIR "${SINSP_HINTS}/bin"
# CACHE PATH "Path to sinsp DLL"
@@ -124,6 +136,7 @@ if( SINSP_FOUND )
else()
set( SINSP_INCLUDE_DIRS )
set( SINSP_LIBRARIES )
+ set( SINSP_PLUGINS )
endif()
-mark_as_advanced( SINSP_LIBRARIES SINSP_INCLUDE_DIRS )
+mark_as_advanced( SINSP_LIBRARIES SINSP_INCLUDE_DIRS SINSP_PLUGINS )