How to have 2 almost same packages together in workspace?
I'm taking over my predecessor's job of ROS. My predecessor gave me ROS codes as a ROS package.
I want to have in my workspace both of his original package and another package which I add changes to, so that I can always execute them and compare their behavior difference.
I tried the following procedure but got errors.
Let his original package be "original_package" and my working package be "my_package".
- In ~/catkin_ws/src/, execute 'cp -r original_package my_package'
- In ~/catkin_ws/src/my_package/CMakeList.txt and package.xml, replaced "original_package" with "my_package"
- In ~/cakin_ws/, execute 'catkin_make -B' (-B is just a option to build all things forcely)
But cakin said errors like below. Obviously this is due to both 2 packages have the same-name modules.
CMake Error at my_package/CMakeLists.txt:134 (add_executable): add_executable cannot create target "module-name" because another target with the same name already exists. The existing target is an executable created in source directory "~/cakin_ws/src/original_package". See documentation for policy CMP0002 for more details.
CMake Error at my_package/CMakeLists.txt:141 (target_link_libraries): Attempt to add link library "/opt/ros/indigo/lib/libroscpp.so" to target "module-name" which is not built in this directory.
I really appreciate if you give me a solution !
Versions Info: Ros Indigo & Ubuntu 14.04
Thank you in advance.
Wasn't this question already answered?
Yes, Lucas's answer already solved my problem. I just forgot to close the question, it's my shame. Sorry, and thank you.
No problem :) I thought I'd already seen this question answered some time ago (sort of like a deja-vu). I didn't mean to imply that you hadn't properly accepted the answer.