summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2011-09-22 20:34:38 +0000
committerSteven Barth <steven@midlink.org>2011-09-22 20:34:38 +0000
commit2c915b27e10c02795eea8b2fb9f327a62c5ef40d (patch)
tree146436ba63151625858a721aee766aaa59e24988 /CMakeLists.txt
parent78637a9ca3fd717f347d9b44b3b8ac9cafe6db57 (diff)
add OS switch to select system library
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 17 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6da39df..de0c74b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,15 +10,26 @@ IF(APPLE)
LINK_DIRECTORIES(/opt/local/lib)
ENDIF()
+SET(SOURCES
+ main.c utils.c interface.c interface-ip.c
+ proto.c proto-static.c proto-shell.c
+ config.c device.c bridge.c vlan.c ubus.c)
+
+SET(LIBS
+ ubox ubus uci json blobmsg_json)
+
+IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ SET(SOURCES ${SOURCES} system-linux.c)
+ SET(LIBS ${LIBS} nl)
+ELSE()
+ SET(SOURCES ${SOURCES} system-dummy.c)
+ENDIF()
+
IF(DEBUG)
ADD_DEFINITIONS(-DDEBUG -O0 --std=gnu99 -g3)
ENDIF()
-ADD_EXECUTABLE(netifd
- main.c utils.c interface.c interface-ip.c
- proto.c proto-static.c proto-shell.c
- config.c device.c bridge.c vlan.c ubus.c
- system-dummy.c)
+ADD_EXECUTABLE(netifd ${SOURCES})
-TARGET_LINK_LIBRARIES(netifd ubox ubus uci json blobmsg_json)
+TARGET_LINK_LIBRARIES(netifd ${LIBS})