From 5bd59936635516eec05ec2ba8caa479cc7dbcf0f Mon Sep 17 00:00:00 2001 From: Greg Hale Date: Thu, 17 Oct 2013 14:05:06 -0400 Subject: [PATCH] Only append -l to lib entries with no path and no -l or -L of their own --- cmake/OpenCVGenPkgconfig.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake index ecd7c68f14..6f9333952e 100644 --- a/cmake/OpenCVGenPkgconfig.cmake +++ b/cmake/OpenCVGenPkgconfig.cmake @@ -58,7 +58,13 @@ endforeach() set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_}) if(OpenCV_EXTRA_COMPONENTS) foreach(extra_component ${OpenCV_EXTRA_COMPONENTS}) - set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} -l${extra_component}") + if(extra_component MATCHES "-[lL](.*)" ) + set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${extra_component}") + elseif(extra_component MATCHES "/") + set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${extra_component}") + else() + set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} -l${extra_component}") + endif() endforeach() endif()