cmake_minimum_required(VERSION 3.0)

project(domod)

set (CMAKE_MODULE_PATH "${MODULE_PATH}")
set (CMAKE_CXX_STANDARD 11)

include (br)

include_directories(${workspaceRoot}/src/prog/domod/src)
include_directories(${workspaceRoot}/src/prog/domod/include)

#set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror=strict-aliasing")

file(
	GLOB_RECURSE
	source_files
	${workspaceRoot}/src/prog/domod/src/main.cpp
	# devices
	${workspaceRoot}/src/prog/domod/src/devices/devices-manager.cpp	
	${workspaceRoot}/src/prog/domod/src/devices/device.cpp
	${workspaceRoot}/src/prog/domod/src/devices/light-device.cpp
	${workspaceRoot}/src/prog/domod/src/devices/shutter-device.cpp
	${workspaceRoot}/src/prog/domod/src/devices/sprinkler-device.cpp
	${workspaceRoot}/src/prog/domod/src/devices/light.cpp
	${workspaceRoot}/src/prog/domod/src/devices/shutter.cpp
	${workspaceRoot}/src/prog/domod/src/devices/sprinkler.cpp
	# ubus models
	${workspaceRoot}/src/prog/domod/src/ubus/capabilities_model.cpp
	${workspaceRoot}/src/prog/domod/src/ubus/capabilities_lights_model.cpp
	${workspaceRoot}/src/prog/domod/src/ubus/capabilities_shutters_model.cpp
	${workspaceRoot}/src/prog/domod/src/ubus/capabilities_sprinklers_model.cpp
	${workspaceRoot}/src/prog/domod/src/ubus/sequences_model.cpp
	# timers
	${workspaceRoot}/src/prog/domod/src/sequences/sequences-manager.cpp
	${workspaceRoot}/src/prog/domod/src/sequences/sequence.cpp
	${workspaceRoot}/src/prog/domod/src/sequences/timer.cpp
	${workspaceRoot}/src/prog/domod/src/sequences/action.cpp
	${workspaceRoot}/src/prog/domod/src/sequences/clock.cpp
	# helper
	${workspaceRoot}/src/prog/domod/src/helpers/strings.cpp
)
	
#	$ENV{SRC_DIR}/src/prog/domod/src/ubus/speach_command.cpp
#	$ENV{SRC_DIR}/src/prog/domod/src/helpers/Tokenizer.cpp
#)

add_executable (domod ${source_files})

target_link_libraries (domod 
	LINK_PUBLIC
	ubus-cpp
	json-c
	ubox
	ubus
	blobmsg_json
	rt
)

install (TARGETS domod DESTINATION local/bin)