Skip to content

Commit

Permalink
Update kinematics and collision packages to leverage cmake components (
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong authored Sep 5, 2023
1 parent 791d4ca commit 787c320
Show file tree
Hide file tree
Showing 66 changed files with 679 additions and 497 deletions.
76 changes: 70 additions & 6 deletions .cmake-format
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,22 @@ with section("parse"):
'configure_package': {
'pargs': {'nargs': 0},
'kwargs': {
'COMPONENT': '?',
'NAMESPACE': '?',
'TARGETS': '*',
'SUPPORTED_COMPONENTS': '*',
'DEPENDENCIES': '*',
'CFG_EXTRAS': '*',
}
},
'configure_component': {
'pargs': {'nargs': 0},
'kwargs': {
'COMPONENT': '?',
'NAMESPACE': '?',
'TARGETS': '*',
'DEPENDENCIES': '*',
'CFG_EXTRAS': '*',
}
},
'add_gtest_discover_tests': {
Expand Down Expand Up @@ -98,16 +112,66 @@ with section("parse"):
'EXCLUDE': '*',
}
},
'tesseract_cpack': {
'install_targets': {
'pargs': {'nargs': 0},
'kwargs': {
'VERSION': 1,
'MAINTAINER': 1,
'DESCRIPTION': 1,
'LICENSE_FILE': 1,
'README_FILE': 1,
'TARGETS': '*',
'COMPONENT': '?',
}
},
'cpack': {
'pargs': {'nargs': 0},
'kwargs': {
'VERSION': '?',
'MAINTAINER_NAME': '?',
'MAINTAINER_EMAIL': '?',
'VENDOR': '?',
'DESCRIPTION': '?',
'LICENSE_FILE': '?',
'README_FILE': '?',
'PACKAGE_PREFIX': '?',
'LINUX_BUILD_DEPENDS': '*',
'WINDOWS_BUILD_DEPENDS': '*',
'LINUX_DEPENDS': '*',
'WINDOWS_DEPENDS': '*',
}
},
'cpack_component_package': {
'pargs': {'nargs': 0},
'kwargs': {
'VERSION': '?',
'MAINTAINER_NAME': '?',
'MAINTAINER_EMAIL': '?',
'VENDOR': '?',
'DESCRIPTION': '?',
'LICENSE_FILE': '?',
'README_FILE': '?',
'PACKAGE_PREFIX': '?',
'COMPONENT_DEPENDS': '*',
}
},
'cpack_component': {
'pargs': {'nargs': 0},
'kwargs': {
'COMPONENT': '?',
'VERSION': '?',
'DESCRIPTION': '?',
'PACKAGE_PREFIX': '?',
'LINUX_BUILD_DEPENDS': '*',
'WINDOWS_BUILD_DEPENDS': '*',
'LINUX_DEPENDS': '*',
'WINDOWS_DEPENDS': '*',
'COMPONENT_DEPENDS': '*',
}
},
'cpack_debian_source_package': {
'pargs': {'nargs': 0},
'kwargs': {
'CHANGLELOG': '?',
'UPLOAD': '?',
'DPUT_HOST': '?',
'DEBIAN_INCREMENT': '?',
'DISTRIBUTIONS': '*',
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_dependencies.repos
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- git:
local-name: ros_industrial_cmake_boilerplate
uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git
version: 0.4.5
version: 0.5.3
- git:
local-name: opw_kinematics
uri: https://github.com/Jmeyer1292/opw_kinematics.git
Expand Down
2 changes: 1 addition & 1 deletion dependencies.repos
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- git:
local-name: ros_industrial_cmake_boilerplate
uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git
version: 0.4.7
version: 0.5.3
- git:
local-name: opw_kinematics
uri: https://github.com/Jmeyer1292/opw_kinematics.git
Expand Down
2 changes: 1 addition & 1 deletion dependencies_with_ext.repos
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- git:
local-name: ros_industrial_cmake_boilerplate
uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git
version: 0.4.7
version: 0.5.3
- git:
local-name: tesseract_ext
uri: https://github.com/ros-industrial-consortium/tesseract_ext.git
Expand Down
63 changes: 30 additions & 33 deletions tesseract_collision/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.6.0)
cmake_minimum_required(VERSION 3.15.0)

# Extract package name and version
find_package(ros_industrial_cmake_boilerplate REQUIRED)
Expand All @@ -9,13 +9,13 @@ if(WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

# All of these are used by all components so to avoid having them in each they are include here
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system program_options serialization)
find_package(octomap REQUIRED)
find_package(console_bridge REQUIRED)
find_package(tesseract_geometry REQUIRED)
find_package(tesseract_common REQUIRED)
find_package(tesseract_support REQUIRED)
find_package(yaml-cpp REQUIRED)

# These targets are necessary for 16.04 builds. Remove when Kinetic support is dropped
Expand Down Expand Up @@ -71,22 +71,34 @@ endif()
set(CONTACT_MANAGERS_PLUGINS "")

# Core
set(SUPPORTED_COMPONENTS core)
add_subdirectory(core)

# Bullet (currently required for creation of convex hulls)
list(APPEND SUPPORTED_COMPONENTS bullet)
add_subdirectory(bullet)

# Test Suite
option(TESSERACT_BUILD_TEST_SUITE "Build Test Suite components" ON)
if(TESSERACT_BUILD_TEST_SUITE)
message("Building Test Suite components")
list(APPEND SUPPORTED_COMPONENTS test_suite)
add_subdirectory(test_suite)
endif()

# FCL
option(TESSERACT_BUILD_FCL "Build FCL components" ON)
if(TESSERACT_BUILD_FCL)
message("Building FCL components")
list(APPEND SUPPORTED_COMPONENTS fcl)
add_subdirectory(fcl)
endif()

# VHACD
option(TESSERACT_BUILD_VHACD "Build VHACD components" ON)
if(TESSERACT_BUILD_VHACD)
message("Building VHACD components")
list(APPEND SUPPORTED_COMPONENTS vhacd)
add_subdirectory(vhacd)
endif()

Expand All @@ -107,7 +119,8 @@ if((TESSERACT_ENABLE_TESTING OR TESSERACT_COLLISION_ENABLE_TESTING) AND TESSERAC
endif()

# Benchmarks
if((TESSERACT_ENABLE_BENCHMARKING OR TESSERACT_COLLISION_ENABLE_BENCHMARKING) AND TESSERACT_BUILD_FCL)
if((TESSERACT_ENABLE_BENCHMARKING OR TESSERACT_COLLISION_ENABLE_BENCHMARKING) AND TESSERACT_BUILD_FCL
AND TESSERACT_BUILD_TEST_SUITE)
add_subdirectory(test/benchmarks)
endif()

Expand All @@ -116,40 +129,24 @@ if((TESSERACT_ENABLE_EXAMPLES OR TESSERACT_COLLISION_ENABLE_EXAMPLES) AND TESSER
add_subdirectory(examples)
endif()

configure_package(NAMESPACE tesseract)
configure_package(COMPONENT core SUPPORTED_COMPONENTS ${SUPPORTED_COMPONENTS})

if(TESSERACT_PACKAGE)
set(LINUX_DEPENDS
"libbullet-dev"
"libbullet-extras-dev"
"libeigen3-dev"
"libconsole-bridge-dev"
"libyaml-cpp-dev"
"${TESSERACT_PACKAGE_PREFIX}tesseract-geometry"
"${TESSERACT_PACKAGE_PREFIX}tesseract-common"
"${TESSERACT_PACKAGE_PREFIX}tesseract-support")

set(WINDOWS_DEPENDS
"Eigen3"
"console_bridge"
"bullet"
"bullet_extras"
"yaml-cpp"
"${TESSERACT_PACKAGE_PREFIX}tesseract-geometry"
"${TESSERACT_PACKAGE_PREFIX}tesseract-common"
"${TESSERACT_PACKAGE_PREFIX}tesseract-support")

if(TESSERACT_BUILD_FCL)
list(APPEND LINUX_DEPENDS "libfcl-dev (>= 0.6.0) | ${TESSERACT_PACKAGE_PREFIX}fcl")
list(APPEND LINUX_DEPENDS "fcl (>= 0.6.0) | ${TESSERACT_PACKAGE_PREFIX}fcl")
endif()

tesseract_cpack(
cpack_component_package(
VERSION ${pkg_extracted_version}
MAINTAINER <https://github.com/ros-industrial-consortium/tesseract>
MAINTAINER_NAME ${pkg_extracted_maintainer_name}
MAINTAINER_EMAIL ${pkg_extracted_maintainer_email}
DESCRIPTION ${pkg_extracted_description}
LICENSE_FILE ${CMAKE_CURRENT_LIST_DIR}/../LICENSE
README_FILE ${CMAKE_CURRENT_LIST_DIR}/../README.md
LINUX_DEPENDS ${LINUX_DEPENDS}
WINDOWS_DEPENDS ${WINDOWS_DEPENDS})
COMPONENT_DEPENDS ${SUPPORTED_COMPONENTS})

if(UNIX AND TESSERACT_PACKAGE_SOURCE)
cpack_debian_source_package(
CHANGLELOG ${CMAKE_CURRENT_LIST_DIR}/CHANGELOG.rst
UPLOAD ${TESSERACT_PACKAGE_SOURCE_UPLOAD}
DPUT_HOST ${TESSERACT_PACKAGE_SOURCE_DPUT_HOST}
DEBIAN_INCREMENT ${TESSERACT_PACKAGE_SOURCE_DEBIAN_INCREMENT}
DISTRIBUTIONS ${TESSERACT_PACKAGE_SOURCE_DISTRIBUTIONS})
endif()
endif()
21 changes: 18 additions & 3 deletions tesseract_collision/bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if(${HACD_LIBRARY})
target_include_directories(
${PROJECT_NAME}_hacd_convex_decomposition PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
install_targets(TARGETS ${PROJECT_NAME}_hacd_convex_decomposition)
install_targets(TARGETS ${PROJECT_NAME}_hacd_convex_decomposition COMPONENT bullet)
endif()

if(NOT MSVC)
Expand Down Expand Up @@ -108,7 +108,7 @@ if(NOT MSVC)

list(APPEND PACKAGE_LIBRARIES create_convex_hull)

install_targets(TARGETS create_convex_hull)
install_targets(TARGETS create_convex_hull COMPONENT bullet)
endif()

# Add factory library so contact_managers_factory can find these factories by defauult
Expand All @@ -124,4 +124,19 @@ install(
PATTERN "*.inl"
PATTERN ".svn" EXCLUDE)

install_targets(TARGETS ${PROJECT_NAME}_bullet ${PROJECT_NAME}_bullet_factories)
configure_component(
COMPONENT bullet
NAMESPACE tesseract
TARGETS ${PROJECT_NAME}_bullet ${PROJECT_NAME}_bullet_factories
DEPENDENCIES "tesseract_collision COMPONENTS core"
CFG_EXTRAS cmake/bullet-extras.cmake)

if(TESSERACT_PACKAGE)
cpack_component(
COMPONENT bullet
VERSION ${pkg_extracted_version}
DESCRIPTION "Tesseract Collision bullet components"
COMPONENT_DEPENDS core
LINUX_DEPENDS "libbullet-dev" "libbullet-extras-dev"
WINDOWS_DEPENDS "libbullet-dev" "libbullet-extras-dev")
endif()
1 change: 1 addition & 0 deletions tesseract_collision/bullet/cmake/bullet-extras.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find_bullet()
62 changes: 0 additions & 62 deletions tesseract_collision/cmake/tesseract_collision-config.cmake.in

This file was deleted.

Loading

0 comments on commit 787c320

Please sign in to comment.