]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
CMakeLists.txt: fix detection of nss
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sun, 15 Mar 2015 19:06:46 +0000 (20:06 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 7 May 2015 11:26:18 +0000 (13:26 +0200)
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 <danny.al-gaaf@bisect.de>
CMakeLists.txt

index f827fcf2a460e66ad7f1657df022f7a2faa200f4..b0779fcc596081d643f0ffb5231b6453faadfe30 100644 (file)
@@ -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)