-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathCMakeLists.txt
68 lines (52 loc) · 2.32 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
cmake_minimum_required(VERSION 3.22)
set(VERSION_MAJOR 5)
set(VERSION_MINOR 0)
set(VERSION_PATCH 0)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
project(ipfixprobe VERSION ${VERSION} LANGUAGES CXX C)
include(cmake/build_type.cmake)
include(cmake/installation.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
option(ENABLE_INPUT_PCAP "Enable build of input PCAP plugin" OFF)
option(ENABLE_INPUT_DPDK "Enable build of input DPDK plugin" OFF)
option(ENABLE_INPUT_NFB "Enable build of input NFB plugin" OFF)
option(ENABLE_OUTPUT_UNIREC "Enable build of output UNIREC plugin" OFF)
option(ENABLE_PROCESS_EXPERIMENTAL "Enable build of experimental process plugins" OFF)
option(ENABLE_MILISECONDS_TIMESTAMP "Compile ipfixprobe with miliseconds timestamp precesion" OFF)
option(ENABLE_NEMEA "Enable build of NEMEA plugins" OFF)
option(ENABLE_RPMBUILD "Enable build of RPM package" ON)
option(ENABLE_TESTS "Build tests (make test)" OFF)
if(ENABLE_MILISECONDS_TIMESTAMP)
add_compile_definitions(IPXP_TS_MSEC)
endif()
if(ENABLE_NEMEA)
add_compile_definitions(WITH_NEMEA)
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -ggdb3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -ggdb3")
include(cmake/dependencies.cmake)
add_subdirectory(external)
add_subdirectory(src)
add_subdirectory(pkg)
add_subdirectory(init)
if (ENABLE_TESTS)
if (NOT ENABLE_NEMEA OR NOT ENABLE_OUTPUT_UNIREC OR NOT ENABLE_INPUT_PCAP)
message(FATAL_ERROR
"ENABLE_TESTS requires ENABLE_NEMEA, "
"ENABLE_INPUT_PCAP and ENABLE_OUTPUT_UNIREC to be enabled."
)
endif()
enable_testing()
add_subdirectory(tests)
endif()