locusrobotics / robot_navigation

Spiritual successor to ros-planning/navigation.
450 stars 148 forks source link

Fix build with catkin_make #29

Closed mintar closed 5 years ago

mintar commented 5 years ago

Building with catkin_make fails without this PR because the targets "utest" and "planner_node" are multiply defined. Building with catkin-tools or catkin_make_isolated doesn't trigger this bug, because these build tools build each CMake project separately (unlike catkin_make, which includes all CMakeLists as subprojects, so all targets need to be unique).

The following errors were thrown by catkin_make:

CMake Error at /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:169 (add_executable):
  add_executable cannot create target "utest" because another target with the
  same name already exists.  The existing target is an executable created in
  source directory
  "/home/martin/ros/kinetic/robot_navigation/src/robot_navigation/nav_grid".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:79 (_catkin_add_executable_with_google_test)
  /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:28 (_catkin_add_google_test)
  robot_navigation/costmap_queue/CMakeLists.txt:31 (catkin_add_gtest)

CMake Error at robot_navigation/costmap_queue/CMakeLists.txt:32 (target_link_libraries):
  Attempt to add link library "costmap_queue" to target "utest" which is not
  built in this directory.
mintar commented 5 years ago

@ros-pull-request-builder retest this please

mintar commented 5 years ago

Tests should work now that #30 is merged.