summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-12-30 09:09:22 +0100
committerSteven Barth <steven@midlink.org>2013-12-30 09:09:22 +0100
commit2ca0bfaf3e80af40888507dfeb3e155e8e3c03c4 (patch)
tree20c0c5fd00dca8926253d4c5e95e6ca697969860 /CMakeLists.txt
parent35ddaaab886883268b4b374e60e4b70567e4c592 (diff)
Make ubus optional
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09173e4..4a774a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,15 +8,20 @@ set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99")
-add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra -DWITH_UBUS)
+add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra)
if(${EXT_PREFIX_CLASS})
add_definitions(-DEXT_PREFIX_CLASS=${EXT_PREFIX_CLASS})
endif(${EXT_PREFIX_CLASS})
+if(${UBUS})
+ add_definitions(-DWITH_UBUS)
+ set(EXT_SRC ${EXT_SRC} src/ubus.c)
+ 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/md5.c src/dhcpv6-ia.c src/dhcpv4.c src/ubus.c)
-target_link_libraries(odhcpd resolv ubus ubox uci)
+add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/md5.c src/dhcpv6-ia.c src/dhcpv4.c ${EXT_SRC})
+target_link_libraries(odhcpd resolv ubox uci ${EXT_LINK})
# Installation
install(TARGETS odhcpd DESTINATION sbin/)