Skip to content

Commit

Permalink
Fix building of ros1_bridge against newer roscpp. (#98)
Browse files Browse the repository at this point in the history
The comment in the code mostly explains it, but because of changes
to upstream catkin/roscpp, we need to expand the types of things
we look at for linking.  With this patch, building against
roscpp kinetic 1.12.7 and 1.12.12 works.

Signed-off-by: Chris Lalancette <clalancette@osrfoundation.org>
  • Loading branch information
clalancette authored Nov 20, 2017
1 parent 8eba004 commit 951c7d4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/find_ros1_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ macro(find_ros1_package name)
pkg_check_modules(ros1_${name} ${_required} ${name})
if(ros1_${name}_FOUND)
set(_libraries "${ros1_${name}_LIBRARIES}")
# Prior to catkin 0.7.7, dependent libraries in the pkg-config file were always generated
# in the form "-l:/absolute/path/to/library". Because of the leading "-l", this made
# them show up in ${ros1_${name}_LIBRARIES}. catkin 0.7.7 and later has changed this to
# just be an absolute path (of the form "/absolute/path/to/library"), so we now have to
# look through the LDFLAGS_OTHER and add those to the libraries that we need to link with.
foreach(_flag ${ros1_${name}_LDFLAGS_OTHER})
if(IS_ABSOLUTE ${_flag})
list(APPEND _libraries "${_flag}")
endif()
endforeach()
set(_library_dirs "${ros1_${name}_LIBRARY_DIRS}")
set(ros1_${name}_LIBRARIES "")
set(ros1_${name}_LIBRARY_DIRS "")
Expand Down

0 comments on commit 951c7d4

Please sign in to comment.