-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
182 lines (166 loc) · 6.25 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# !!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE
# https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
#
# If you need to override existing CMake configuration or add extra,
# please create `CMakeListsUser.txt` in the root of project.
# The `CMakeListsUser.txt` will not be overwritten by PlatformIO.
cmake_minimum_required(VERSION 3.2)
project(espx-dancing-led)
include(CMakeListsPrivate.${BUILD_TARGET}.txt)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeListsUser.txt)
include(CMakeListsUser.txt)
endif()
add_custom_target(
PLATFORMIO_DEPS_INSTALL ALL
COMMAND ${PLATFORMIO_CMD} lib -e esp8266 -e esp32 install
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_DEPS_UPDATE ALL
COMMAND ${PLATFORMIO_CMD} lib -e esp8266 -e esp32 update
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# > PLATFORMIO_BUILD
add_custom_target(
PLATFORMIO_BUILD_8266 ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --environment esp8266
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_BUILD_32 ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --environment esp32
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_BUILD ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --environment esp8266 --environment esp32
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# < BUILD
# > PLATFORMIO_BUILD_VERBOSE
add_custom_target(
PLATFORMIO_BUILD_VERBOSE_8266 ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --verbose --environment esp8266
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_BUILD_VERBOSE_32 ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --verbose --environment esp32
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_BUILD_VERBOSE ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --verbose --environment esp8266 --environment esp32
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# < PLATFORMIO_BUILD_VERBOSE
# > PLATFORMIO_UPLOAD
add_custom_target(
PLATFORMIO_UPLOAD_8266 ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp8266
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_8266_RELEASE ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp8266:release
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_8266_OTA ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp8266:ota
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_8266_OTA_RELEASE ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp8266:ota:release
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_32 ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp32
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_32_RELEASE ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp32:release
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_32_OTA ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp32:ota
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_32_OTA_RELEASE ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp32:ota:release
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp8266 --environment esp32
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_RELEASE ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp8266:release --environment esp32:release
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_OTA ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp8266:ota --environment esp32:ota
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOAD_OTA_RELEASE ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload --environment esp8266:ota:release --environment esp32:ota:release
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# < PLATFORMIO_UPLOAD
# > PLATFORMIO_UPLOADFS
add_custom_target(
PLATFORMIO_UPLOADFS_8266 ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs --environment esp8266
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOADFS_32 ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs --environment esp32
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPLOADFS ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs --environment esp8266 --environment esp32
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# < PLATFORMIO_UPLOAD
add_custom_target(
PLATFORMIO_CLEAN ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_MONITOR ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion device monitor
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_TEST ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion test
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_PROGRAM ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target program
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_UPDATE_ALL ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion update
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
PLATFORMIO_REBUILD_PROJECT_INDEX ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion init --ide clion
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_executable(${PROJECT_NAME} ${SRC_LIST})