From a841835eaffdb1b2cc6c93979d7717c88a3468e3 Mon Sep 17 00:00:00 2001 From: Leopold Palomo-Avellaneda Date: Tue, 12 Mar 2019 19:24:44 +0100 Subject: [PATCH] Protection against double -l --- cmake/catkin_package.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/catkin_package.cmake b/cmake/catkin_package.cmake index c50ffd247..fb6b01a17 100644 --- a/cmake/catkin_package.cmake +++ b/cmake/catkin_package.cmake @@ -270,7 +270,9 @@ function(_catkin_package) catkin_filter_libraries_for_build_configuration(libraries ${PKG_CONFIG_LIBRARIES}) foreach(library ${libraries}) if(NOT IS_ABSOLUTE ${library}) - set(library "-l${library}") + if(NOT ${library} MATCHES "^-l") + set(library "-l${library}") + endif() endif() list_append_deduplicate(PKG_CONFIG_LIBRARIES_WITH_PREFIX ${library}) endforeach()