diff --git a/core/rosbuild/private.cmake b/core/rosbuild/private.cmake index dc86c5f9..3e0385cb 100644 --- a/core/rosbuild/private.cmake +++ b/core/rosbuild/private.cmake @@ -353,7 +353,7 @@ macro(_rosbuild_add_library lib libname type) rosbuild_add_compile_flags(${lib} ${ROS_COMPILE_FLAGS}) rosbuild_add_link_flags(${lib} ${ROS_LINK_FLAGS}) - # Make sure to do any prebuild working (e.g., msg/srv generation) before + # Make sure to do any prebuild work (e.g., msg/srv generation) before # building this target. add_dependencies(${lib} rosbuild_precompile) endmacro(_rosbuild_add_library) diff --git a/core/rosbuild/public.cmake b/core/rosbuild/public.cmake index 2495e1ea..d67f38b9 100644 --- a/core/rosbuild/public.cmake +++ b/core/rosbuild/public.cmake @@ -326,6 +326,11 @@ macro(rosbuild_init) add_custom_target(rospack_genmsg) add_custom_target(rospack_gensrv) + # Add a target that will fire before doing message or service generation. + # This is used by packages that do automatic generation of message and + # service files. + add_custom_target(rosbuild_premsgsrvgen) + # Add a target that will fire before compiling anything. This is used by # message and service generation, as well as things outside of ros, like # dynamic_reconfigure. @@ -466,7 +471,7 @@ macro(rosbuild_add_executable exe) rosbuild_add_compile_flags(${exe} ${ROS_COMPILE_FLAGS}) rosbuild_add_link_flags(${exe} ${ROS_LINK_FLAGS}) - # Make sure to do any prebuild working (e.g., msg/srv generation) before + # Make sure to do any prebuild work (e.g., msg/srv generation) before # building this target. add_dependencies(${exe} rosbuild_precompile) diff --git a/core/roscpp/cmake/roscpp.cmake b/core/roscpp/cmake/roscpp.cmake index d99e496e..08edc9a5 100644 --- a/core/roscpp/cmake/roscpp.cmake +++ b/core/roscpp/cmake/roscpp.cmake @@ -25,8 +25,11 @@ macro(genmsg_cpp) # Create a target that depends on the union of all the autogenerated # files add_custom_target(ROSBUILD_genmsg_cpp DEPENDS ${_autogen}) - # Add our target to the top-level genmsg target, which will be fired if - # the user calls genmsg() + # Make our target depend on rosbuild_premsgsrvgen, to allow any + # pre-msg/srv generation steps to be done first. + add_dependencies(ROSBUILD_genmsg_cpp rosbuild_premsgsrvgen) + # Add our target to the top-level rospack_genmsg target, which will be + # fired if the user calls genmsg() add_dependencies(rospack_genmsg ROSBUILD_genmsg_cpp) endmacro(genmsg_cpp) @@ -58,6 +61,9 @@ macro(gensrv_cpp) # Create a target that depends on the union of all the autogenerated # files add_custom_target(ROSBUILD_gensrv_cpp DEPENDS ${_autogen}) + # Make our target depend on rosbuild_premsgsrvgen, to allow any + # pre-msg/srv generation steps to be done first. + add_dependencies(ROSBUILD_gensrv_cpp rosbuild_premsgsrvgen) # Add our target to the top-level gensrv target, which will be fired if # the user calls gensrv() add_dependencies(rospack_gensrv ROSBUILD_gensrv_cpp) diff --git a/core/roslisp/cmake/roslisp.cmake b/core/roslisp/cmake/roslisp.cmake index 2542b534..cbb013e2 100644 --- a/core/roslisp/cmake/roslisp.cmake +++ b/core/roslisp/cmake/roslisp.cmake @@ -27,6 +27,9 @@ macro(genmsg_lisp) # Create a target that depends on the union of all the autogenerated # files add_custom_target(ROSBUILD_genmsg_lisp DEPENDS ${_autogen}) + # Make our target depend on rosbuild_premsgsrvgen, to allow any + # pre-msg/srv generation steps to be done first. + add_dependencies(ROSBUILD_genmsg_lisp rosbuild_premsgsrvgen) # Add our target to the top-level genmsg target, which will be fired if # the user calls genmsg() add_dependencies(rospack_genmsg ROSBUILD_genmsg_lisp) @@ -63,6 +66,9 @@ macro(gensrv_lisp) # Create a target that depends on the union of all the autogenerated # files add_custom_target(ROSBUILD_gensrv_lisp DEPENDS ${_autogen}) + # Make our target depend on rosbuild_premsgsrvgen, to allow any + # pre-msg/srv generation steps to be done first. + add_dependencies(ROSBUILD_gensrv_lisp rosbuild_premsgsrvgen) # Add our target to the top-level gensrv target, which will be fired if # the user calls gensrv() add_dependencies(rospack_gensrv ROSBUILD_gensrv_lisp) diff --git a/core/rospy/cmake/rospy.cmake b/core/rospy/cmake/rospy.cmake index ca61e07a..8ccb472c 100644 --- a/core/rospy/cmake/rospy.cmake +++ b/core/rospy/cmake/rospy.cmake @@ -37,6 +37,9 @@ macro(genmsg_py) # A target that depends on generation of the __init__.py add_custom_target(ROSBUILD_genmsg_py DEPENDS ${_output_py}) + # Make our target depend on rosbuild_premsgsrvgen, to allow any + # pre-msg/srv generation steps to be done first. + add_dependencies(ROSBUILD_genmsg_py rosbuild_premsgsrvgen) # Add our target to the top-level genmsg target, which will be fired if # the user calls genmsg() add_dependencies(rospack_genmsg ROSBUILD_genmsg_py) @@ -83,6 +86,9 @@ macro(gensrv_py) # A target that depends on generation of the __init__.py add_custom_target(ROSBUILD_gensrv_py DEPENDS ${_output_py}) + # Make our target depend on rosbuild_premsgsrvgen, to allow any + # pre-msg/srv generation steps to be done first. + add_dependencies(ROSBUILD_gensrv_py rosbuild_premsgsrvgen) # Add our target to the top-level gensrv target, which will be fired if # the user calls gensrv() add_dependencies(rospack_gensrv ROSBUILD_gensrv_py)