libubus: restore uloop_cancelled on timeout
[project/ubus.git] / CMakeLists.txt
index 22027ec..cb2f420 100644 (file)
@@ -9,8 +9,10 @@ OPTION(ENABLE_SYSTEMD "systemd support" ON)
 
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 SET(UBUS_UNIX_SOCKET "/var/run/ubus.sock")
+SET(UBUS_MAX_MSGLEN 1048576)
 
 ADD_DEFINITIONS( -DUBUS_UNIX_SOCKET="${UBUS_UNIX_SOCKET}")
+ADD_DEFINITIONS( -DUBUS_MAX_MSGLEN=${UBUS_MAX_MSGLEN})
 
 IF(APPLE)
   INCLUDE_DIRECTORIES(/opt/local/include)
@@ -23,9 +25,10 @@ TARGET_LINK_LIBRARIES(ubus ubox)
 ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c)
 TARGET_LINK_LIBRARIES(ubusd ubox)
 
+find_library(json NAMES json-c json)
 ADD_EXECUTABLE(cli cli.c)
 SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus)
-TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json json)
+TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json ${json})
 
 ADD_SUBDIRECTORY(lua)
 ADD_SUBDIRECTORY(examples)