-
Notifications
You must be signed in to change notification settings - Fork 14
/
CmakeLists.txt
54 lines (37 loc) · 1.52 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
cmake_minimum_required(VERSION 2.8.4)
set(ARDUINO_CPU=atmega2560)
SET(MCU atmega2560)
SET(F_CPU 16000000)
SET(ARDUINO_SDK_PATH C:/Arduino/)
#SET(ARDUINO_CXX_FLAGS -mmcu=${MCU} -DF_CPU=${F_CPU} -Os)
#
#set(ARDUINO_CXX_FLAGS -mmcu=${MCU})
set(CMAKE_C_FLAGS -mmcu=${MCU})
set(CMAKE_CXX_FLAGS -mmcu=${MCU})
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/ArduinoToolchain.cmake)
set(PROJECT_NAME ArduinoMid)
project(${PROJECT_NAME})
set(${CMAKE_PROJECT_NAME}_BOARD mega)
set(${CMAKE_PROJECT_NAME}_PORT /dev/ttys3)
set(${CMAKE_PROJECT_NAME}_SKETCH ./MID/MID.ino)
generate_arduino_firmware(${CMAKE_PROJECT_NAME})
set(BOARD_TAG mega)
set(BOARD_SUB atmega2560)
set(SOURCES Arduino.h )
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${ARDUINO_SDK}/libraries)
#
# Enable syntax check for Serial class from UsbApi.h
# To set definitions use "-D"[DefName]
add_definitions( -DUSBCON=1 )
add_definitions ( -DSerial2=Serial)
link_directories("libraries")
# For some reason, these paths have to be absolute, otherwise
# CLion won't be able to find headers etc.
#SET(CMAKE_C_COMPILER /usr/local/Cellar/avr-gcc/4.9.3/bin/avr-gcc)
#SET(CMAKE_CXX_COMPILER /usr/local/Cellar/avr-gcc/4.9.3/bin/avr-g++)
#SET(ARDUINO_C_FLAGS -mmcu=${MCU} )
#SET(ARDUINO_CXX_FLAGS -mmcu=${MCU} -DF_CPU=${F_CPU} -Os)
#SET(ARDUINO_LINKER_FLAGS -mmcu=${MCU} -DF_CPU=${F_CPU} -Os)
link_directories(${ARDUINO_SDK_PATH}hardware/arduino/avr/cores/arduino)
#link_directories(${ARDUINO_SDK_PATH}hardware/arduino/avr/cores/arduino/)
link_directories($ENV{HOMEPATH}/Documents/Arduino/libraries)