2014-11-28 15:22:27 +01:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
|
2014-11-28 15:58:12 +01:00
|
|
|
# cmake versions:
|
2014-11-28 15:22:27 +01:00
|
|
|
# Debian 6 - 2.8.2
|
|
|
|
# Debian 7 - 2.8.9
|
|
|
|
# CentOS 6 - 2.8.12
|
|
|
|
|
|
|
|
project(FastNetMon)
|
|
|
|
|
|
|
|
set (Tutorial_VERSION_MAJOR 1)
|
2014-11-28 15:58:12 +01:00
|
|
|
set (Tutorial_VERSION_MINOR 1)
|
2014-11-28 15:22:27 +01:00
|
|
|
|
2014-11-28 15:58:12 +01:00
|
|
|
# Set path to home compiled PF_RING
|
|
|
|
set(PFRING_INCLUDE_DIRS /opt/pf_ring/include)
|
|
|
|
set(PFRING_LIBRARIES /opt/pf_ring/lib/libpfring.so)
|
|
|
|
|
|
|
|
# Some defines for FastNetMon compiation tuning
|
2014-11-28 15:22:27 +01:00
|
|
|
add_definitions(-DENABLE_CONNTRACKING)
|
|
|
|
add_definitions(-DPF_RING)
|
|
|
|
|
2014-11-28 15:58:12 +01:00
|
|
|
# Our LPM library
|
2014-11-28 15:22:27 +01:00
|
|
|
add_library(libpatricia STATIC libpatricia/patricia.c)
|
|
|
|
|
2014-11-28 15:58:12 +01:00
|
|
|
# Main tool
|
2014-11-28 15:22:27 +01:00
|
|
|
add_executable(fastnetmon fastnetmon.cpp)
|
|
|
|
|
|
|
|
# Find boost: http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html
|
2014-12-01 09:09:37 +01:00
|
|
|
|
|
|
|
# Disable cmake script from Boost package becaus it is broken: http://public.kitware.com/Bug/view.php?id=15270
|
|
|
|
set(Boost_NO_BOOST_CMAKE ON)
|
|
|
|
# Enable detailed errors
|
2014-11-28 15:58:12 +01:00
|
|
|
set(Boost_DETAILED_FAILURE_MSG ON)
|
2014-12-01 09:09:37 +01:00
|
|
|
|
2014-11-28 15:58:12 +01:00
|
|
|
find_package(Boost COMPONENTS thread regex REQUIRED)
|
|
|
|
|
2014-11-28 15:22:27 +01:00
|
|
|
if(Boost_FOUND)
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(fastnetmon ${Boost_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2014-11-28 15:58:12 +01:00
|
|
|
# Try to find ncurses library
|
|
|
|
find_package(Curses REQUIRED)
|
|
|
|
|
|
|
|
if(CURSES_FOUND)
|
|
|
|
include_directories(${CURSES_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(fastnetmon ${CURSES_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# External libs
|
2014-11-28 15:22:27 +01:00
|
|
|
target_link_libraries(fastnetmon log4cpp)
|
|
|
|
target_link_libraries(fastnetmon numa)
|
|
|
|
target_link_libraries(fastnetmon pthread)
|
|
|
|
|
2014-11-28 15:58:12 +01:00
|
|
|
# Our libs
|
|
|
|
target_link_libraries(fastnetmon libpatricia)
|
2014-11-28 15:22:27 +01:00
|
|
|
|
2014-11-28 15:58:12 +01:00
|
|
|
# Custom PF_RING
|
|
|
|
include_directories(${PFRING_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(fastnetmon ${PFRING_LIBRARIES})
|