From 4022a36701686cfb02c3227ee7c0d3bfd826126a Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Thu, 6 Dec 2012 08:55:43 +0000 Subject: [PATCH] deduplicate list while guaranteed keeping stable order --- core/rosbuild/public.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/rosbuild/public.cmake b/core/rosbuild/public.cmake index 0892dd13..caaee28e 100644 --- a/core/rosbuild/public.cmake +++ b/core/rosbuild/public.cmake @@ -245,9 +245,14 @@ macro(rosbuild_init) # The following code removes duplicate libraries from the link line, # saving only the last one. # - list(REVERSE ${_prefix}_LIBRARIES) - list(REMOVE_DUPLICATES ${_prefix}_LIBRARIES) - list(REVERSE ${_prefix}_LIBRARIES) + if(${_prefix}_LIBRARIES) + find_package(catkin REQUIRED) + set(_${_prefix}_LIBRARIES ${${_prefix}_LIBRARIES}) + set(${_prefix}_LIBRARIES "") + list(REVERSE _${_prefix}_LIBRARIES) + list_append_unique(${_prefix}_LIBRARIES ${_${_prefix}_LIBRARIES}) + list(REVERSE ${_prefix}_LIBRARIES) + endif() # Also throw in the libs that we want to link everything against (only # use case for this so far is -lgcov when building with code coverage