-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
41 lines (30 loc) · 986 Bytes
/
CMakeLists.txt
File metadata and controls
41 lines (30 loc) · 986 Bytes
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
cmake_minimum_required(VERSION 3.21)
project(
ArduinoProject
VERSION 1.0
LANGUAGES CXX C)
#set path to where arduino modules can be found
set (CMAKE_MODULE_PATH cmake/modules)
#check dependencies
find_program(AVRDUDE avrdude)
if(NOT AVRDUDE)
message(FATAL_ERROR "avrdude not found. Please install it to continue.")
endif()
find_program(AVR_GCC avr-gcc)
if(NOT AVR_GCC)
message(FATAL_ERROR "avr-gcc not found. Please install it to continue.")
endif()
if (NOT (EXISTS /usr/lib/avr/include))
# This is a bad temporary method, that I'll try to fix it in the future
# but I could not find avr-libc any other way"
message(FATAL_ERROR "avr-libc not found. Please install it to continue.")
endif()
#include arduino uno core library
include(arduino_uno_core)
add_executable(ArduinoUno.elf)
target_sources(ArduinoUno.elf PRIVATE
src/main.cpp)
target_link_libraries(ArduinoUno.elf PRIVATE
ArduinoUnoCore
)
#requires gcc-avr and avrdude and avr-libc