aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2023-01-11 15:19:28 -0800
committerGerald Combs <gerald@wireshark.org>2023-01-11 15:37:46 -0800
commit640c44f24edef4ee3062d77b5fc8366db64e85c4 (patch)
treeab773a72f49738a37be60c29f1f60b6d0209f0cd /cmake/modules
parent06ba70405875bbaff2381fa3bbd3f445f5e67438 (diff)
CMake: Specify Falco plugins manually.
Falco plugins don't yet have a standard installation location, and even when they do we might not want to install all of them. Remove plugin detection from FindSinsp.cmake and note that you should just pass the paths to your plugins in SINSP_PLUGINS.
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindSinsp.cmake22
1 files changed, 8 insertions, 14 deletions
diff --git a/cmake/modules/FindSinsp.cmake b/cmake/modules/FindSinsp.cmake
index 28eb752904..4e25a4378c 100644
--- a/cmake/modules/FindSinsp.cmake
+++ b/cmake/modules/FindSinsp.cmake
@@ -13,7 +13,9 @@
# SINSP_FOUND - True if libsinsp found.
# SINSP_INCLUDE_DIRS - Where to find sinsp.h, scap.h, etc.
# SINSP_LINK_LIBRARIES - List of libraries when using libsinsp.
-# SINSP_PLUGINS - List of plugins.
+
+# You must manually set the following variables:
+# SINSP_PLUGINS - Paths to plugins built from https://github.com/falcosecurity/plugins/.
# To do:
# SINSP_DLL_DIR - (Windows) Path to the libsinsp and libscap DLLs
@@ -22,6 +24,8 @@
include( FindWSWinLibs )
FindWSWinLibs( "libsinsp-.*" "SINSP_HINTS" )
+include(CMakeDependentOption)
+
if( NOT WIN32)
find_package(PkgConfig)
pkg_check_modules(SINSP libsinsp)
@@ -135,11 +139,6 @@ if(NOT SINSP_FOUND)
endif()
endif()
-find_path(SINSP_PLUGIN_DIR
- NAMES registry.yaml
- HINTS "${SINSP_PLUGINDIR}"
-)
-
# As https://cmake.org/cmake/help/latest/command/link_directories.html
# says, "Prefer to pass full absolute paths to libraries where possible,
# since this ensures the correct library will always be linked," so use
@@ -150,16 +149,10 @@ find_package_handle_standard_args(Sinsp
REQUIRED_VARS
SINSP_INCLUDE_DIRS
SINSP_LINK_LIBRARIES
- SINSP_PLUGIN_DIR
# VERSION_VAR SINSP_VERSION
)
if(SINSP_FOUND)
- 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"
@@ -176,7 +169,8 @@ if(SINSP_FOUND)
else()
set(SINSP_INCLUDE_DIRS)
set(SINSP_LINK_LIBRARIES)
- set(SINSP_PLUGINS)
endif()
-mark_as_advanced(SINSP_INCLUDE_DIRS SINSP_LINK_LIBRARIES SINSP_PLUGINS)
+cmake_dependent_option(SINSP_PLUGINS "Paths to Falco plugins. Semicolon-separated" "" SINSP_FOUND "")
+
+mark_as_advanced(SINSP_INCLUDE_DIRS SINSP_LINK_LIBRARIES)