-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
90 lines (66 loc) · 3.21 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# SPDX-License-Identifier: MIT
cmake_minimum_required(VERSION 3.21)
include(cmake/project.cmake)
project(
elos
DESCRIPTION "Event LOgging and managment System"
VERSION ${ELOS_VERSION}
LANGUAGES C
)
option(ELOS_BUILD_DEFAULTS "enable all default builds" ON)
option(ENABLE_ANALYZER "Build with -fanalyzer" ON)
option(ENABLE_ASAN "Link with ASAN" ON)
option(ENABLE_CI "Use CI mode for building" OFF)
option(ENABLE_GIT_VERSION "Enable the git hash for the version" ON)
option(ELOS_DAEMON "Build elosd" ${ELOS_BUILD_DEFAULTS})
option(INSTALL_ELOS_DAEMON "Install elosd" ON)
option(ELOS_COMMON "build libelos_common" ${ELOS_BUILD_DEFAULTS})
option(ELOS_LIBRARY "build libelos" ${ELOS_BUILD_DEFAULTS})
option(ELOS_LIBRARY_CPP "build libelos-cpp" ${ELOS_BUILD_DEFAULTS})
option(ELOS_PLUGIN_LIBRARY "build libelosplugin" ${ELOS_BUILD_DEFAULTS})
option(ELOS_LIBRARY_LITE "build libelos-lite" OFF)
option(ELOS_TOOLS "Build elosc and other tools" ${ELOS_BUILD_DEFAULTS})
option(INSTALL_ELOS_TOOLS "Install elosc and other tools" ON)
option(ELOS_DEMOS "Build the elos demos" ${ELOS_BUILD_DEFAULTS})
option(INSTALL_ELOS_DEMOS "Install the elos demos" ON)
option(UNIT_TESTS "Build unit tests" ${ELOS_BUILD_DEFAULTS})
option(INSTALL_UNIT_TESTS "Install unit tests" ON)
option(SMOKE_TESTS "Build smoke tests" ${ELOS_BUILD_DEFAULTS})
option(INSTALL_SMOKE_TESTS "Build smoke tests" OFF)
option(ELOS_MOCK_LIBRARY "Build the mock libraries" OFF)
option(INSTALL_ELOS_MOCK_LIBRARY "Install the mock libraries" ON)
option(ELOS_PLUGINS "Build the elos plugins" ${ELOS_BUILD_DEFAULTS})
option(INSTALL_ELOS_PLUGINS "install the elos plugins" ON)
option(ELOSD_SYSTEMD "Enable systemd features (startup notification and socket-based activation for the syslog scanner)" OFF)
option(ELOSD_EVENTLOGGING_BACKEND_SQL "Build sqlite3 bakend plugin" ${ELOS_BUILD_DEFAULTS})
option(ELOSD_EVENTLOGGING_BACKEND_NOSQL "Build NoSQL backend plugin" OFF)
option(ELOSD_EVENTLOGGING_BACKEND_INFLUXDB "Build InfluxDB backend plugin" OFF)
option(ELOSD_EVENTLOGGING_BACKEND_DLT "Build DLT backend plugin" ${ELOS_BUILD_DEFAULTS})
option(ELOSD_LIBDLT "Build libelosdlt, a dlt protocol implementation." ${ELOSD_EVENTLOGGING_BACKEND_DLT})
option(ENABLE_LOGGING "Enables the safuLog functions" OFF)
project_set_environment()
project_set_version_variables()
project_add_documentation_target(
TITLE
"BaseOS ElosD Documentation"
MARKDOWN
${CMAKE_SOURCE_DIR}/documentation/documentation.md
)
if(ENABLE_LOGGING)
add_compile_definitions(SAFU_LOG=1)
endif(ENABLE_LOGGING)
add_subdirectory(src)
if(UNIT_TESTS)
enable_testing()
add_subdirectory(test/tsan)
endif(UNIT_TESTS)
add_subdirectory(test/utest)
add_subdirectory(test/smoketest)
if (ELOS_DAEMON)
option(INSTALL_ELOSD_SYSTEMD_UNIT "install the elosd.service unit" ${ELOSD_SYSTEMD})
option(INSTALL_ELOSD_SYSVINIT_SCRIPT "install the elosd init script" OFF)
set(INSTALL_ELOSD_SYSTEMD_UNIT_DIR "${CMAKE_INSTALL_LIBDIR}/systemd/system" CACHE STRING "destination directory for the service unit")
set(INSTALL_ELOSD_SYSVINIT_SCRIPT_DIR "${CMAKE_INSTALL_SYSCONFDIR}/init.d" CACHE STRING "destination directory for the elosd init script")
add_subdirectory(integration)
endif()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")