X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=CMakeLists.txt;h=e5bf46b5000e084989148754f149a6b83faaa251;hp=e307cd7a0e4e491199b8475ab5fc0f9451bc36fa;hb=c9e852301ba4059da47418fcaede22d6fa4603e9;hpb=efd7c8c4df2b922aa9691ba2b679147d6fb7a18f diff --git a/CMakeLists.txt b/CMakeLists.txt index e307cd7..e5bf46b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,17 @@ cmake_minimum_required(VERSION 2.8) PROJECT(ubox C) ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3) -SET(SOURCES avl.c blob.c blobmsg.c hash.c uhtbl.c uloop.c) -IF("${CMAKE_SYSTEM}" MATCHES "Linux") - SET(SOURCES ${SOURCES} unl.c) -ENDIF("${CMAKE_SYSTEM}" MATCHES "Linux") +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) 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) @@ -16,6 +21,6 @@ FILE(GLOB headers *.h) INSTALL(FILES ${headers} DESTINATION include/libubox ) -INSTALL(TARGETS ubox +INSTALL(TARGETS ubox blobmsg_json LIBRARY DESTINATION lib )