-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (28 loc) · 1020 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.6)
PROJECT(firewall3 C)
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations -Wno-format-truncation)
SET(iptc_libs ip4tc)
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
IF (NOT DISABLE_STATIC_EXTENSIONS)
LIST(APPEND ext_libs iptext)
LIST(APPEND ext_libs iptext4)
IF (NOT DISABLE_IPV6)
LIST(APPEND ext_libs iptext6)
ENDIF()
ELSE()
ADD_DEFINITIONS(-DDISABLE_STATIC_EXTENSIONS)
ENDIF()
IF (NOT DISABLE_IPV6)
LIST(APPEND iptc_libs ip6tc)
IF (ENABLE_NAT6)
ADD_DEFINITIONS(-DENABLE_NAT6)
ENDIF()
ELSE()
ADD_DEFINITIONS(-DDISABLE_IPV6)
ENDIF()
FIND_PATH(uci_include_dir uci.h)
INCLUDE_DIRECTORIES(${uci_include_dir})
ADD_EXECUTABLE(firewall3 main.c options.c defaults.c zones.c forwards.c rules.c redirects.c snats.c utils.c ubus.c ipsets.c includes.c iptables.c helpers.c)
TARGET_LINK_LIBRARIES(firewall3 uci ubox ubus xtables m dl ${iptc_libs} ${ext_libs})
SET(CMAKE_INSTALL_PREFIX /usr)
INSTALL(TARGETS firewall3 RUNTIME DESTINATION sbin)