From 4bb88434764b4091e5c8212b157b1778854e62a4 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Sun, 15 Mar 2015 20:06:46 +0100 Subject: [PATCH] CMakeLists.txt: fix detection of nss Libnss needs also to check for libnspr and add the related -l targets to CRYPTO_LIBS, otherwise the build will fail. Make sure USE_NSS is set correctly to 0 if cryptopp found and in case nss was found set USE_CRYPTOPP also to 0. Signed-off-by: Danny Al-Gaaf --- CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f827fcf2a460e..b0779fcc59608 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,19 +182,19 @@ find_package(cryptopp) if(CRYPTOPP_FOUND) MESSAGE(STATUS "${CRYPTOPP_LIBRARIES}") set(CRYPTO_LIBS ${CRYPTOPP_LIBRARIES}) - set(USE_NSS 0) + set(USE_NSS 0) else() - MESSAGE(STATUS "Cryptopp not here using NSS instead") - set(USE_NSS 1) - MESSAGE(STATUS "${NSS_LIBRARIES}") + MESSAGE(STATUS "Cryptopp not found using NSS instead") find_package(NSS) if(NSS_FOUND) - MESSAGE(STATUS "${NSS_LIBRARIES}") - #It is known to be false why the test - if(NOT CRYPTOPP_FOUND) - set(CRYPTO_LIBS ${NSS_LIBRARIES}) - add_definitions(-DUSE_NSS) - endif(NOT CRYPTOPP_FOUND) + set(USE_NSS 1) + set(USE_CRYPTOPP 0) + find_package(NSPR) + if(NSPR_FOUND) + set(CRYPTO_LIBS ${NSS_LIBRARIES} ${NSPR_LIBRARIES}) + #MESSAGE(STATUS "${CRYPTO_LIBS}") + #MESSAGE(STATUS "${NSS_INCLUDE_DIR} ${NSPR_INCLUDE_DIR}") + endif(NSPR_FOUND) endif(NSS_FOUND) endif(CRYPTOPP_FOUND) -- 2.39.5