aboutsummaryrefslogtreecommitdiff
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-08-25 15:07:29 +0200
committerAndreas Schneider <mail@cynapses.org>2009-08-25 15:07:29 +0200
commit3804e72e24cd8fcc8f28e83781495c2ddfc14732 (patch)
tree74cf0a83e995ce52214f093cc04b71d381409301 /ConfigureChecks.cmake
parentb8508020e5e417a7500df19b8ee4cb73500c72d5 (diff)
downloadlibssh-3804e72e24cd8fcc8f28e83781495c2ddfc14732.tar.gz
libssh-3804e72e24cd8fcc8f28e83781495c2ddfc14732.tar.xz
libssh-3804e72e24cd8fcc8f28e83781495c2ddfc14732.zip
Fix linking on solaris.
libresolv and librt are required.
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 93e3c1a..7454c90 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -57,6 +57,16 @@ if (UNIX)
if (HAVE_LIBNSL)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl)
endif (HAVE_LIBNSL)
+ # libresolv
+ check_library_exists(resolve hstrerror "" HAVE_LIBRESOLV)
+ if (HAVE_LIBRESOLV)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} resolv)
+ endif (HAVE_LIBRESOLV)
+ check_library_exists(rt nanosleep "" HAVE_LIBRT)
+ # librt
+ if (HAVE_LIBRT)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
+ endif (HAVE_LIBRT)
check_function_exists(getaddrinfo HAVE_GETADDRINFO)
check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
@@ -65,6 +75,7 @@ if (UNIX)
check_function_exists(cfmakeraw HAVE_CFMAKERAW)
check_function_exists(regcomp HAVE_REGCOMP)
endif (UNIX)
+set(LIBSSH_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "libssh required system libraries")
# LIBRARIES
if (CRYPTO_FOUND)