-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
49 lines (35 loc) · 1.61 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
# This file is maintained by zkg. Do not edit.
# Put required additional cmake functionality into plugin.cmake.
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(ZeekPluginProtobufAnalyzer)
# Establish version numbers in config.h
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION LIMIT_COUNT 1)
string(REGEX REPLACE "[.-]" " " version_numbers ${VERSION})
separate_arguments(version_numbers)
list(GET version_numbers 0 VERSION_MAJOR)
list(GET version_numbers 1 VERSION_MINOR)
list(GET version_numbers 2 VERSION_PATCH)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY)
# Process any package-specific customizations
include(plugin.cmake OPTIONAL)
# Our plugin source and scripts are in a subdirectory
set(BRO_PLUGIN_BASE "${CMAKE_CURRENT_SOURCE_DIR}")
include(ZeekPlugin)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/libinjection )
zeek_plugin_begin(Pipoca ProtobufAnalyzer ${ZEEK_PLUGIN_BEGIN_OPTS})
file(GLOB cc_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "src/*.cc" "src/libinjection/*.c")
foreach(file ${cc_files})
zeek_plugin_cc(${file})
endforeach ()
file(GLOB bif_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "src/*.bif")
foreach(file ${bif_files})
zeek_plugin_bif(${file})
endforeach ()
zeek_plugin_dist_files(README CHANGES COPYING VERSION)
zeek_plugin_end()
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Allows building rpm/deb packages via "make package" in build dir.
include(ConfigurePackaging)
ConfigurePackaging(${VERSION})
endif ()