X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=CMakeLists.txt;h=ab82270915435b2c37b1573cbc3d2f8f74e22ccf;hp=9e8f093f5ceac202bb048ec3d1d4834d045903a4;hb=d03a6a27c7fcdca70db417c15cdccc0185b1efef;hpb=a7c9ae6d6ac39d17670a2e881e296f7973f0fe77 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e8f093..ab82270 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,16 @@ cmake_minimum_required(VERSION 2.6) PROJECT(ubox 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) IF(APPLE) INCLUDE_DIRECTORIES(/opt/local/include) LINK_DIRECTORIES(/opt/local/lib) ENDIF() -SET(SOURCES avl.c blob.c blobmsg.c uloop.c usock.c) +SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c) ADD_LIBRARY(ubox SHARED ${SOURCES}) @@ -22,11 +24,24 @@ INSTALL(TARGETS ubox LIBRARY DESTINATION lib ) +ADD_SUBDIRECTORY(lua) + find_library(json json) IF(EXISTS ${json}) ADD_LIBRARY(blobmsg_json SHARED blobmsg_json.c) TARGET_LINK_LIBRARIES(blobmsg_json ubox json) - INSTALL(TARGETS blobmsg_json + + ADD_EXECUTABLE(jshn jshn.c) + TARGET_LINK_LIBRARIES(jshn json) + + INSTALL(TARGETS blobmsg_json jshn LIBRARY DESTINATION lib + RUNTIME DESTINATION bin ) + + FILE(GLOB scripts sh/*.sh) + INSTALL(FILES ${scripts} + DESTINATION share/libubox + ) + ENDIF()