aboutsummaryrefslogtreecommitdiff
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-05-25 22:08:31 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-05-25 22:08:31 +0200
commit07fb895fe98b29cc432f742ae51b09f502a1dce6 (patch)
tree2ee58ce80e5611d1eda660451b205c995c4e751f /ConfigureChecks.cmake
parent65282841e2a3e8af634759b6f7b39581a885d9d5 (diff)
downloadlibssh-07fb895fe98b29cc432f742ae51b09f502a1dce6.tar.gz
libssh-07fb895fe98b29cc432f742ae51b09f502a1dce6.tar.xz
libssh-07fb895fe98b29cc432f742ae51b09f502a1dce6.zip
cmake: Fix detection of clock_gettime.
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake13
1 files changed, 5 insertions, 8 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 39b9767b..2f0ec20e 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -107,11 +107,13 @@ if (UNIX)
# librt
check_library_exists(rt nanosleep "" HAVE_LIBRT)
- if (HAVE_LIBRT)
- set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
- endif (HAVE_LIBRT)
endif (NOT LINUX)
+ check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)
+ if (HAVE_LIBRT OR HAVE_CLOCK_GETTIME)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
+ endif (HAVE_LIBRT OR HAVE_CLOCK_GETTIME)
+
check_library_exists(util forkpty "" HAVE_LIBUTIL)
check_function_exists(getaddrinfo HAVE_GETADDRINFO)
check_function_exists(poll HAVE_POLL)
@@ -120,11 +122,6 @@ if (UNIX)
check_function_exists(regcomp HAVE_REGCOMP)
endif (UNIX)
-check_library_exists(rt clock_gettime "" HAVE_LIBRT)
-if (HAVE_LIBRT)
- set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
-endif (HAVE_LIBRT)
-
set(LIBSSH_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "libssh required system libraries")
# LIBRARIES