summaryrefslogtreecommitdiffstats
path: root/Modules/FindGnuTLS.cmake
diff options
context:
space:
mode:
authorPhilip Lowman <philip@yhbt.com>2009-10-09 02:50:13 (GMT)
committerPhilip Lowman <philip@yhbt.com>2009-10-09 02:50:13 (GMT)
commitd5dd8f126df3cfc3fae76ed9be75be9679ece32c (patch)
tree2db8194a4cad8039e7317ae8f34fadbf2a177d31 /Modules/FindGnuTLS.cmake
parent9a77f65da7d3275760a60d0a6180a9c240ba30e5 (diff)
downloadCMake-d5dd8f126df3cfc3fae76ed9be75be9679ece32c.zip
CMake-d5dd8f126df3cfc3fae76ed9be75be9679ece32c.tar.gz
CMake-d5dd8f126df3cfc3fae76ed9be75be9679ece32c.tar.bz2
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).
Diffstat (limited to 'Modules/FindGnuTLS.cmake')
-rw-r--r--Modules/FindGnuTLS.cmake13
1 files changed, 7 insertions, 6 deletions
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index a70823f..72ab511 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -40,11 +40,10 @@ IF (NOT WIN32)
SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
ENDIF (NOT WIN32)
-FIND_PATH(GNUTLS_INCLUDE_DIR gnutls.h
+FIND_PATH(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
HINTS
${PC_GNUTLS_INCLUDEDIR}
${PC_GNUTLS_INCLUDE_DIRS}
- PATH_SUFFIXES gnutls
)
FIND_LIBRARY(GNUTLS_LIBRARY NAMES gnutls libgnutls
@@ -53,13 +52,15 @@ FIND_LIBRARY(GNUTLS_LIBRARY NAMES gnutls libgnutls
${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
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
-MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
-
-SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY})
-SET(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
+IF(GNUTLS_FOUND)
+ SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY})
+ SET(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
+ENDIF()