# CMakeLists files in this project can
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.
cmake_minimum_required (VERSION 3.0)

project (domo)

set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/build/bin")
set(ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/lib")
set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/build/lib")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules/")

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libuv ${CMAKE_CURRENT_BINARY_DIR}/libuv)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libwebsockets ${CMAKE_CURRENT_BINARY_DIR}/libwebsockets)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../nats.c ${CMAKE_CURRENT_BINARY_DIR}/nats.c)
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../json-c ${CMAKE_CURRENT_BINARY_DIR}/json-c)
add_subdirectory(src)

add_custom_target (static_analysis
	COMMAND echo "Static Analysis ......"
	COMMAND ${CMAKE_SOURCE_DIR}/tools/static_analysis.sh ${CMAKE_SOURCE_DIR}/build
)

add_custom_target (valgrind
	COMMAND valgrind --leak-check=full --trace-children=yes --malloc-fill=AE --free-fill=BD --track-origins=yes ${CMAKE_SOURCE_DIR}/build/bin/domo-iot
)
