aboutsummaryrefslogtreecommitdiff
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-09-01 15:15:17 +0200
committerAndreas Schneider <asn@cynapses.org>2010-09-01 15:15:17 +0200
commita93f2d8bfe98e2927fc7024973c52062ccd28b30 (patch)
tree7fea3f5be30c1914c2fe751291c8baa0b98d12c5 /ConfigureChecks.cmake
parent8c55294ea9134c32f80d1a399a6a49ecdc9264b2 (diff)
downloadlibssh-a93f2d8bfe98e2927fc7024973c52062ccd28b30.tar.gz
libssh-a93f2d8bfe98e2927fc7024973c52062ccd28b30.tar.xz
libssh-a93f2d8bfe98e2927fc7024973c52062ccd28b30.zip
build: Fixed pthread detection.
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake18
1 files changed, 9 insertions, 9 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 4a1738be..6a8ab240 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -58,11 +58,9 @@ check_include_file(openssl/blowfish.h HAVE_OPENSSL_BLOWFISH_H)
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
check_include_file(openssl/des.h HAVE_OPENSSL_DES_H)
-include(FindThreads)
-
-if(CMAKE_HAVE_PTHREAD_H)
- set(HAVE_PTHREAD_H)
-endif(CMAKE_HAVE_PTHREAD_H)
+if (CMAKE_HAVE_PTHREAD_H)
+ set(HAVE_PTHREAD_H 1)
+endif (CMAKE_HAVE_PTHREAD_H)
# FUNCTIONS
@@ -111,6 +109,12 @@ if (Z_LIBRARY)
set(HAVE_LIBZ 1)
endif (Z_LIBRARY)
+if (CMAKE_HAVE_THREADS_LIBRARY)
+ set(HAVE_PTHREAD 1)
+
+ set(LIBSSH_REQUIRED_LIBRARIES ${LIBSSH_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+endif (CMAKE_HAVE_THREADS_LIBRARY)
+
# OPTIONS
if (WITH_DEBUG_CRYPTO)
set(DEBUG_CRYPTO 1)
@@ -120,10 +124,6 @@ if (WITH_DEBUG_CALLTRACE)
set(DEBUG_CALLTRACE 1)
endif (WITH_DEBUG_CALLTRACE)
-if (CMAKE_HAVE_PTHREAD_CREATE)
- set(HAVE_PTHREAD)
-endif (CMAKE_HAVE_PTHREAD_CREATE)
-
# ENDIAN
if (NOT WIN32)
test_big_endian(WORDS_BIGENDIAN)