dhcpv6: fix strncpy bounds
[project/odhcp6c.git] / CMakeLists.txt
index aedeebf02a90d890c977f1a4de593916e5a0d55d..a5b0cb397e0965550fb5710b62165e06c3a598db 100644 (file)
@@ -15,13 +15,22 @@ if(${EXT_CER_ID})
        add_definitions(-DEXT_CER_ID=${EXT_CER_ID})
 endif(${EXT_CER_ID})
 
-if(${EXT_BFD_PING})
-       add_definitions(-DEXT_BFD_PING)
-       set(BFD_SOURCE src/bfd.c)
-endif(${EXT_BFD_PING})
+set(SOURCES src/odhcp6c.c src/dhcpv6.c src/ra.c src/script.c)
 
-add_executable(odhcp6c src/odhcp6c.c src/dhcpv6.c src/ra.c src/script.c src/md5.c ${BFD_SOURCE})
-target_link_libraries(odhcp6c resolv)
+set(LIBRARIES resolv)
+
+if(USE_LIBUBOX)
+       add_definitions(-DUSE_LIBUBOX)
+       set(LIBRARIES ${LIBRARIES} ubox)
+       FIND_PATH(ubox_include_dir libubox/md5.h)
+       INCLUDE_DIRECTORIES(${ubox_include_dir})
+else()
+       set(SOURCES ${SOURCES} src/md5.c)
+endif()
+
+add_executable(odhcp6c ${SOURCES})
+
+target_link_libraries(odhcp6c ${LIBRARIES})
 
 # Installation
 install(TARGETS odhcp6c DESTINATION sbin/)