Resolve #9685: Fix include dir to be correct path

Also refrain from setting _LIBRARIES & _INCLUDE_DIRS if lib not found (seems to be mostly standard practice).
This commit is contained in:
Philip Lowman 2009-10-08 22:50:13 -04:00
parent 9a77f65da7
commit d5dd8f126d
1 changed files with 7 additions and 6 deletions

View File

@ -40,11 +40,10 @@ IF (NOT WIN32)
SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER}) SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
ENDIF (NOT WIN32) ENDIF (NOT WIN32)
FIND_PATH(GNUTLS_INCLUDE_DIR gnutls.h FIND_PATH(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
HINTS HINTS
${PC_GNUTLS_INCLUDEDIR} ${PC_GNUTLS_INCLUDEDIR}
${PC_GNUTLS_INCLUDE_DIRS} ${PC_GNUTLS_INCLUDE_DIRS}
PATH_SUFFIXES gnutls
) )
FIND_LIBRARY(GNUTLS_LIBRARY NAMES gnutls libgnutls FIND_LIBRARY(GNUTLS_LIBRARY NAMES gnutls libgnutls
@ -53,13 +52,15 @@ FIND_LIBRARY(GNUTLS_LIBRARY NAMES gnutls libgnutls
${PC_GNUTLS_LIBRARY_DIRS} ${PC_GNUTLS_LIBRARY_DIRS}
) )
MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY) IF(GNUTLS_FOUND)
SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY})
SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY}) SET(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
SET(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR}) ENDIF()