1 cmake_minimum_required(VERSION 2.6)
4 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
6 OPTION(BUILD_LUA "build Lua plugin" ON)
8 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
11 INCLUDE_DIRECTORIES(/opt/local/include)
12 LINK_DIRECTORIES(/opt/local/lib)
15 ADD_LIBRARY(ubus SHARED libubus.c libubus-io.c libubus-obj.c libubus-sub.c libubus-req.c)
16 TARGET_LINK_LIBRARIES(ubus ubox)
18 ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c)
19 TARGET_LINK_LIBRARIES(ubusd ubox)
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)
26 ADD_SUBDIRECTORY(examples)
28 INSTALL(TARGETS ubus cli
29 LIBRARY DESTINATION lib
30 RUNTIME DESTINATION bin
33 RUNTIME DESTINATION sbin
36 INSTALL(FILES ubusmsg.h ubus_common.h libubus.h DESTINATION include)