-
Notifications
You must be signed in to change notification settings - Fork 21
/
CMakeLists.txt
executable file
·66 lines (53 loc) · 2.3 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
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(ZeekPluginHTTP2)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(ZeekPlugin)
find_package(LibNGHTTP2)
find_package(LibBROTLI)
if (NOT LIBNGHTTP2_FOUND)
message(STATUS "LibNGHTTP2 ROOT DIR : ${LibNGHTTP2_ROOT_DIR}")
message(STATUS "LibNGHTTP2 INC DIR : ${LibNGHTTP2_INCLUDE_DIR}")
message(STATUS "LibNGHTTP2 LIB DIR : ${LibNGHTTP2_LIBRARIES}")
message(FATAL_ERROR "LibNGHTTP2 not found.")
endif()
if (LibNGHTTP2_VERSION)
if(LibNGHTTP2_VERSION VERSION_LESS "1.11.0")
message(FATAL_ERROR "LibNGHTTP2 must be 1.11.0 or greater")
endif()
else()
message(WARNING "Unable to determine LibNGHTTP2 library version")
endif()
if (NOT LIBBROTLI_FOUND)
message(STATUS "LibBROTLI ROOT DIR : ${LibBROTLI_ROOT_DIR}")
message(STATUS "LibBROTLI INC DIR : ${LibBROTLI_INCLUDE_DIR}")
message(STATUS "LibBROTLI LIB DIR : ${LibBROTLI_LIBRARIES}")
message(FATAL_ERROR "LibBROTLI not found.")
endif()
message(STATUS "---------------------")
message(STATUS "LibBROTLI ROOT DIR : ${LibBROTLI_ROOT_DIR}")
message(STATUS "LibBROTLI INC DIR : ${LibBROTLI_INCLUDE_DIR}")
message(STATUS "LibBROTLI LIB DIR : ${LibBROTLI_LIBRARIES}")
message(STATUS "---------------------")
message(STATUS "LibNGHTTP2 ROOT DIR : ${LibNGHTTP2_ROOT_DIR}")
message(STATUS "LibNGHTTP2 INC DIR : ${LibNGHTTP2_INCLUDE_DIR}")
message(STATUS "LibNGHTTP2 LIB DIR : ${LibNGHTTP2_LIBRARIES}")
include_directories(BEFORE ${LibNGHTTP2_INCLUDE_DIR})
zeek_plugin_begin(mitrecnd HTTP2)
include_directories(BEFORE ${LibBROTLI_INCLUDE_DIR})
zeek_plugin_link_library(${LibBROTLI_LIBRARIES})
zeek_plugin_cc(src/Plugin.cc)
zeek_plugin_cc(src/HTTP2_Frame.cc)
zeek_plugin_cc(src/HTTP2_FrameReassembler.cc)
zeek_plugin_cc(src/HTTP2_HeaderStorage.cc)
zeek_plugin_cc(src/HTTP2_Stream.cc)
zeek_plugin_cc(src/HTTP2.cc)
zeek_plugin_bif(src/events.bif src/http2.bif)
zeek_plugin_dist_files(COPYING LICENSE README README.md VERSION)
zeek_plugin_link_library(${LibNGHTTP2_LIBRARIES})
zeek_plugin_end()
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION LIMIT_COUNT 1)
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Allows building rpm/deb packages via "make package" in build dir.
include(ConfigurePackaging)
ConfigurePackaging(${VERSION})
endif ()