diff --git a/modules/GenPkgConfig.cmake b/modules/GenPkgConfig.cmake
index ef8fe04ab709e1df5fdecd86a690ee5096fda6e5..ddab5b53238718606d3b95b7f15cc07e0d3814ac 100644
--- a/modules/GenPkgConfig.cmake
+++ b/modules/GenPkgConfig.cmake
@@ -108,8 +108,8 @@ macro(gpc_convert_libstyle_to_pkgconfig _liblist)
       endforeach()
       string(REGEX REPLACE "^lib" "" dep_libname "${dep_libname}")
       list(APPEND ${_liblist} -L${dep_libdir} -l${dep_libname})
-    elseif(${_dep} MATCHES "^-l")
-      # case library given with -l (e.g. -lfoo)
+    elseif(${_dep} MATCHES "^-l|^-L")
+      # case library given with -l (e.g. -lfoo) or -L (e.g. -L/opt/foo/lib -lfoo)
       list(APPEND ${_liblist} ${_dep})
     else()
       # case library given by name (e.g. foo)