2019-11-11 16:55:42 +03:00
cmake_minimum_required ( VERSION 3.13.4 )
project ( auditd-plugin-clickhouse
L A N G U A G E S C X X )
set ( CMAKE_MODULE_PATH ${ CMAKE_MODULE_PATH } "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
set ( SYSCONF_INSTALL_DIR ${ CMAKE_INSTALL_PREFIX } /etc CACHE PATH "Installation prefix for configuration files" )
set ( BIN_INSTALL_LIBEXEC ${ CMAKE_INSTALL_PREFIX } /libexec CACHE PATH "Installation prefix for user executables" )
2020-01-13 12:52:33 +03:00
set ( THREADS_PREFER_PTHREAD_FLAG ON )
find_package ( Threads REQUIRED )
2019-11-11 16:55:42 +03:00
find_package ( Boost REQUIRED )
find_package ( ClickhouseCpp REQUIRED )
2019-11-12 12:54:16 +03:00
pkg_check_modules ( AUPARSE auparse REQUIRED )
2019-11-11 16:55:42 +03:00
2019-11-12 12:54:16 +03:00
include_directories ( ${ Boost_INCLUDE_DIRS } ${ AUPARSE_INCLUDE_DIRS } )
2019-11-11 16:55:42 +03:00
2019-12-09 11:44:51 +03:00
set ( SOURCES
2019-12-11 14:50:32 +03:00
a u d i t d - d a t a t y p e s . c p p
2019-12-09 11:44:51 +03:00
a u d i t d - p l u g i n - c l i c k h o u s e . c p p
2020-01-10 11:49:59 +03:00
a u d i t d - r e c o r d . c p p
2020-01-10 14:59:03 +03:00
l o g g i n g . c p p
2020-01-10 11:49:59 +03:00
u t i l s . c p p
)
2019-12-09 11:44:51 +03:00
set ( HEADERS
2019-12-11 14:50:32 +03:00
a u d i t d - d a t a t y p e s . h p p
2020-01-10 11:49:59 +03:00
a u d i t d - r e c o r d . h p p
2020-01-10 14:59:03 +03:00
l o g g i n g . h p p
2020-01-10 11:49:59 +03:00
u t i l s . h p p
)
2019-12-09 11:44:51 +03:00
add_executable ( auditd-plugin-clickhouse ${ SOURCES } ${ HEADERS } )
2020-01-13 12:52:33 +03:00
target_link_libraries ( auditd-plugin-clickhouse ${ CLICKHOUSECPP_LIBRARIES } ${ AUPARSE_LIBRARIES } Threads::Threads )
2019-11-11 16:55:42 +03:00
install ( TARGETS auditd-plugin-clickhouse RUNTIME DESTINATION ${ BIN_INSTALL_LIBEXEC } )
install ( FILES auditd-plugin-clickhouse.conf DESTINATION ${ SYSCONF_INSTALL_DIR } /audisp/plugins.d )
2019-12-09 15:58:48 +03:00
install ( FILES auditd-clickhouse.conf auditd-clickhouse-datatypes.json DESTINATION ${ SYSCONF_INSTALL_DIR } /audisp )