Ask Your Question
4

generate_messages fails with ros_comm

asked 2013-07-01 03:05:11 -0600

130s gravatar image

updated 2013-08-20 23:44:11 -0600

While installing with source, I've started seeing this error after synching ros_comm src to the latest commit (not sure if the error starts happening since this particular commit or earlier).

So far I only see this error while building either/both rqt_common_plugins or/and rqt_robot_plugins metapkgs, particularly with the packages rqt_image_view, raqt_rviz where neither of them use the target mentioned in the error message.

The error doesn't happen when I switch ros_comm to binary (1.9.46-0quantal-20130625-1625-+0000).

catkin 0.5.67, Ubuntu 12.10

$ catkin_make
:
-- +++ processing catkin package: 'roscpp'
-- ==> add_subdirectory(ros_comm/clients/roscpp)
-- Boost version: 1.49.0
-- Found the following Boost libraries:
--   signals
--   filesystem
--   system
-- roscpp: 1 messages, 3 services
CMake Error at /home/rosuser/catkin_ws/build/ros_comm/clients/roscpp/cmake/roscpp-genmsg.cmake:53 (add_custom_target):
  add_custom_target cannot create target "roscpp_generate_messages_cpp"
  because another target with the same name already exists.  The existing
  target is a custom target created in source directory
  "/home/rosuser/catkin_ws/src/rqt_common_plugins/rqt_image_view".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  /opt/ros/groovy/share/genmsg/cmake/genmsg-extras.cmake:280 (include)
  ros_comm/clients/roscpp/CMakeLists.txt:35 (generate_messages)


CMake Error at /home/rosuser/catkin_ws/build/ros_comm/clients/roscpp/cmake/roscpp-genmsg.cmake:100 (add_custom_target):
  add_custom_target cannot create target "roscpp_generate_messages_lisp"
  because another target with the same name already exists.  The existing
  target is a custom target created in source directory
  "/home/rosuser/catkin_ws/src/rqt_common_plugins/rqt_image_view".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  /opt/ros/groovy/share/genmsg/cmake/genmsg-extras.cmake:280 (include)
  ros_comm/clients/roscpp/CMakeLists.txt:35 (generate_messages)


CMake Error at /home/rosuser/catkin_ws/build/ros_comm/clients/roscpp/cmake/roscpp-genmsg.cmake:147 (add_custom_target):
  add_custom_target cannot create target "roscpp_generate_messages_py"
  because another target with the same name already exists.  The existing
  target is a custom target created in source directory
  "/home/rosuser/catkin_ws/src/rqt_common_plugins/rqt_image_view".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  /opt/ros/groovy/share/genmsg/cmake/genmsg-extras.cmake:280 (include)
  ros_comm/clients/roscpp/CMakeLists.txt:35 (generate_messages)
```

What can be wrong? Thank you!


Update-1) I see a similar error with different combination, which I've found a workaround for but don't understand yet.

-- +++ processing catkin package: 'tf'
-- ==> add_subdirectory(geometry/tf)
-- Boost version: 1.46.1
-- Found the following Boost libraries:
--   thread
--   signals
-- tf: 1 messages, 1 services
CMake Error at /home/noodlelover/catkinws/build/geometry/tf/cmake/tf-genmsg.cmake:41 (add_custom_target):
  add_custom_target cannot create target "tf_generate_messages_cpp" because
  another target with the same name already exists.  The existing target is a
  custom target created in source directory
  "/home/noodlelover/catkinws/src/rqt_robot_plugins/rqt_rviz".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  /opt/ros/hydro/share/genmsg/cmake/genmsg-extras.cmake:280 (include)
  geometry/tf/CMakeLists.txt:20 (generate_messages)
:  
-- Found PythonLibs: /usr/lib/libpython2.7.so 
-- +++ processing catkin package: 'tf_conversions'
-- ==> add_subdirectory(geometry/tf_conversions)
-- Eigen found (include: /usr/include/eigen3)
-- Configuring incomplete, errors occurred!
Invoking "cmake" failed

Workaround for ... (more)

edit retag flag offensive close merge delete

Comments

Your examples and descriptions of what you have in your workspace are incomplete and do not contain enough information to reproduce the issue. Please state which repos you have in your workspace, which versions and the executed commands including their full output.

Dirk Thomas gravatar image Dirk Thomas  ( 2013-08-20 23:57:25 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2014-01-16 08:03:37 -0600

scpeters gravatar image

I just had this issue, and I'm not exactly sure what caused it, but I noticed that some of my workspace source folders were on the hydro-devel branch and some on groovy-devel. Make sure you have the correct branches.

edit flag offensive delete link more
8

answered 2013-08-05 08:56:03 -0600

danep gravatar image

updated 2013-08-05 08:57:15 -0600

I don't know if this will be helpful to you or not, but I was getting a very similar error (add_custom_target cannot create target...) with another package, and it turned out that the CMakeLists and package.xml dependencies were specified incorrectly (in this case, you'd want to check the dependencies of rqt_commmon_plugins).

It was really confusing because the error message implied that the package (i.e. rqt_common_plugins) was trying to explicitly build the same target (roscpp_generate_messages_cpp), but in fact it was just an artifact from poorly-defined dependencies. Go figure.

EDIT: Here's the commit that fixed the problem in my package: https://github.com/danepowell/omni_description/commit/b3a738afd01cb58c6d4ab33c1ff7dd5f3aa3c9b0

edit flag offensive delete link more

Comments

@danep I'm still struggling with this. Can you post what error message you saw in your case if it's available?

130s gravatar image 130s  ( 2013-08-20 20:53:39 -0600 )edit
1

Sorry, I don't have the text of the error message. But omni_description has very few dependencies so you could easily download it and build the pre- and post-commit versions to see the error message and resolution for yourself.

danep gravatar image danep  ( 2013-08-21 13:42:09 -0600 )edit
1

answered 2013-07-01 07:14:05 -0600

William gravatar image

You have two packages in the same workspace which define the target roscpp_generate_messages_cpp. You probably have a copy of roscpp with a different name in the same workspace.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2013-07-01 03:05:11 -0600

Seen: 6,564 times

Last updated: Jan 16 '14