From 2c915b27e10c02795eea8b2fb9f327a62c5ef40d Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 22 Sep 2011 20:34:38 +0000 Subject: [PATCH] add OS switch to select system library --- CMakeLists.txt | 23 +++++++++++++++++------ 1 file 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}) -- 2.11.0