Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build library

on:
push:
branches:
- master

jobs:
build:
permissions:
contents: write
packages: read

uses: UMRoboticsTeam/umrt-ci-cd/.github/workflows/cmake-build.yaml@main
with:
build_image: ghcr.io/umroboticsteam/umrt-build:v0.0.12
publish_image: ghcr.io/umroboticsteam/umrt-apt-image:latest
publish_repo: UMRoboticsTeam/umrt-apt-repo
secrets:
APT_SIGNING_PUBKEY: ${{ secrets.APT_SIGNING_PUBKEY }}
APT_SIGNING_KEY: ${{ secrets.APT_SIGNING_KEY }}
APT_DEPLOY_KEY: ${{ secrets.APT_DEPLOY_KEY }}
15 changes: 15 additions & 0 deletions .github/workflows/doxygen-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Deploy Doxygen to Github Pages

on:
push:
branches:
- master

jobs:
doxygen:
uses: UMRoboticsTeam/umrt-ci-cd/.github/workflows/doxygen-gh-pages.yaml@main

permissions:
pages: write
id-token: write
packages: read
13 changes: 13 additions & 0 deletions .github/workflows/semver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Assert version is incremented

on:
pull_request:
branches:
- master

jobs:
check-version:
permissions:
packages: read

uses: UMRoboticsTeam/umrt-ci-cd/.github/workflows/standard-semver.yaml@main
107 changes: 107 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
cmake_minimum_required(VERSION 3.22.1)
project(openFrameworksArduino)

# ********** Setup CMake **********

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# enables building a static library but later link it into a dynamic library
add_compile_options(-fPIC)
endif()
if(NOT WIN32)
# About -Wno-sign-conversion: With Clang, -Wconversion implies -Wsign-conversion. There are a number of
# implicit sign conversions in gtest.cc, see https://ci.ros2.org/job/ci_osx/9381/clang/.
# Hence disabling -Wsign-conversion for now until all those have eventually been fixed.
# (from https://github.com/ros2/rcutils/pull/263#issuecomment-663252537)
add_compile_options(-Wall -Wextra -Wconversion -Wno-sign-conversion -Wpedantic)
endif()

# Setup Boost
find_package(Boost REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIRS})

# ********** Setup openFrameworksArduino library **********

set(openFrameworksArduino_sources
src/ofArduino.cpp
src/ofSerial.cpp
src/ofSerialLinux.cpp
src/ofSerialWin.cpp
)
set_source_files_properties(
${openFrameworksArduino_sources}
PROPERTIES language "CXX")
add_library(
${PROJECT_NAME}
${openFrameworksArduino_sources})
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src/>"
"$<INSTALL_INTERFACE:src/${PROJECT_NAME}>")


target_link_libraries(${PROJECT_NAME}
${Boost_LIBRARIES}
)

set(public_headers
src/ofArduino.h
src/ofConstants.h
src/ofSerial.h
src/ofSerialLinux.h
src/ofSerialWin.h
src/ofTypes.h
)

set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${public_headers}")

# ********** Setup ArduinoTest executable **********

set(arduino_test_target ArduinoTest)
set(arduino_test_sources
examples/ArduinoTest.cpp
examples/HexapodTimingTest.cpp
examples/PlaybackMovements.cpp
examples/Test.cpp
)
set_source_files_properties(
${arduino_test_sources}
PROPERTIES language "CXX")
add_executable(
${arduino_test_target}
${arduino_test_sources})
target_include_directories(${arduino_test_target} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/examples>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/examples>"
"$<INSTALL_INTERFACE:examples/${PROJECT_NAME}>")

target_link_libraries(${arduino_test_target}
${PROJECT_NAME}
)

set_target_properties(${arduino_test_target} PROPERTIES LINKER_LANGUAGE CXX)

# ********** Setup packaging **********

include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME}
EXPORT "${PROJECT_NAME}Targets"
COMPONENT ${PROJECT_NAME}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(TARGETS ${arduino_test_target}
EXPORT "${arduino_test_target}Targets"
COMPONENT ${arduino_test_target}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

message(STATUS "Components to pack: ${CPACK_COMPONENTS_ALL}")
include(cpack.cmake)
Loading
Loading