treewide: add netlink file
[project/odhcpd.git] / CMakeLists.txt
index 34a21d0..839f47f 100644 (file)
@@ -7,6 +7,11 @@ project(odhcpd C)
 set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99")
 
+FIND_PATH(ubox_include_dir libubox/uloop.h)
+FIND_PATH(libnl-tiny_include_dir netlink-generic.h PATH_SUFFIXES libnl-tiny)
+INCLUDE_DIRECTORIES(${ubox_include_dir} ${libnl-tiny_include_dir})
+
+FIND_LIBRARY(libnl NAMES nl-tiny)
 
 add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra)
 
@@ -20,8 +25,8 @@ if(${UBUS})
        set(EXT_LINK ${EXT_LINK} ubus)
 endif(${UBUS})
 
-add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/dhcpv6-ia.c src/dhcpv4.c ${EXT_SRC})
-target_link_libraries(odhcpd resolv ubox uci ${EXT_LINK})
+add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/dhcpv6-ia.c src/dhcpv4.c src/netlink.c ${EXT_SRC})
+target_link_libraries(odhcpd resolv ubox uci ${libnl} ${EXT_LINK})
 
 # Installation
 install(TARGETS odhcpd DESTINATION sbin/)