This repository was archived by the owner on Apr 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +52
-0
lines changed Expand file tree Collapse file tree 5 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ project(Examples LANGUAGES C CXX ASM)
55add_subdirectory (hello-world)
66add_subdirectory (arduino-library)
77add_subdirectory (3rd-party-library)
8+ add_subdirectory (header-only-library)
89add_subdirectory (blink-example)
910add_subdirectory (servo-knob-example)
1011add_subdirectory (sketch)
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.8.2)
2+
3+ project (Header_Only_Lib)
4+ get_board_id(board_id nano atmega328)
5+
6+ add_arduino_executable(Header_Only_Lib ${board_id} headerOnlyTest.cpp)
7+
8+ # Find the library by 'tricking' the framework to use current directory as the Sketchbook path,
9+ # allowing us to use the 'find' API
10+ set (ARDUINO_CMAKE_SKETCHBOOK_PATH "${CMAKE_CURRENT_LIST_DIR} " )
11+ find_arduino_library(headerTest test -lib ${board_id} 3RD_PARTY HEADER_ONLY)
12+
13+ link_arduino_library(Header_Only_Lib headerTest ${board_id} HEADER_ONLY)
Original file line number Diff line number Diff line change 1+ #include < Arduino.h>
2+ #include < TestLib.hpp>
3+
4+ void setup ()
5+ {
6+ pinMode (BAR, OUTPUT);
7+ }
8+
9+ void loop ()
10+ {
11+ foo ();
12+ delayMicroseconds (SOME_DELAY);
13+ }
14+
15+ void foo ()
16+ {
17+ digitalWrite (BAR, HIGH);
18+ }
Original file line number Diff line number Diff line change 1+ name =Test Library
2+ version =0.1
3+ author =Arduino-CMake-NG
4+ maintainer =Arduino-CMake-NG <https://github.com/arduino-cmake/Arduino-CMake-NG>
5+ sentence =Arduino library to test header-only feature support in the Arduino-CMake framework
6+ paragraph =Arduino library to test header-only feature support in the Arduino-CMake framework
7+ category =Display
8+ url =https://github.com/arduino-cmake/Arduino-CMake-NG
9+ architectures =*
Original file line number Diff line number Diff line change 1+ #ifndef EXAMPLES_TESTLIB_HPP
2+ #define EXAMPLES_TESTLIB_HPP
3+
4+ #include < Arduino.h>
5+
6+ #define BAR 1
7+ #define SOME_DELAY 200
8+
9+ void foo ();
10+
11+ #endif // EXAMPLES_TESTLIB_HPP
You can’t perform that action at this time.
0 commit comments