这是一份示例的cmake代码,它满足您提到的要求:
#Load the ROS package XML file
find_package(catkin REQUIRED)
catkin_package(
CATKIN_DEPENDS
)
# Define the update_version function
function(update_version)
# Get the current version from the package.xml file
execute_process(COMMAND catkin_package_xml version