cmake_minimum_required(VERSION 3.7)
project(kawaii-engine)

add_subdirectory(kawaii-rs)

set(CMAKE_CXX_STANDARD 14)

set(SOURCE_FILES gpio.cpp engine.cpp measure.cpp)

if (MEASURE)
	add_definitions("-DMEASURE")
endif (MEASURE)

#add_executable(engine ${SOURCE_FILES} test.cpp ultrasound_sensor.cpp)
#add_executable(remote ${SOURCE_FILES} remote.cpp)
add_executable(kawaii ${SOURCE_FILES} main.cpp ultrasound_sensor.cpp rfid_reader.cpp MFRC522.cpp rfid_reader.cpp emergency_stop.cpp)

#add_dependencies(engine kawaii-rs)
#add_dependencies(remote kawaii-rs)
add_dependencies(kawaii kawaii-rs)

#target_link_libraries(engine
#        debug "${CMAKE_SOURCE_DIR}/kawaii-rs/target/debug/libkawaii.a"
#        optimized "${CMAKE_SOURCE_DIR}/kawaii-rs/target/release/libkawaii.a"
#        util dl rt pthread gcc_s c m rt pthread util
#        pthread)
#target_link_libraries(remote
#        debug "${CMAKE_SOURCE_DIR}/kawaii-rs/target/debug/libkawaii.a"
#        optimized "${CMAKE_SOURCE_DIR}/kawaii-rs/target/release/libkawaii.a"
#        util dl rt pthread gcc_s c m rt pthread util
#        boost_system pthread)
target_link_libraries(kawaii
		debug "${CMAKE_SOURCE_DIR}/kawaii-rs/target/debug/libkawaii.a"
		optimized "${CMAKE_SOURCE_DIR}/kawaii-rs/target/release/libkawaii.a"
        util dl rt pthread gcc_s c m rt pthread util
        pthread bcm2835)
