-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
75 lines (61 loc) · 1.79 KB
/
Copy pathCMakeLists.txt
File metadata and controls
75 lines (61 loc) · 1.79 KB
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.28)
set(CMAKE_CXX_COMPILER_FORCED True)
set(CMAKE_C_COMPILER_FORCED True)
set(PICO_BOARD "pico" CACHE STRING "RP2040 board type (pico, waveshare_rp2040_zero)")
set(PICO_SDK_PATH /Users/ihar/Developer/pico-sdk)
include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)
project(gaggia_pid_mod LANGUAGES C CXX ASM)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
pico_sdk_init()
set(PROJECT_SOURCES
src/main.cpp
src/pid.cpp
src/max31865.cpp
src/spi.cpp
src/led.cpp
src/pwm.cpp
src/clock.cpp
src/i2c.cpp
src/ssd1327.cpp
src/gui.cpp
src/error.cpp
src/pump.cpp
src/vsens.cpp
)
add_executable(main ${PROJECT_SOURCES})
pico_enable_stdio_usb(main 1)
pico_enable_stdio_uart(main 0)
target_link_libraries(main
pico_stdlib
hardware_spi
hardware_i2c
hardware_adc
hardware_pio
)
# Create map/bin/hex files etc.
pico_add_extra_outputs(main)
# Define DEBUG macro for Debug builds (used for debug prints)
target_compile_definitions(main PRIVATE $<$<CONFIG:Debug>:DEBUG>)
# Enable all warnings (only for my own source files)
set_source_files_properties(${PROJECT_SOURCES}
PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Wpedantic -Werror"
)
# Add cppcheck
find_program(CPPCHECK cppcheck)
if(CPPCHECK)
add_custom_command(
TARGET main
PRE_BUILD
COMMAND ${CPPCHECK} src/*.cpp
--enable=all
--quiet
--inconclusive
--check-level=exhaustive
--std=c++17
--suppress=unusedFunction
--suppress=missingIncludeSystem
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
else()
message(WARNING "Cppcheck not found")
endif()