diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | ConfigureChecks.cmake | 56 |
2 files changed, 30 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c68dc143..380075de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ set(CMAKE_MODULE_PATH # add definitions include(DefineCMakeDefaults) +include(DefinePlatformDefaults) include(DefineCompilerFlags) include(DefineInstallationPaths) include(DefineOptions.cmake) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index fc17f61d..7c059454 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -81,33 +81,35 @@ if (WIN32) endif (WIN32) if (UNIX) - # libsocket (Solaris) - check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) - if (HAVE_LIBSOCKET) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket) - endif (HAVE_LIBSOCKET) - # libnsl (Solaris) - check_library_exists(nsl gethostbyname "" HAVE_LIBNSL) - if (HAVE_LIBNSL) - set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl) - endif (HAVE_LIBNSL) - # libresolv - check_library_exists(resolv 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) - check_function_exists(poll HAVE_POLL) - check_function_exists(select HAVE_SELECT) - check_function_exists(cfmakeraw HAVE_CFMAKERAW) - check_function_exists(regcomp HAVE_REGCOMP) + if (NOT LINUX) + # libsocket (Solaris) + check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) + if (HAVE_LIBSOCKET) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket) + endif (HAVE_LIBSOCKET) + # libnsl (Solaris) + check_library_exists(nsl gethostbyname "" HAVE_LIBNSL) + if (HAVE_LIBNSL) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl) + endif (HAVE_LIBNSL) + # libresolv + check_library_exists(resolv 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) + endif (NOT LINUX) + + check_function_exists(getaddrinfo HAVE_GETADDRINFO) + check_function_exists(gethostbyname HAVE_GETHOSTBYNAME) + check_function_exists(poll HAVE_POLL) + check_function_exists(select HAVE_SELECT) + 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") |