-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
44 lines (34 loc) · 952 Bytes
/
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
cmake_minimum_required(VERSION 2.8)
set(PRJ dpdk-dpi)
project(${PRJ})
file(GLOB SOURCES
src/*.cpp
src/protocols/*.cpp
)
set(DPDK_RTE_TARGET x86_64-native-linuxapp-gcc)
include_directories(
$ENV{RTE_SDK}/${DPDK_RTE_TARGET}/include
src/
)
link_directories($ENV{RTE_SDK}/${DPDK_RTE_TARGET}/lib)
set(DPDK_DRIVERS
"-lrte_pmd_ixgbe -lrte_pmd_vmxnet3_uio -lrte_pmd_pcap"
)
set(DPDK_LIBS
"-Wl,--whole-archive"
"-lrte_eal -lrte_mempool -lrte_mbuf -lrte_ring -lethdev -lrte_kvargs ${DPDK_DRIVERS}"
"-Wl,--no-whole-archive"
)
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall"
)
add_definitions(-mssse3)
option(DPI_DEBUG "Debug mode (allow asserts, debug messages, etc)" OFF)
add_definitions(-DNDEBUG)
if(DPI_DEBUG)
remove_definitions (-DNDEBUG)
endif(DPI_DEBUG)
add_executable(${PRJ} ${SOURCES})
add_subdirectory(test)
target_link_libraries(${PRJ} ${DPDK_LIBS})
target_link_libraries(${PRJ} pthread dl glog pcap)