forked from esphome/esphome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
86 lines (63 loc) · 2.5 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
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.5)
project(esphome LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DNDEBUG")
add_compile_options("$<$<CONFIG:DEBUG>:-DNDEBUG>")
add_library(esphome
esphome/components/api/util.cpp
esphome/components/api/proto.cpp
esphome/components/api/list_entities.cpp
esphome/components/api/user_services.cpp
esphome/components/api/subscribe_state.cpp
esphome/components/api/api_server.cpp
esphome/components/api/api_connection.cpp
esphome/components/api/api_pb2.cpp
esphome/components/api/api_pb2_service.cpp
esphome/components/network/async_tcp.cpp
esphome/components/logger/logger.cpp
esphome/components/sensor/sensor.cpp
esphome/components/sensor/filter.cpp
esphome/components/binary_sensor/binary_sensor.cpp
esphome/components/binary_sensor/filter.cpp
esphome/components/switch/switch.cpp
esphome/components/homeassistant/sensor/homeassistant_sensor.cpp
esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp
esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.cpp
# esphome/components/homeassistant/time/homeassistant_time.cpp
esphome/core/util.cpp
esphome/core/controller.cpp
esphome/core/helpers.cpp
esphome/core/component.cpp
esphome/core/log.cpp
esphome/core/preferences.cpp
esphome/core/scheduler.cpp
esphome/core/application.cpp
esphome/cmake_arduino/Arduino.cpp
esphome/cmake_arduino/HardwareSerial.cpp
)
target_include_directories(esphome PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/esphome/cmake_arduino
)
# QT based example
add_executable(test-esp86-qt
esphome/cmake_arduino/example/qt/main.cpp
esphome/cmake_arduino/example/qt/network/async_tcp_client_impl.cpp
esphome/cmake_arduino/example/qt/network/async_tcp_server_impl.cpp
)
target_link_libraries(test-esp86-qt PUBLIC esphome)
# BOOST example
add_executable(test-esp86-boost
esphome/cmake_arduino/example/boost/main.cpp
esphome/cmake_arduino/example/boost/network/async_tcp_client_impl.cpp
esphome/cmake_arduino/example/boost/network/async_tcp_server_impl.cpp
esphome/cmake_arduino/example/boost/esphome_hhc_n8i8op.cpp
)
find_package(Boost)
find_package(Threads)
target_link_libraries(test-esp86-boost PUBLIC Boost::boost Threads::Threads esphome)
target_include_directories(test-esp86-boost PUBLIC ${Boost_INCLUDE_DIRS})
add_definitions(-DCMAKE_BUILD)
#TODO: unit tests here