-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
75 lines (60 loc) · 1.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
cmake_minimum_required(VERSION 3.13)
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
project(homer2 VERSION 0.1 LANGUAGES C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(PICO_BOARD pico_w)
set(PICO_CXX_ENABLE_EXCEPTIONS 1)
pico_sdk_init()
add_subdirectory(homer2_base)
add_subdirectory(homer2_sensor)
configure_file(src/homer2_config.h.in src/homer2_config.h)
if ("$ENV{HOMER2_VICTORIA_WRITE_INITIAL_DELAY_MILLIS_DISABLE}" STREQUAL "true")
set(_HOMER2_VICTORIA_WRITE_INITIAL_DELAY_MILLIS_DISABLE true)
else ()
set(_HOMER2_VICTORIA_WRITE_INITIAL_DELAY_MILLIS_DISABLE false)
endif ()
add_executable(homer2 homer2.c)
target_compile_definitions(
homer2 PRIVATE
WIFI_SSID=\"${WIFI_SSID}\"
WIFI_PASSWORD=\"${WIFI_PASSWORD}\"
WIFI_COUNTRY=\"${WIFI_COUNTRY}\"
HOMER2_VICTORIA_ADDR=\"${HOMER2_VICTORIA_ADDR}\"
HOMER2_VICTORIA_PORT=\"${HOMER2_VICTORIA_PORT}\"
HOMER2_VICTORIA_WRITE_INITIAL_DELAY_MILLIS_DISABLE=${_HOMER2_VICTORIA_WRITE_INITIAL_DELAY_MILLIS_DISABLE}
)
target_sources(
homer2 PRIVATE
src/homer2_pusher.cpp
src/homer2_pusher.hpp
src/homer2_sensor.cpp
src/homer2_sensor.hpp
src/homer2_init.cpp
src/homer2_init.hpp
src/homer2_main.cpp
src/homer2_main.h
)
target_include_directories(
homer2 PRIVATE
"${CMAKE_CURRENT_LIST_DIR}"
"${CMAKE_BINARY_DIR}/src"
)
target_link_libraries(
homer2 PRIVATE
pico_cyw43_arch_lwip_threadsafe_background
pico_stdlib
hardware_i2c
homer2_util
homer2_logging
homer2_i2c
homer2_bme68x
homer2_sht4x
homer2_sgp40
homer2_bmp3xx
homer2_sunrise
homer2_pmsx00x
)
pico_add_extra_outputs(homer2)
pico_enable_stdio_usb(homer2 1)
pico_enable_stdio_uart(homer2 1)