X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=CMakeLists.txt;h=b32cbb9fc38cac31adfd08db7a47025147e1848c;hp=29809cc9c77b80a72041f61f00d744b60586fe8a;hb=d366a6de839087d8a17e5855c14ae55e95b13c65;hpb=4a3bb66cd415b1c11ec69590699fed16eddd7bbb diff --git a/CMakeLists.txt b/CMakeLists.txt index 29809cc..b32cbb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,9 @@ cmake_minimum_required(VERSION 2.6) PROJECT(ubus C) -ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3) +ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations) + +OPTION(BUILD_LUA "build Lua plugin" ON) SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") @@ -10,7 +12,7 @@ IF(APPLE) LINK_DIRECTORIES(/opt/local/lib) ENDIF() -ADD_LIBRARY(ubus SHARED libubus.c) +ADD_LIBRARY(ubus SHARED libubus.c libubus-io.c libubus-obj.c libubus-sub.c) TARGET_LINK_LIBRARIES(ubus ubox) ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c) @@ -20,11 +22,11 @@ ADD_EXECUTABLE(cli cli.c) SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus) TARGET_LINK_LIBRARIES(cli ubus ubox blobmsg_json json) -ADD_EXECUTABLE(ubus-example ubus-example.c) -TARGET_LINK_LIBRARIES(ubus-example ubus ubox) - SET(CMAKE_INSTALL_PREFIX /usr) +ADD_SUBDIRECTORY(lua) +ADD_SUBDIRECTORY(examples) + INSTALL(TARGETS ubus cli LIBRARY DESTINATION lib RUNTIME DESTINATION bin