Skip to content

Commit

Permalink
Provide catkin package.xml per ROS REP 136
Browse files Browse the repository at this point in the history
This provides the least intrusive, but most automated and correct
method for releasing non-catkin packages through the ROS
infrastructure.

Instead of specifying the FCL version in CMakeModules/FCLVersion.cmake,
that module reads the version from package.xml. This provides a single
point of maintenance for the version number.
  • Loading branch information
C. Andy Martin committed Jul 15, 2019
1 parent 2af546b commit 8b08339
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}

install(FILES "${pkg_conf_file_out}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/ COMPONENT pkgconfig)

# Install catkin package.xml
install(FILES package.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME})

# Add uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
Expand Down
10 changes: 7 additions & 3 deletions CMakeModules/FCLVersion.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# set the version in a way CMake can use
set(FCL_MAJOR_VERSION 0)
set(FCL_MINOR_VERSION 6)
set(FCL_PATCH_VERSION 0)
file(READ package.xml PACKAGE_XML)
string(REGEX MATCH "<version>[0-9]+\\.[0-9]+\\.[0-9]+</version>" DIRTY_VERSION_STRING ${PACKAGE_XML})

string(REGEX REPLACE "^<version>([0-9]+)\\.[0-9]+\\.[0-9]+</version>" "\\1" FCL_MAJOR_VERSION "${DIRTY_VERSION_STRING}")
string(REGEX REPLACE "^<version>[0-9]+\\.([0-9])+\\.[0-9]+</version>" "\\1" FCL_MINOR_VERSION "${DIRTY_VERSION_STRING}")
string(REGEX REPLACE "^<version>[0-9]+\\.[0-9]+\\.([0-9]+)</version>" "\\1" FCL_PATCH_VERSION "${DIRTY_VERSION_STRING}")

set(FCL_VERSION "${FCL_MAJOR_VERSION}.${FCL_MINOR_VERSION}.${FCL_PATCH_VERSION}")

# increment this when we have ABI changes
Expand Down
16 changes: 16 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<package format="2">
<name>fcl</name>
<version>0.6.0</version>
<description>FCL: the Flexible Collision Library</description>
<maintainer email="[email protected]">TRI Geometry Team</maintainer>
<license>BSD</license>
<buildtool_depend>cmake</buildtool_depend>
<depend>libccd-dev</depend>
<depend>eigen</depend>
<depend>octomap</depend>
<!-- Following recommendations of REP 136 -->
<exec_depend>catkin</exec_depend>
<export>
<build_type>cmake</build_type>
</export>
</package>

0 comments on commit 8b08339

Please sign in to comment.