-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
64 lines (51 loc) · 1.74 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
cmake_minimum_required ( VERSION 3.4.3 )
project ( ml_classifiers CXX )
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/home/lnutimura/snort_src/boost_1_67_0")
#set (CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/usr/include/python3.7")
if ( APPLE )
set ( CMAKE_MACOSX_RPATH OFF )
endif ( APPLE )
include ( FindPkgConfig )
pkg_search_module ( SNORT3 REQUIRED snort>=3 )
add_library (
ml_classifiers MODULE
ml_classifiers.cc
ml_classifiers.h
)
if ( APPLE )
set_target_properties (
ml_classifiers
PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup"
)
endif ( APPLE )
set_target_properties (
ml_classifiers
PROPERTIES
PREFIX ""
)
find_package ( Python3 COMPONENTS Interpreter Development )
if ( Python3_FOUND )
find_package ( Boost COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} )
endif ( Python3_FOUND )
message ( "[*] PYTHON_LIBRARY_DIRS: ${Python3_LIBRARY_DIRS}" )
message ( "[*] PYTHON_LIBRARIES: ${Python3_LIBRARIES}" )
message ( "[*] PYTHON_EXECUTABLE: ${Python3_EXECUTABLE}" )
message ( "[*] PYTHON_INCLUDE_DIRS: ${Python3_INCLUDE_DIRS}" )
message ( "[*] BOOST_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}" )
message ( "[*] BOOST_LIBRARIES: ${Boost_LIBRARIES}" )
message ( "[*] BOOST_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}" )
include_directories ( ${Python3_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} )
target_link_libraries ( ml_classifiers ${Python3_LIBRARIES} ${Boost_LIBRARIES} )
target_include_directories (
ml_classifiers PUBLIC
${SNORT3_INCLUDE_DIRS}
)
install (
TARGETS ml_classifiers
LIBRARY
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${CMAKE_PROJECT_NAME}/inspectors"
)