Cmake error add_executable [closed]

asked 2015-06-30 04:19:48 -0500

psprox96 gravatar image

Hi guys. I did catkin_make again and I got 3 of the same error. That is:

CMake Error at /opt/ros/groovy/share/dynamic_reconfigure/cmake/extras.cmake:58 (add_custom_target):
  add_custom_target cannot create target "pcl_ros_gencfg" because another
  target with the same name already exists.  The existing target is a custom
  target created in source directory "/home/gordon/catkin_ws/src/flight".
  See documentation for policy CMP0002 for more details.

CMake Error at navigation/voxel_grid/CMakeLists.txt:28 (add_executable):
  add_executable cannot create target "voxel_grid" because another target
  with the same name already exists.  The existing target is a shared library
  created in source directory
  "/home/gordon/catkin_ws/src/navigation/voxel_grid".  See documentation for
  policy CMP0002 for more details.

CMake Error at hector_slam/hector_geotiff_plugins/CMakeLists.txt:75 (add_executable):
  add_executable cannot create target "hector_geotiff_plugins" because
  another target with the same name already exists.  The existing target is a
  shared library created in source directory
  "/home/gordon/catkin_ws/src/hector_slam/hector_geotiff_plugins".  See
  documentation for policy CMP0002 for more details.

I know of one solution that is to use catkin_make_isolated to prevent these from happening but I was told that it will make the whole thing work slower.

Anybody solved this before?

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by psprox96
close date 2015-07-01 21:59:31.291860

Comments

Again? Same error? If this is a continuation of a previous post, this should be in that post, or at least link it.

Javier V. Gómez gravatar image Javier V. Gómez  ( 2015-07-01 01:52:37 -0500 )edit

Hi there! I tried to catkin_make after putting a new package and got these errors. Just a moment ago, I compared their respective CMakeLists.txt with the original ones and found out that there are changes made to the add_executable line. Replacing them with the default ones corrected the problems.

psprox96 gravatar image psprox96  ( 2015-07-01 04:46:50 -0500 )edit

I'm happy you made it work. So you can close the question, write your own answer and accept it or remove it.

Javier V. Gómez gravatar image Javier V. Gómez  ( 2015-07-01 05:04:09 -0500 )edit