cmake_minimum_required(VERSION 2.8.11)

project(libubox)

include_directories(
	../../../
)

file(
	GLOB
	source_files
	../../avl.c
	../../avl-cmp.c
	../../blob.c
	../../blobmsg.c
	../../uloop.c
	../../usock.c
	../../ustream.c
	../../ustream-fd.c
	../../vlist.c
	../../utils.c
	../../safe_list.c
	../../runqueue.c
	../../md5.c
	../../kvlist.c
	../../ulog.c
	../../base64.c
	../../blobmsg_json.c
)

set(CMAKE_C_FLAGS "-Wall -Werror --std=gnu99 -g3 -Wmissing-declarations")

add_library(
        ubox
        SHARED
        ${source_files}
)

target_link_libraries (ubox 
	LINK_PUBLIC 
	json-c
	rt
	)

target_include_directories (ubox PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
