1 cmake_minimum_required(VERSION 3.3)
7 main.c network.c host.c service.c pex.c utils.c
9 wg.c wg-dummy.c wg-user.c
12 SET(RUNSTATEDIR /var/run)
14 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations -DRUNSTATEDIR="${RUNSTATEDIR}")
15 FIND_LIBRARY(libjson NAMES json-c json)
17 OPTION(UBUS_SUPPORT "enable ubus support" ON)
18 IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
19 FIND_LIBRARY(nl nl-tiny)
20 find_library(bpf NAMES bpf)
21 SET(SOURCES ${SOURCES} wg-linux.c vxlan.c bpf.c rtnl.c)
27 SET(SOURCES ${SOURCES} ubus.c)
28 ADD_DEFINITIONS(-DUBUS_SUPPORT=1)
29 FIND_LIBRARY(ubus ubus)
34 ADD_EXECUTABLE(unetd ${SOURCES})
35 TARGET_LINK_LIBRARIES(unetd ubox ${ubus} blobmsg_json ${libjson} ${nl} ${bpf})
38 RUNTIME DESTINATION sbin
39 LIBRARY DESTINATION lib