cmake_minimum_required(VERSION 3.25) project(GlucoseMonitor C) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Find the pkg-config package find_package(PkgConfig REQUIRED) # Use pkg-config to find cJSON pkg_check_modules(CJSON REQUIRED libcjson) # Use pkg-config to find curl pkg_check_modules(LIBCURL REQUIRED libcurl) # Add the executable add_executable(glucose_monitor src/main.c libs/log.c/src/log.c) # Link against the cJSON library target_link_libraries(glucose_monitor PRIVATE ${LIBCURL_LIBRARIES} ${CJSON_LIBRARIES}) # Include cJSON's include directories target_include_directories(glucose_monitor PRIVATE include libs/log.c/src ${LIBCURL_LIBRARIES} ${CJSON_INCLUDE_DIRS})