Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The great layout change #14

Merged
merged 11 commits into from
Nov 18, 2022
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
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

39 changes: 12 additions & 27 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,22 @@ on:
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
ROS_DISTRO: galactic
steps:
- uses: actions/checkout@v3

- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.16.x'
- name: Install clang-tidy
run: sudo apt update && sudo apt install clang-tidy-6.0 -y

- name: Install conan
uses: turtlebrowser/get-conan@v1.1
- name: Setup ROS
uses: ros-tooling/setup-ros@v0.2
with:
version: 1.53.0

- name: Build
run: ./tools/build.sh

- name: Test
run: ./tools/test.sh
required-ros-distributions: ${{ env.ROS_DISTRO }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install conan
uses: turtlebrowser/get-conan@v1.1
- name: Build and test
uses: ros-tooling/action-ros-ci@v0.2
with:
version: 1.53.0

- name: Setup clang-format
run: sudo apt update && sudo apt install -y clang-format

- name: Lint
run: ./tools/lint.sh
package-name: beluga
target-ros2-distro: ${{ env.ROS_DISTRO }}
import-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions CMakeLists.txt

This file was deleted.

File renamed without changes.
2 changes: 0 additions & 2 deletions .clang-tidy → beluga/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ Checks: >
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result

WarningsAsErrors: "*"

HeaderFilterRegex: "*"

CheckOptions:
Expand Down
77 changes: 51 additions & 26 deletions beluga/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,61 @@
include(cmake/conan.cmake)
cmake_minimum_required(VERSION 3.16)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR})
project(beluga VERSION 1.0)

conan_cmake_configure(
REQUIRES abseil/20220623.0 range-v3/0.12.0
GENERATORS cmake_find_package)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

conan_cmake_autodetect(settings)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
endif()

conan_cmake_install(
PATH_OR_REFERENCE .
BUILD missing
REMOTE conancenter
SETTINGS ${settings})
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# TODO(nahuel): Add '-Wpedantic -Wconversion' and fix the code.
add_compile_options(-Wall -Werror -Wextra)
endif()

include(FetchContent)
find_package(ament_cmake REQUIRED)
find_package(range-v3 REQUIRED)

FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
ament_target_dependencies(${PROJECT_NAME} range-v3)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)

set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable testing of the benchmark library.")
add_executable(clang_tidy_findable)
target_sources(clang_tidy_findable PRIVATE src/clang_tidy_findable.cpp)
target_link_libraries(clang_tidy_findable PRIVATE ${PROJECT_NAME})

FetchContent_Declare(
googlebenchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.7.0)
if(BUILD_TESTING)
message(STATUS "Build testing enabled.")

FetchContent_MakeAvailable(
googletest
googlebenchmark)
find_package(ament_cmake_clang_format REQUIRED)
ament_clang_format(CONFIG_FILE .clang-format)

add_subdirectory(core)
find_package(ament_cmake_clang_tidy REQUIRED)
ament_clang_tidy(${CMAKE_BINARY_DIR} CONFIG_FILE .clang-tidy)

enable_testing()
add_subdirectory(test)
endif()

install(
TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

ament_export_include_directories("include/${PROJECT_NAME}")

ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(range-v3)

ament_package()

install(
DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
)
Loading