listener: add a more complex example using parsing
[project/ubus.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8)
2
3 PROJECT(ubus C)
4 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3)
5
6 IF(APPLE)
7   INCLUDE_DIRECTORIES(/opt/local/include)
8   LINK_DIRECTORIES(/opt/local/lib)
9 ENDIF()
10
11 ADD_LIBRARY(ubus SHARED libubus.c)
12 TARGET_LINK_LIBRARIES(ubus ubox)
13
14 ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c)
15 TARGET_LINK_LIBRARIES(ubusd ubox)
16
17 ADD_EXECUTABLE(cli cli.c)
18 SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus)
19 TARGET_LINK_LIBRARIES(cli ubus ubox json)
20
21 ADD_EXECUTABLE(listener listener.c)
22 TARGET_LINK_LIBRARIES(listener ubus ubox)
23
24 SET(CMAKE_INSTALL_PREFIX /usr)
25
26 INSTALL(TARGETS ubus cli
27         LIBRARY DESTINATION lib
28         RUNTIME DESTINATION bin
29 )
30 INSTALL(TARGETS ubusd
31         RUNTIME DESTINATION sbin
32 )
33
34 INSTALL(FILES ubusmsg.h ubus_common.h libubus.h DESTINATION include)