# Specify the minimum version for CMake
cmake_minimum_required(VERSION 3.14...3.31)
project(iotshd_log_example_sample_c VERSION 1.0.0 LANGUAGES C CXX)

set(IOTSHD_LOG_BUILD_DAEMON OFF)

# Add the iotshdlog library
get_filename_component(LOG_PROJECT_DIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE)
add_subdirectory(${LOG_PROJECT_DIR} ${CMAKE_BINARY_DIR}/iotshdlog)

# Set the C and C++ standards
set(CMAKE_C_STANDARD 90)
set(CMAKE_C_STANDARD_REQUIRED ON)

# Add executables
add_executable(sample_c sample_c.c)
target_include_directories(sample_c PRIVATE iotshd::log_c_static)
target_link_libraries(sample_c PRIVATE iotshd::log_c_static)