changeset 801:728cc60a7be5

Test version only on found library
author Sebastien Decugis <sdecugis@nict.go.jp>
date Tue, 21 Aug 2012 22:24:14 +0200
parents 35f3fe884dc9
children 6dde862ba119
files cmake/Modules/FindGnuTLS.cmake
diffstat 1 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/cmake/Modules/FindGnuTLS.cmake	Tue Aug 21 13:34:20 2012 +0200
+++ b/cmake/Modules/FindGnuTLS.cmake	Tue Aug 21 22:24:14 2012 +0200
@@ -40,15 +40,17 @@
 
 # Now check if the library is recent. gnutls_hash was added in 2.10.0.
 # Also test library is even more recent. gnutls_x509_trust_list_verify_crt was added in 3.00.0.
-IF( NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
-  INCLUDE (CheckLibraryExists) 
-  MESSAGE(STATUS "Rechecking GNUTLS_VERSION_210 and GNUTLS_VERSION_300")
-  UNSET(GNUTLS_VERSION_210)
-  UNSET(GNUTLS_VERSION_210 CACHE)
-  UNSET(GNUTLS_VERSION_300)
-  UNSET(GNUTLS_VERSION_300 CACHE)
-  GET_FILENAME_COMPONENT(GNUTLS_PATH ${GNUTLS_LIBRARY} PATH)
-  CHECK_LIBRARY_EXISTS(gnutls gnutls_hash ${GNUTLS_PATH} GNUTLS_VERSION_210) 
-  CHECK_LIBRARY_EXISTS(gnutls gnutls_x509_trust_list_verify_crt ${GNUTLS_PATH} GNUTLS_VERSION_300) 
-  SET( GNUTLS_VERSION_TEST_FOR ${GNUTLS_LIBRARY} CACHE INTERNAL "Version the test was made against" )
-ENDIF (NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
+IF(GNUTLS_FOUND)
+  IF( NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
+    INCLUDE (CheckLibraryExists) 
+    MESSAGE(STATUS "Rechecking GNUTLS_VERSION_210 and GNUTLS_VERSION_300")
+    UNSET(GNUTLS_VERSION_210)
+    UNSET(GNUTLS_VERSION_210 CACHE)
+    UNSET(GNUTLS_VERSION_300)
+    UNSET(GNUTLS_VERSION_300 CACHE)
+    GET_FILENAME_COMPONENT(GNUTLS_PATH ${GNUTLS_LIBRARY} PATH)
+    CHECK_LIBRARY_EXISTS(gnutls gnutls_hash ${GNUTLS_PATH} GNUTLS_VERSION_210) 
+    CHECK_LIBRARY_EXISTS(gnutls gnutls_x509_trust_list_verify_crt ${GNUTLS_PATH} GNUTLS_VERSION_300) 
+    SET( GNUTLS_VERSION_TEST_FOR ${GNUTLS_LIBRARY} CACHE INTERNAL "Version the test was made against" )
+  ENDIF (NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
+ENDIF(GNUTLS_FOUND)
"Welcome to our mercurial repository"