cmake_minimum_required (VERSION 3.0)

project (chacond)

set (CMAKE_MODULE_PATH "${MODULE_PATH}")

include (br)

include_directories ($ENV{SRC_DIR}/src/prog/chacond)

file (
	GLOB_RECURSE
	source_files

	$ENV{SRC_DIR}/src/prog/chacond/src/main.c
	$ENV{SRC_DIR}/src/prog/chacond/src/ubus-model.c
	$ENV{SRC_DIR}/src/prog/chacond/src/chacon.c
)

add_executable (chacond ${source_files})

target_link_libraries (chacond 
	LINK_PUBLIC
	ubox
	ubus
	blobmsg_json
	wiringPi
	rt
	pthread
)

install (TARGETS chacond DESTINATION local/bin)