From 052244ddc88a8f297fb08c66a6656dd74098b1fb Mon Sep 17 00:00:00 2001
From: Heiko Becker <heirecka@exherbo.org>
Date: Mon, 21 Mar 2016 22:10:40 +0100
Subject: [PATCH] FindNSS3.cmake: Use NSS3_LDFLAGS instead of NSS3_LIBRARIES

NSS3_LDFLAGS is populated with the output from pkg-config --libs,
whereas NSS3_LIBRARIES contains pkg-config --libs-only, which is not
sufficient if nss is installed in a subdirectory of ${LIBDIR}.
---
 CMakeLists.txt               | 2 +-
 cmake/modules/FindNSS3.cmake | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d385893..79a0a17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -453,7 +453,7 @@ if (ENABLE_NSS3)
   set(poppler_SRCS ${poppler_SRCS}
     poppler/SignatureHandler.cc
   )
-  set(poppler_LIBS ${poppler_LIBS} ${NSS3_LIBRARIES})
+  set(poppler_LIBS ${poppler_LIBS} ${NSS3_LDFLAGS})
 endif(ENABLE_NSS3)  
 if(LIBOPENJPEG_FOUND)
   set(poppler_SRCS ${poppler_SRCS}
diff --git a/cmake/modules/FindNSS3.cmake b/cmake/modules/FindNSS3.cmake
index 657cad8..4d26c02 100644
--- a/cmake/modules/FindNSS3.cmake
+++ b/cmake/modules/FindNSS3.cmake
@@ -3,7 +3,7 @@
 #
 #  NSS_FOUND - system has NSS3
 #  NSS3_CFLAGS - the NSS CFlags
-#  NSS3_LIBRARIES - Link these to use NSS
+#  NSS3_LDFLAGS - Linker flags to use NSS
 #
 # Copyright 2015 André Guerreiro, <aguerreiro1985@gmail.com>
 #
@@ -17,6 +17,6 @@ if (NOT WIN32)
 
   pkg_check_modules(NSS3 "nss>=3.19")
 
-  find_package_handle_standard_args(NSS3 DEFAULT_MSG NSS3_LIBRARIES NSS3_CFLAGS)
+  find_package_handle_standard_args(NSS3 DEFAULT_MSG NSS3_LDFLAGS NSS3_CFLAGS)
 
 endif(NOT WIN32)
-- 
2.7.4