From 8b083393b2bdd2a7537fed69a40fd25aa9fc17e5 Mon Sep 17 00:00:00 2001 From: "C. Andy Martin" Date: Thu, 27 Jun 2019 13:51:37 -0400 Subject: [PATCH] Provide catkin package.xml per ROS REP 136 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. --- CMakeLists.txt | 3 +++ CMakeModules/FCLVersion.cmake | 10 +++++++--- package.xml | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 package.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index d99646e4a..7b9179dc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" diff --git a/CMakeModules/FCLVersion.cmake b/CMakeModules/FCLVersion.cmake index 46a3a91c1..5a6694e0a 100644 --- a/CMakeModules/FCLVersion.cmake +++ b/CMakeModules/FCLVersion.cmake @@ -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 "[0-9]+\\.[0-9]+\\.[0-9]+" DIRTY_VERSION_STRING ${PACKAGE_XML}) + +string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" FCL_MAJOR_VERSION "${DIRTY_VERSION_STRING}") +string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" FCL_MINOR_VERSION "${DIRTY_VERSION_STRING}") +string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\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 diff --git a/package.xml b/package.xml new file mode 100644 index 000000000..9605ebac2 --- /dev/null +++ b/package.xml @@ -0,0 +1,16 @@ + + fcl + 0.6.0 + FCL: the Flexible Collision Library + TRI Geometry Team + BSD + cmake + libccd-dev + eigen + octomap + + catkin + + cmake + +