wireless: add retry_setup_failed to status notification
[project/netifd.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 PROJECT(netifd C)
4 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations)
5
6 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
7
8 IF(APPLE)
9   INCLUDE_DIRECTORIES(/opt/local/include)
10   LINK_DIRECTORIES(/opt/local/lib)
11 ENDIF()
12
13 SET(SOURCES
14         main.c utils.c system.c tunnel.c handler.c
15         interface.c interface-ip.c interface-event.c
16         iprule.c proto.c proto-static.c proto-shell.c
17         config.c device.c bridge.c vlan.c alias.c
18         macvlan.c ubus.c vlandev.c wireless.c)
19
20
21 SET(LIBS
22         ubox ubus uci json-c blobmsg_json)
23
24 IF (NOT DEFINED LIBNL_LIBS)
25   FIND_LIBRARY(libnl NAMES libnl-3 libnl nl-3 nl)
26   SET(LIBNL_LIBS ${libnl})
27 ENDIF()
28
29 IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux" AND NOT DUMMY_MODE)
30         SET(SOURCES ${SOURCES} system-linux.c)
31         SET(LIBS ${LIBS} ${LIBNL_LIBS})
32 ELSE()
33         ADD_DEFINITIONS(-DDUMMY_MODE=1)
34         SET(SOURCES ${SOURCES} system-dummy.c)
35 ENDIF()
36
37 IF(DEBUG)
38   ADD_DEFINITIONS(-DDEBUG -g3)
39   IF(NO_OPTIMIZE)
40     ADD_DEFINITIONS(-O0)
41   ENDIF()
42 ENDIF()
43
44
45 ADD_EXECUTABLE(netifd ${SOURCES})
46
47 TARGET_LINK_LIBRARIES(netifd ${LIBS})
48
49 INSTALL(TARGETS netifd
50         RUNTIME DESTINATION sbin
51 )