ubus/CMakeLists.txt

37 lines
886 B
Text
Raw Normal View History

2010-12-06 03:51:58 +01:00
cmake_minimum_required(VERSION 2.8)
PROJECT(ubus C)
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3)
2011-01-31 19:32:58 +01:00
2011-02-07 18:54:27 +01:00
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
IF(APPLE)
INCLUDE_DIRECTORIES(/opt/local/include)
LINK_DIRECTORIES(/opt/local/lib)
ENDIF()
2011-01-31 19:32:58 +01:00
ADD_LIBRARY(ubus SHARED libubus.c)
TARGET_LINK_LIBRARIES(ubus ubox)
2010-12-06 03:51:58 +01:00
ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c)
2010-12-06 03:51:58 +01:00
TARGET_LINK_LIBRARIES(ubusd ubox)
ADD_EXECUTABLE(cli cli.c)
SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus)
2011-02-06 16:14:36 +01:00
TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json json)
2010-12-06 03:51:58 +01:00
2011-02-06 02:15:10 +01:00
ADD_EXECUTABLE(ubus-example ubus-example.c)
TARGET_LINK_LIBRARIES(ubus-example ubus ubox)
2010-12-06 03:51:58 +01:00
2011-01-31 21:17:33 +01:00
SET(CMAKE_INSTALL_PREFIX /usr)
INSTALL(TARGETS ubus cli
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
INSTALL(TARGETS ubusd
RUNTIME DESTINATION sbin
)
2011-02-05 00:06:28 +01:00
INSTALL(FILES ubusmsg.h ubus_common.h libubus.h DESTINATION include)