summaryrefslogtreecommitdiffstats
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:13:28 +0200
commit36abd82a7e41477245f6c3e06bcf53e0c5e35b03 (patch)
tree813b04e36d7fbf165a556baede5281980647810e /ConfigureChecks.cmake
parentfd6d0b6897813ef9978c8714cf4ce37d8a8b179f (diff)
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 683c8eb5..b2774776 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_function_exists(getaddrinfo HAVE_GETADDRINFO)
check_function_exists(poll HAVE_POLL)
check_function_exists(select HAVE_SELECT)
@@ -119,11 +121,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