From 19cbb328a9b4598b71e0aa092bf8a03732da8d63 Mon Sep 17 00:00:00 2001 From: Dominik Charousset Date: Sat, 22 Apr 2023 11:22:06 +0200 Subject: [PATCH] Fix install directory for plugins --- CMakeLists.txt | 11 +++-------- cmake | 2 +- src/ZeekPluginBootstrap.cmake.in | 4 ++++ src/ZeekPluginConfig.cmake.in | 6 ++++++ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b19ddd830..992aaca2b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -412,22 +412,17 @@ get_filename_component(ZEEK_SCRIPT_INSTALL_PATH ${ZEEK_SCRIPT_INSTALL_PATH} # plugins, etc. set(ZEEK_LIBDIR_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/zeek) -if (ZEEK_PLUGIN_DIR) - set(BRO_PLUGIN_INSTALL_PATH ${ZEEK_PLUGIN_DIR} - CACHE STRING "Installation path for plugins" FORCE) -else () - set(BRO_PLUGIN_INSTALL_PATH ${ZEEK_LIBDIR_PATH}/plugins +if (NOT ZEEK_PLUGIN_DIR) + set(ZEEK_PLUGIN_DIR ${ZEEK_LIBDIR_PATH}/plugins CACHE STRING "Installation path for plugins" FORCE) endif() -set(bro_plugin_install_path "${BRO_PLUGIN_INSTALL_PATH}") set(cmake_binary_dir "${CMAKE_BINARY_DIR}") set(cmake_current_binary_dir "${CMAKE_CURRENT_BINARY_DIR}") set(cmake_install_prefix "${CMAKE_INSTALL_PREFIX}") set(cmake_source_dir "${CMAKE_SOURCE_DIR}") set(zeek_script_install_path "${ZEEK_SCRIPT_INSTALL_PATH}") if ( MSVC ) - string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" bro_plugin_install_path "${bro_plugin_install_path}") string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_binary_dir "${cmake_binary_dir}") string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_current_binary_dir "${cmake_current_binary_dir}") string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_install_prefix "${cmake_install_prefix}") @@ -1379,7 +1374,7 @@ message( "\nInstall prefix: ${CMAKE_INSTALL_PREFIX}" "\nConfig file dir: ${ZEEK_ETC_INSTALL_DIR}" "\nLog dir: ${ZEEK_LOG_DIR}" - "\nPlugin dir: ${BRO_PLUGIN_INSTALL_PATH}" + "\nPlugin dir: ${ZEEK_PLUGIN_DIR}" "\nPython module dir: ${PY_MOD_INSTALL_DIR}" "\nScript dir: ${ZEEK_SCRIPT_INSTALL_PATH}" "\nSpool dir: ${ZEEK_SPOOL_DIR}" diff --git a/cmake b/cmake index 6fd9b7405a..95ed4a3052 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 6fd9b7405a2ee5c62e1a4d70ee47da8ca8bacb9a +Subproject commit 95ed4a3052ffeade1f0fc5b60cdce8f207fc5267 diff --git a/src/ZeekPluginBootstrap.cmake.in b/src/ZeekPluginBootstrap.cmake.in index fc2090bfc9..1e1e11713c 100644 --- a/src/ZeekPluginBootstrap.cmake.in +++ b/src/ZeekPluginBootstrap.cmake.in @@ -5,6 +5,10 @@ set(ZEEK_CMAKE_CONFIG_DIR "@ZEEK_CMAKE_CONFIG_DIR@" CACHE PATH "Internal Zeek variable: the CMake package path for Zeek." FORCE) +# Tells ZeekPlugin.cmake where to install plugins. +set(ZEEK_PLUGIN_DIR "@ZEEK_PLUGIN_DIR@" + CACHE PATH "Internal Zeek variable: the directory for installing Zeek plugins." FORCE) + # Allows scripts to locate files in the Zeek install tree. set(ZEEK_CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" CACHE PATH "Internal Zeek variable: CMAKE_INSTALL_PREFIX of Zeek." FORCE) diff --git a/src/ZeekPluginConfig.cmake.in b/src/ZeekPluginConfig.cmake.in index 14d25439ed..9c08360bc2 100644 --- a/src/ZeekPluginConfig.cmake.in +++ b/src/ZeekPluginConfig.cmake.in @@ -11,6 +11,12 @@ if ( NOT ZEEK_PLUGIN_SCRIPTS_PATH ) CACHE PATH "Path to utility shell scripts." FORCE) endif () +# Path for installing plugins. +if ( NOT ZEEK_PLUGIN_DIR ) + set(ZEEK_PLUGIN_DIR "@ZEEK_PLUGIN_DIR@" + CACHE STRING "Installation path for plugins" FORCE) +endif () + # For finding Zeek sources. if ( NOT ZEEK_SOURCE_DIR ) set(ZEEK_SOURCE_DIR "@ZEEK_SOURCE_DIR@"