-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (57 loc) · 1.79 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
cmake_minimum_required(VERSION 3.21)
# Setup paths to arduino environment and libraries
file(REAL_PATH "~/.arduino15/packages/STMicroelectronics/hardware/stm32/2.7.1" CORE_PATH EXPAND_TILDE)
file(TO_CMAKE_PATH "${CORE_PATH}" CORE_PATH)
file(REAL_PATH "~/Arduino/libraries" USER_LIBS EXPAND_TILDE)
file(TO_CMAKE_PATH "${USER_LIBS}" USER_LIBS)
# Setup the cmake module path and toolchain
# FIXME Testing cmake fixes
#list(APPEND CMAKE_MODULE_PATH ${CORE_PATH}/cmake)
list(APPEND CMAKE_MODULE_PATH /home/dpd/opsol_projects/Arduino_Core_STM32/cmake)
set(CMAKE_TOOLCHAIN_FILE toolchain)
# You may remove this block when using this file as the sketch's CMakeLists.txt
if (NOT ${CMAKE_PARENT_LIST_FILE} STREQUAL ${CMAKE_CURRENT_LIST_FILE})
# When we are imported from the main CMakeLists.txt, we should stop here
# not to interfere with the true build config.
return()
endif()
project("swd-console")
include(set_board)
# Options
# SERIAL generic / disabled / none
# USB none / CDCgen / CDC / HID
# XUSB FS / HS / HSFS
# VIRTIO disable / generic / enabled
# BOOTLOADER dfuo / dfu2 / hid
set_board("BLUEPILL_F103CB"
USB none
)
include(overall_settings)
overall_settings(
# STANDARD_LIBC
# PRINTF_FLOAT
# SCANF_FLOAT
# DEBUG_SYMBOLS
# LTO
# NO_RELATIVE_MACRO
# UNDEF_NDEBUG
# OPTIMIZATION "s"
# BUILD_OPT ./build.opt
# DISABLE_HAL_MODULES ADC I2C RTC SPI TIM DAC EXTI ETH SD QSPI
# CORE_CALLBACK
)
include_directories(src)
include(build_sketch)
build_sketch(TARGET flash_led
SOURCES
examples/flash_led/flash_led.ino
examples/flash_led/flash_led.cpp
src/SWDStream.cpp src/SWDStream.h
)
build_sketch(TARGET test_command
SOURCES
examples/test_command/test_command.ino
examples/test_command/test_command.cpp
src/SWDStream.cpp src/SWDStream.h
src/CommandParser.cpp src/CommandParser.h
)