X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=CMakeLists.txt;h=eb112af20b54582785e7b0ffa80e22365d559f27;hb=67bc554465d9a364a5a0e5d418b42ad4d117911d;hp=8ef71b224ecde5438d3482899a943f1a614806e5;hpb=dc8c37fa8b9d198a8744ae5e1bc76a36ed617f89;p=project%2Flibubox.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ef71b2..eb112af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,12 +8,9 @@ IF(APPLE) 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 vlist.c) ADD_LIBRARY(ubox SHARED ${SOURCES}) -ADD_LIBRARY(blobmsg_json SHARED blobmsg_json.c) - -TARGET_LINK_LIBRARIES(blobmsg_json ubox json) SET(CMAKE_INSTALL_PREFIX /usr) @@ -21,6 +18,26 @@ FILE(GLOB headers *.h) INSTALL(FILES ${headers} DESTINATION include/libubox ) -INSTALL(TARGETS ubox blobmsg_json +INSTALL(TARGETS ubox LIBRARY DESTINATION lib ) + +find_library(json json) +IF(EXISTS ${json}) + ADD_LIBRARY(blobmsg_json SHARED blobmsg_json.c) + TARGET_LINK_LIBRARIES(blobmsg_json ubox 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()