Add ability to build fastnetmon without PF_RING support for build at Travis CI

This commit is contained in:
Pavel Odintsov 2015-01-24 18:23:08 +03:00
parent 12fcc1b9dc
commit 1bbefbfc36
2 changed files with 19 additions and 14 deletions

@ -13,7 +13,7 @@ before_script:
- sudo apt-get install -y build-essential bison flex libnuma-dev wget tar make
- cd PF_RING-6.0.2; cd userland/lib; ./configure --prefix=/opt/pf_ring; make; sudo make install
- cd `cat /tmp/old_current_path`
script: mkdir -p build; cd build; cmake ..; make
script: mkdir -p build; cd build; cmake .. -DDISABLE_PF_RING_SUPPORT=ON; make
notifications:
email:
recipients:

@ -24,19 +24,22 @@ if (FASTNETMON_PROFILER)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FASTNETMON_PROFILE_FLAGS}")
endif()
# Set path to home compiled PF_RING
set(PFRING_INCLUDE_DIRS /opt/pf_ring/include)
set(PFRING_LIBRARIES /opt/pf_ring/lib/libpfring.so)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message("You are running Linux and we can build PF_RING support")
# Fefines for enable PF_RING for FastNetMon compiation
add_definitions(-DPF_RING)
else()
message("You are running not an Linux and we can't build PF_RING support")
# With this flag we can diable PF_RING build via console: cmake .. -DDISABLE_PF_RING_SUPPORT=ON
if (NOT DISABLE_PF_RING_SUPPORT)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
message("You are running Linux and we can build PF_RING support")
set (ENABLE_PFRING_SUPPORT ON)
else()
message("You are running not an Linux and we can't build PF_RING support")
endif()
endif()
if (ENABLE_PFRING_SUPPORT)
# Set path to home compiled PF_RING
set(PFRING_INCLUDE_DIRS /opt/pf_ring/include)
set(PFRING_LIBRARIES /opt/pf_ring/lib/libpfring.so)
add_definitions(-DPF_RING)
endif()
# If you need hardware locking features
# add_definitions(-DHWFILTER_LOCKING)
@ -92,6 +95,8 @@ target_link_libraries(fastnetmon patricia)
target_link_libraries(fastnetmon sflow_plugin)
target_link_libraries(fastnetmon netflow_plugin)
# Custom PF_RING
include_directories(${PFRING_INCLUDE_DIRS})
if (ENABLE_PFRING_SUPPORT)
# Custom PF_RING
include_directories(${PFRING_INCLUDE_DIRS})
endif()
target_link_libraries(fastnetmon ${PFRING_LIBRARIES})