Commit 9dc1f58f authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Test version only on found library

parent e54dd47c
...@@ -40,15 +40,17 @@ MARK_AS_ADVANCED( GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR ) ...@@ -40,15 +40,17 @@ MARK_AS_ADVANCED( GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR )
# Now check if the library is recent. gnutls_hash was added in 2.10.0. # 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. # 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}" )) IF(GNUTLS_FOUND)
INCLUDE (CheckLibraryExists) IF( NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" ))
MESSAGE(STATUS "Rechecking GNUTLS_VERSION_210 and GNUTLS_VERSION_300") INCLUDE (CheckLibraryExists)
UNSET(GNUTLS_VERSION_210) MESSAGE(STATUS "Rechecking GNUTLS_VERSION_210 and GNUTLS_VERSION_300")
UNSET(GNUTLS_VERSION_210 CACHE) UNSET(GNUTLS_VERSION_210)
UNSET(GNUTLS_VERSION_300) UNSET(GNUTLS_VERSION_210 CACHE)
UNSET(GNUTLS_VERSION_300 CACHE) UNSET(GNUTLS_VERSION_300)
GET_FILENAME_COMPONENT(GNUTLS_PATH ${GNUTLS_LIBRARY} PATH) UNSET(GNUTLS_VERSION_300 CACHE)
CHECK_LIBRARY_EXISTS(gnutls gnutls_hash ${GNUTLS_PATH} GNUTLS_VERSION_210) GET_FILENAME_COMPONENT(GNUTLS_PATH ${GNUTLS_LIBRARY} PATH)
CHECK_LIBRARY_EXISTS(gnutls gnutls_x509_trust_list_verify_crt ${GNUTLS_PATH} GNUTLS_VERSION_300) CHECK_LIBRARY_EXISTS(gnutls gnutls_hash ${GNUTLS_PATH} GNUTLS_VERSION_210)
SET( GNUTLS_VERSION_TEST_FOR ${GNUTLS_LIBRARY} CACHE INTERNAL "Version the test was made against" ) CHECK_LIBRARY_EXISTS(gnutls gnutls_x509_trust_list_verify_crt ${GNUTLS_PATH} GNUTLS_VERSION_300)
ENDIF (NOT( "${GNUTLS_VERSION_TEST_FOR}" STREQUAL "${GNUTLS_LIBRARY}" )) 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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment