Skip to content

drichelson/teensy-cmake

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

teensy-cmake

Mac only! help make this work on other platforms. teensy-cmake is a template for Teensy projects that uses CMake to build your sketches. It is forked from https://github.com/xya/teensy-cmake and is intended to be simpler and also it works on Mac OS. This lets you develop for Teensy using your favorite text editor and terminal. I use Clion: https://www.jetbrains.com/clion/ which can easily import CMake projects. CLion is a great IDE and even has a Serial console plugin available so you never need to open the Arduino IDE again.

This has been tested on Mac OS 10.11.2 with a Teensy 3.2

Requirements- install newer/older versions at your peril!

Once all the above items have been installed it is probably a good idea to test out your Teensy with the Arduino app. Try uploading an example sketch.

Create a build directory:

Building

mkdir build
cd build

Run CMake:

cmake ..

Build with:

make -j main

Flashing sketches to the Teensy

make -j main_Upload

Custom configuration

For some sketches, the Teensy needs to run in a different 'USB mode'. You can set this in the sketch's CMakeLists.txt file:

set(TEENSY_USB_MODE MIDI)

add_teensy_executable(...)

You can set the 'default' mode in the CMake GUI ('TEENSY_USB_MODE' variable).

Importing libraries

Here is a simple example of how to import a library:

import_arduino_library(Bounce)

add_teensy_executable(...)

About

Project template for building Teensy sketches and source code using CMake

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CMake 93.2%
  • C++ 6.8%