0
$\begingroup$

Rosanswers logo

Hello,

I am trying to build ros_comm from source, since I am on a platform which has boost 1.62 and the downloaded package for my arm64 architecture is seemingly stuck at 1.58.

My nodes compile beautifully if I ignore the warnings and use the repo packages (apt-get ros-kinetic-ros-comm), but fails when I try to fix the boost warnings by compiling by source.

The message I get is:

CMake Error at /ws/build/ros_comm/clients/roscpp/cmake/roscpp-genmsg.cmake:79 (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
  "/ws/src/my_node".  See documentation for policy
  CMP0002 for more details.
  
Call Stack (most recent call first):
  /opt/ros/kinetic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
  ros_comm/clients/roscpp/CMakeLists.txt:39 (generate_messages)

It feels like it's conflicting with the original installation somehow, but I've already tried apt-get removing the original.

What's the best way to fix this error?


Originally posted by xtracrispy on ROS Answers with karma: 16 on 2017-07-05

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Going to answer my question in case anybody else comes across this. The problem turned out to be that in my cmakefiles, I did not properly set up my node's dependency on roscpp. As a result, it wouldn't build roscpp first, and hence the conflict.

issue was resolved by:

  • adding roscpp, and some messages to find_package
  • adding roscpp as a CATKIN_DEPENDS to catkin_package()
  • adding roscpp_generate_messages_cpp as an add_dependency
  • adding msgs & roscpp as build_depends & run_depends in package.xml

Originally posted by xtracrispy with karma: 16 on 2017-07-05

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.