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 SET(SOURCES ${SOURCES} wg-linux.c vxlan.c)
25 SET(SOURCES ${SOURCES} ubus.c)
26 ADD_DEFINITIONS(-DUBUS_SUPPORT=1)
27 FIND_LIBRARY(ubus ubus)
32 ADD_EXECUTABLE(unetd ${SOURCES})
33 TARGET_LINK_LIBRARIES(unetd ubox ${ubus} blobmsg_json ${libjson} ${nl})
36 RUNTIME DESTINATION sbin
37 LIBRARY DESTINATION lib