1 cmake_minimum_required(VERSION 2.6)
4 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3)
6 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
9 INCLUDE_DIRECTORIES(/opt/local/include)
10 LINK_DIRECTORIES(/opt/local/lib)
13 ADD_LIBRARY(ubus SHARED libubus.c)
14 TARGET_LINK_LIBRARIES(ubus ubox)
16 ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c)
17 TARGET_LINK_LIBRARIES(ubusd ubox)
19 ADD_EXECUTABLE(cli cli.c)
20 SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus)
21 TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json json)
23 ADD_EXECUTABLE(ubus-example ubus-example.c)
24 TARGET_LINK_LIBRARIES(ubus-example ubus ubox)
26 SET(CMAKE_INSTALL_PREFIX /usr)
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)