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
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
interval: "monthly"
2 changes: 0 additions & 2 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: update-flake-lock

on:
workflow_dispatch:
schedule:
- cron: '0 18 23 * *'

jobs:
update-flake-inputs:
runs-on: ubuntu-slim
Expand Down
File renamed without changes.
76 changes: 37 additions & 39 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
ci:
autoupdate_schedule: quarterly
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.6
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
- --ignore
- UP036
- id: ruff-format
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.3
hooks:
- id: toml-sort-fix
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.1
hooks:
- id: clang-format
args:
- -i
- --style=Google
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.26.1
hooks:
- id: gersemi
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.9
hooks:
- id: ruff-check
- id: ruff-format
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.4
hooks:
- id: toml-sort-fix
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.2
hooks:
- id: clang-format
args:
- --style=Google
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
exclude: tests/test_python-syntax_error.py
118 changes: 66 additions & 52 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,57 @@ cmake_minimum_required(VERSION 3.22)
set(PROJECT_ORG gepetto)
set(PROJECT_NAME example-robot-data)
set(PROJECT_DESCRIPTION
"Set of robot URDFs for benchmarking and developed examples")
"Set of robot URDFs for benchmarking and developed examples"
)
set(PROJECT_URL https://github.com/${PROJECT_ORG}/${PROJECT_NAME})
# To enable jrl-cmakemodules compatibility with workspace we must define the two
# following lines
set(PROJECT_AUTO_RUN_FINALIZE FALSE)
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})

if(DEFINED INSTALL_PYTHON_INTERFACE_ONLY)
message(
FATAL_ERROR
"CMake option INSTALL_PYTHON_INTERFACE_ONLY has been renamed BUILD_STANDALONE_PYTHON_INTERFACE"
)
message(
FATAL_ERROR
"CMake option INSTALL_PYTHON_INTERFACE_ONLY has been renamed BUILD_STANDALONE_PYTHON_INTERFACE"
)
endif()

# Project configuration
if(NOT BUILD_STANDALONE_PYTHON_INTERFACE)
set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(PROJECT_USE_CMAKE_EXPORT TRUE)
endif()
set(CUSTOM_HEADER_DIR ${PROJECT_NAME})
set(PROJECT_COMPATIBILITY_VERSION AnyNewerVersion)

# Check if the submodule cmake have been initialized
set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake")
if(EXISTS "${JRL_CMAKE_MODULES}/base.cmake")
message(STATUS "JRL cmakemodules found in 'cmake/' git submodule")
message(STATUS "JRL cmakemodules found in 'cmake/' git submodule")
else()
find_package(jrl-cmakemodules QUIET CONFIG)
if(jrl-cmakemodules_FOUND)
get_property(
JRL_CMAKE_MODULES
TARGET jrl-cmakemodules::jrl-cmakemodules
PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}")
else()
message(STATUS "JRL cmakemodules not found. Let's fetch it.")
include(FetchContent)
FetchContent_Declare(
"jrl-cmakemodules"
GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git")
FetchContent_MakeAvailable("jrl-cmakemodules")
FetchContent_GetProperties("jrl-cmakemodules" SOURCE_DIR JRL_CMAKE_MODULES)
endif()
find_package(jrl-cmakemodules QUIET CONFIG)
if(jrl-cmakemodules_FOUND)
get_property(
JRL_CMAKE_MODULES
TARGET jrl-cmakemodules::jrl-cmakemodules
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
)
message(
STATUS
"JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}"
)
else()
message(STATUS "JRL cmakemodules not found. Let's fetch it.")
include(FetchContent)
FetchContent_Declare(
"jrl-cmakemodules"
GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git"
)
FetchContent_MakeAvailable("jrl-cmakemodules")
FetchContent_GetProperties(
"jrl-cmakemodules"
SOURCE_DIR JRL_CMAKE_MODULES
)
endif()
endif()

# JRL-cmakemodule setup
Expand All @@ -64,40 +73,45 @@ compute_project_args(PROJECT_ARGS LANGUAGES CXX)
project(${PROJECT_NAME} ${PROJECT_ARGS})

if(BUILD_STANDALONE_PYTHON_INTERFACE)
add_project_dependency(${PROJECT_NAME} REQUIRED CONFIG)
add_project_dependency(${PROJECT_NAME} REQUIRED CONFIG)
else()
add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(
${PROJECT_NAME}
INTERFACE $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
target_compile_definitions(
${PROJECT_NAME}
INTERFACE
$<INSTALL_INTERFACE:EXAMPLE_ROBOT_DATA_MODEL_DIR="$<INSTALL_PREFIX>/share/${PROJECT_NAME}/robots">
$<BUILD_INTERFACE:EXAMPLE_ROBOT_DATA_MODEL_DIR="${CMAKE_CURRENT_SOURCE_DIR}/robots">
)
install(
TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib)
add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(
${PROJECT_NAME}
INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_compile_definitions(
${PROJECT_NAME}
INTERFACE
$<INSTALL_INTERFACE:EXAMPLE_ROBOT_DATA_MODEL_DIR="$<INSTALL_PREFIX>/share/${PROJECT_NAME}/robots">
$<BUILD_INTERFACE:EXAMPLE_ROBOT_DATA_MODEL_DIR="${CMAKE_CURRENT_SOURCE_DIR}/robots">
)
install(
TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib
)

install(FILES include/${CUSTOM_HEADER_DIR}/path.hpp
DESTINATION include/${CUSTOM_HEADER_DIR})
install(DIRECTORY robots DESTINATION share/${PROJECT_NAME})
install(
FILES include/${CUSTOM_HEADER_DIR}/path.hpp
DESTINATION include/${CUSTOM_HEADER_DIR}
)
install(DIRECTORY robots DESTINATION share/${PROJECT_NAME})
endif()

if(BUILD_PYTHON_INTERFACE)
add_project_dependency(eigenpy 3.0.0 REQUIRED)
add_project_dependency(pinocchio 2.7.0 REQUIRED)
string(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
findpython(REQUIRED)
add_subdirectory(python)
if(BUILD_TESTING)
add_subdirectory(unittest)
endif(BUILD_TESTING)
add_project_dependency(eigenpy 3.0.0 REQUIRED)
add_project_dependency(pinocchio 2.7.0 REQUIRED)
string(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
findpython(REQUIRED)
add_subdirectory(python)
if(BUILD_TESTING)
add_subdirectory(unittest)
endif(BUILD_TESTING)
endif()

setup_project_finalize()
Loading