remove the "method" argument for object subscription
[project/ubus.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 PROJECT(ubus C)
4 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
5
6 OPTION(BUILD_LUA "build Lua plugin" ON)
7
8 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
9
10 IF(APPLE)
11   INCLUDE_DIRECTORIES(/opt/local/include)
12   LINK_DIRECTORIES(/opt/local/lib)
13 ENDIF()
14
15 ADD_LIBRARY(ubus SHARED libubus.c libubus-io.c libubus-obj.c libubus-sub.c)
16 TARGET_LINK_LIBRARIES(ubus ubox)
17
18 ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c)
19 TARGET_LINK_LIBRARIES(ubusd ubox)
20
21 ADD_EXECUTABLE(cli cli.c)
22 SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus)
23 TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json json)
24
25 SET(CMAKE_INSTALL_PREFIX /usr)
26
27 ADD_SUBDIRECTORY(lua)
28 ADD_SUBDIRECTORY(examples)
29
30 INSTALL(TARGETS ubus cli
31         LIBRARY DESTINATION lib
32         RUNTIME DESTINATION bin
33 )
34 INSTALL(TARGETS ubusd
35         RUNTIME DESTINATION sbin
36 )
37
38 INSTALL(FILES ubusmsg.h ubus_common.h libubus.h DESTINATION include)