Do not look for gnutls if libjwt is not found

This commit is contained in:
hax0kartik 2020-04-14 00:40:47 +05:30
parent 143ad394a9
commit 1c4e4abbab
1 changed files with 17 additions and 15 deletions

View File

@ -361,8 +361,9 @@ else(LIBJWT_FOUND)
endif(LIBJWT_FOUND) endif(LIBJWT_FOUND)
# gnutls (using find_library and find_path) # gnutls (using find_library and find_path)
find_library(GNUTLS_LIBRARIES gnutls) if(HAVE_LIBJWT)
if(GNUTLS_LIBRARIES) find_library(GNUTLS_LIBRARIES gnutls)
if(GNUTLS_LIBRARIES)
set(HAVE_LIBGNUTLS 1) set(HAVE_LIBGNUTLS 1)
list(APPEND ZM_BIN_LIBS "${GNUTLS_LIBRARIES}") list(APPEND ZM_BIN_LIBS "${GNUTLS_LIBRARIES}")
find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h) find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h)
@ -373,9 +374,10 @@ if(GNUTLS_LIBRARIES)
mark_as_advanced(FORCE GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR) mark_as_advanced(FORCE GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR)
check_include_file("gnutls/gnutls.h" HAVE_GNUTLS_GNUTLS_H) check_include_file("gnutls/gnutls.h" HAVE_GNUTLS_GNUTLS_H)
set(optlibsfound "${optlibsfound} GnuTLS") set(optlibsfound "${optlibsfound} GnuTLS")
else(GNUTLS_LIBRARIES) else(GNUTLS_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} GnuTLS") set(optlibsnotfound "${optlibsnotfound} GnuTLS")
endif(GNUTLS_LIBRARIES) endif(GNUTLS_LIBRARIES)
endif(HAVE_LIBJWT)
# OpenSSL # OpenSSL
if(NOT HAVE_LIBGNUTLS OR NOT HAVE_LIBJWT) if(NOT HAVE_LIBGNUTLS OR NOT HAVE_LIBJWT)