auditd-plugin-clickhouse/CMakeLists.txt

41 lines
1.3 KiB
CMake
Raw Normal View History

2019-11-11 16:55:42 +03:00
cmake_minimum_required( VERSION 3.13.4 )
project(auditd-plugin-clickhouse
LANGUAGES CXX)
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")
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)
pkg_check_modules(AUPARSE auparse REQUIRED)
2019-11-11 16:55:42 +03:00
include_directories(${Boost_INCLUDE_DIRS} ${AUPARSE_INCLUDE_DIRS})
2019-11-11 16:55:42 +03:00
set(SOURCES
2019-12-11 14:50:32 +03:00
auditd-datatypes.cpp
auditd-plugin-clickhouse.cpp
2020-01-10 11:49:59 +03:00
auditd-record.cpp
logging.cpp
2020-01-10 11:49:59 +03:00
utils.cpp
)
set(HEADERS
2019-12-11 14:50:32 +03:00
auditd-datatypes.hpp
2020-01-10 11:49:59 +03:00
auditd-record.hpp
logging.hpp
2020-01-10 11:49:59 +03:00
utils.hpp
)
add_executable( auditd-plugin-clickhouse ${SOURCES} ${HEADERS} )
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 )