-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
37 lines (28 loc) · 959 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
cmake_minimum_required(VERSION 2.8)
project(nfq_filter)
# c++11
include(CXX11.cmake)
check_for_cxx11_compiler(CXX11_COMPILER)
if(CXX11_COMPILER)
enable_cxx11()
else()
message( FATAL_ERROR "c++11 compatible compiler not found!" )
endif()
# check libnetfilter (test)
#find_library(
# end check libnetfilter (test)
# check libnetfilter headers
INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
if( HAVE_STDINT_H )
set(CMAKE_REQUIRED_FLAGS "-include stdint.h")
ENDIF(HAVE_STDINT_H)
CHECK_INCLUDE_FILES("libnetfilter_queue/libnetfilter_queue.h" HAVE_NFQUEUE_H)
if(NOT HAVE_NFQUEUE_H)
message( FATAL_ERROR "libnetfilter_queue.h not found!" )
endif()
find_library(NFQUEUE_LIB netfilter_queue $ENV{NFQUEUE_LIB_PATH})
set(SOURCE_EXE nfq.cpp)
set(NFQ_SOURCES "nfq.cpp" "config.cpp" "sender.cpp" "parser.cpp")
add_executable(nfq_filter ${NFQ_SOURCES})
target_link_libraries(nfq_filter -lnetfilter_queue -lpthread -lnfnetlink)