auditd-plugin-clickhouse/CMakeLists.txt
2020-01-27 13:07:59 +03:00

42 lines
1.4 KiB
CMake

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)
find_package(Boost REQUIRED COMPONENTS filesystem)
find_package(ClickhouseCpp REQUIRED)
pkg_check_modules(AUPARSE auparse REQUIRED)
include_directories(${Boost_INCLUDE_DIRS} ${AUPARSE_INCLUDE_DIRS})
set(SOURCES
auditd-datatypes.cpp
auditd-plugin-clickhouse.cpp
auditd-record.cpp
logging.cpp
utils.cpp
)
set(HEADERS
auditd-datatypes.hpp
auditd-record.hpp
logging.hpp
utils.hpp
)
add_executable( auditd-plugin-clickhouse ${SOURCES} ${HEADERS} )
target_link_libraries( auditd-plugin-clickhouse ${CLICKHOUSECPP_LIBRARIES} ${AUPARSE_LIBRARIES} Threads::Threads Boost::filesystem )
install(TARGETS auditd-plugin-clickhouse RUNTIME DESTINATION ${BIN_INSTALL_LIBEXEC} )
install(FILES auditd-plugin-clickhouse.conf DESTINATION ${SYSCONF_INSTALL_DIR}/audisp/plugins.d )
install(FILES auditd-clickhouse.conf auditd-clickhouse-datatypes.json DESTINATION ${SYSCONF_INSTALL_DIR}/audisp )
install(FILES auditd-plugin-clickhouse-logrotate.conf DESTINATION ${SYSCONF_INSTALL_DIR}/logrotate.d )