-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
113 lines (85 loc) · 3.58 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
cmake_minimum_required(VERSION 3.1.0)
# set project name
project(IDS)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CMAKE_BUILD_TYPE "Release")
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md")
set(CPACK_PACKAGE_VERSION_MAJOR "${IDS_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${IDS_VERSION_MINOR}")
# Find includes in the build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH}/lib)
set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/mongo-cxx-driver)
set(SRC_PATH ${CMAKE_SOURCE_DIR}/src)
set(UI_PATH ${SRC_PATH}/ui)
set(WORKER_PATH ${SRC_PATH}/worker)
set(GRAPH_PATH ${SRC_PATH}/graph)
set(MODEL_PATH ${CMAKE_SOURCE_DIR}/model)
#include(${CMAKE_BINARY_DIR}/conan.cmake)
#conan_cmake_run(CONANFILE conanfile.txt # or relative build/conanfile.txt
# BASIC_SETUP CMAKE_TARGETS
# BUILD missing)
#add_subdirectory(pybind11)
include_directories(${CMAKE_SOURCE_DIR}/mongo-cxx-driver/include/mongocxx/v_noabi/)
include_directories(${CMAKE_SOURCE_DIR}/mongo-cxx-driver/include/bsoncxx/v_noabi/)
link_directories(${CMAKE_SOURCE_DIR}/mongo-cxx-driver/lib/)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# set(ENV{PYTHONPATH} ${CMAKE_SOURCE_DIR}/model/inference.py ${CMAKE_SOURCE_DIR}/model/fetch_data.py)
find_package(Qt5 REQUIRED COMPONENTS Widgets Core Gui Charts)
find_package(pybind11 CONFIG REQUIRED)
find_package(PCAP REQUIRED)
find_package(mongocxx REQUIRED)
find_package(bsoncxx REQUIRED)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
set(project_source
${SRC_PATH}/main.cpp
${SRC_PATH}/mainwindow.cpp
${SRC_PATH}/packet_capture.cpp
${SRC_PATH}/packet_capture_engine.cpp
${SRC_PATH}/packet_parser.cpp
${SRC_PATH}/basic_flow.cpp
${SRC_PATH}/basic_packet_info.cpp
${SRC_PATH}/flow_generator.cpp
${SRC_PATH}/flow_generator_engine.cpp
${SRC_PATH}/database.cpp
${SRC_PATH}/session_stats.cpp
${WORKER_PATH}/packet_capture_worker.cpp
${WORKER_PATH}/ui_reload_worker.cpp
${WORKER_PATH}/inference_worker.cpp
${SRC_PATH}/Chart.cpp
)
set(project_headers
${SRC_PATH}/packet_capture.hpp
${SRC_PATH}/packet_capture_engine.hpp
${SRC_PATH}/packet_parser.hpp
${SRC_PATH}/basic_flow.hpp
${SRC_PATH}/basic_packet_info.hpp
${SRC_PATH}/flow_features.hpp
${SRC_PATH}/flow_generator.hpp
${SRC_PATH}/flow_generator_engine.hpp
${SRC_PATH}/constants.hpp
${SRC_PATH}/ether_header.hpp
${SRC_PATH}/ip_header.hpp
${SRC_PATH}/protocols.hpp
${SRC_PATH}/tcp_header.hpp
${SRC_PATH}/udp_header.hpp
${SRC_PATH}/utils.hpp
${SRC_PATH}/session_stats.hpp
${SRC_PATH}/mainwindow.h
${WORKER_PATH}/packet_capture_worker.h
${WORKER_PATH}/callback_timer.hpp
${WORKER_PATH}/ui_reload_worker.hpp
${WORKER_PATH}/inference_worker.hpp
${SRC_PATH}/Chart.h
)
set (project_headers_mac ${SRC_PATH}/mainwindow.h ${WORKER_PATH}/packet_capture_worker.h ${WORKER_PATH}/ui_reload_worker.hpp ${SRC_PATH}/Chart.h)
set(project_ui ${UI_PATH}/mainwindow.ui)
qt5_wrap_ui(project_headers_wrapped ${project_ui})
qt5_wrap_cpp(project_source_mac ${project_headers_mac})
make_directory(${EXECUTABLE_OUTPUT_PATH}/bin/model)
file(COPY ${MODEL_PATH} DESTINATION ${CMAKE_BINARY_DIR}/bin)
add_executable(${PROJECT_NAME} ${project_source} ${project_headers} ${project_headers_wrapped} ${project_source_mac})
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} ${PCAP_LIBRARY} mongocxx bsoncxx pybind11::embed Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Charts)