# Set your project name set(PROJECT ArcticStation) # set(eclipse-paho-mqtt-c_DIR "/usr/local/lib/cmake/eclipse-paho-mqtt-c") # Set the minimum required CMake version cmake_minimum_required(VERSION 3.5) # Set the C standard to C11 and C++ standard to C++17 set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) # Export compile commands for IDEs set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) # Set the board type, assuming it's a Raspberry Pi Pico set(PICO_BOARD "pico_w") # Initialize the Pico SDK include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake) # Set your project name and languages project(${PROJECT} C CXX ASM) # Initialize the Raspberry Pi Pico SDK pico_sdk_init() find_package(eclipse-paho-mqtt-c REQUIRED) # Include directories for your project include_directories(source/sensors source/types source/wifi source/mqtt) # Set your project source files set(SOURCES source/arctic_station.cpp source/sensors/pms7003.cpp source/sensors/aqi_sensor_serial.cpp source/types/arctic_station_init.cpp source/wifi/wifi.cpp ) # Add the executable target add_executable(${PROJECT} ${SOURCES}) # Add compile options add_compile_options( -Wall -Werror -Wno-redefined ) # Add include directories for the project target_include_directories(${PROJECT} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) # Link necessary libraries target_link_libraries(${PROJECT} PRIVATE pico_cyw43_arch_lwip_threadsafe_background pico_stdlib eclipse-paho-mqtt-c::paho-mqtt3as ) # Create additional outputs (map/bin/hex/uf2 file) pico_add_extra_outputs(${PROJECT})