From ae490c540d83499f4a12dfa0d5b504e1490d8ab9 Mon Sep 17 00:00:00 2001 From: Wolfgang Hess Date: Tue, 13 Dec 2016 13:57:05 +0100 Subject: [PATCH] Revert to workaround #158. (#160) Currently, on xenial/kinetic the transitive dependencies on libcartographer and its dependencies are not duplicated after each library that depends on it in the linker command. --- cmake/functions.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/functions.cmake b/cmake/functions.cmake index 690b9fe..7c73b79 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -41,6 +41,10 @@ endmacro(_parse_arguments) macro(_common_compile_stuff VISIBILITY) set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") + foreach(DEPENDENCY ${ARG_DEPENDS}) + target_link_libraries("${NAME}" PUBLIC ${DEPENDENCY}) + endforeach() + if(catkin_INCLUDE_DIRS) target_include_directories("${NAME}" SYSTEM ${VISIBILITY} "${catkin_INCLUDE_DIRS}") @@ -121,10 +125,6 @@ macro(_common_compile_stuff VISIBILITY) target_include_directories("${NAME}" ${VISIBILITY} "${CMAKE_BINARY_DIR}") target_include_directories("${NAME}" ${VISIBILITY} "${CMAKE_SOURCE_DIR}") - foreach(DEPENDENCY ${ARG_DEPENDS}) - target_link_libraries("${NAME}" PUBLIC ${DEPENDENCY}) - endforeach() - # Figure out where to install the header. The logic goes like this: either # the header is in the current binary directory (i.e. generated, like port.h) # or in the current source directory - a regular header. It could also