cmake_minimum_required (VERSION 3.0)

project (ubox)

ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)

set (CMAKE_MODULE_PATH "${MODULE_PATH}")

set(DISABLE_TARGET_OPTIMIZATION ON)

include (br)

# Logd

add_executable (logd 
	$ENV{SRC_DIR}/src/3P/ubox/log/logd.c
	$ENV{SRC_DIR}/src/3P/ubox/log/syslog.c)
target_link_libraries (logd ubox ubus)
install (TARGETS logd RUNTIME DESTINATION sbin)

# Logread

add_executable (logread 
	$ENV{SRC_DIR}/src/3P/ubox/log/logread.c)
target_link_libraries (logread ubox ubus json-c blobmsg_json)
install (TARGETS logread RUNTIME DESTINATION sbin)

# kmodloader

add_executable (kmodloader 
	$ENV{SRC_DIR}/src/3P/ubox/kmodloader.c)
target_link_libraries (kmodloader ubox)
install (TARGETS kmodloader RUNTIME DESTINATION ../sbin)

# validate_data
add_executable (validate_data 
	$ENV{SRC_DIR}/src/3P/ubox/validate/cli.c
	$ENV{SRC_DIR}/src/3P/ubox/validate/validate.c)
target_link_libraries (validate_data ubox uci)
install (TARGETS validate_data RUNTIME DESTINATION ../sbin)
