summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorEmmanuel Bouthenot <kolter@openics.org>2009-06-07 16:46:53 +0200
committerEmmanuel Bouthenot <kolter@openics.org>2009-06-07 16:46:53 +0200
commit452a1d6b9ea39d362fa7c44456ac2b659159ea9e (patch)
tree233e2401e5ac59c4d0782b8471b39aa74a2da571 /cmake
parent1bbafc3d4e4834fac58af0e149eb9a9acff26d4e (diff)
downloadweechat-452a1d6b9ea39d362fa7c44456ac2b659159ea9e.zip
Change the way to detect gnutls (using pkg-config instead of libgnutls-config)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindGnuTLS.cmake10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/FindGnuTLS.cmake b/cmake/FindGnuTLS.cmake
index ef5e900e1..807abb301 100644
--- a/cmake/FindGnuTLS.cmake
+++ b/cmake/FindGnuTLS.cmake
@@ -30,19 +30,21 @@ IF(GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY)
set(GNUTLS_FIND_QUIETLY TRUE)
ENDIF(GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY)
-FIND_PROGRAM(GNUTLS_CONFIG_EXECUTABLE NAMES libgnutls-config)
+FIND_PROGRAM(PKG_CONFIG_EXECUTABLE NAMES pkg-config)
-EXECUTE_PROCESS(COMMAND ${GNUTLS_CONFIG_EXECUTABLE} --prefix
+EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix gnutls
OUTPUT_VARIABLE GNUTLS_PREFIX
)
-EXECUTE_PROCESS(COMMAND ${GNUTLS_CONFIG_EXECUTABLE} --cflags
+EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --cflags gnutls
OUTPUT_VARIABLE GNUTLS_CFLAGS
)
+STRING(REGEX REPLACE "[\r\n]" "" GNUTLS_CFLAGS "${GNUTLS_FLAGS}")
-EXECUTE_PROCESS(COMMAND ${GNUTLS_CONFIG_EXECUTABLE} --libs
+EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --libs gnutls
OUTPUT_VARIABLE GNUTLS_LDFLAGS
)
+STRING(REGEX REPLACE "[\r\n]" "" GNUTLS_LDFLAGS "${GNUTLS_LDFLAGS}")
SET(GNUTLS_POSSIBLE_INCLUDE_PATH "${GNUTLS_PREFIX}/include")
SET(GNUTLS_POSSIBLE_LIB_DIR "${GNUTLS_PREFIX}/lib")