diff options
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index eec42d65..e11601af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ INCLUDE(cmake/Utils.cmake) INCLUDE(CheckFunctionExists) INCLUDE(CheckSymbolExists) INCLUDE(CheckTypeSize) +INCLUDE(CheckLibraryExists) # CMake configuration @@ -569,6 +570,25 @@ CHECK_FUNCTION_EXISTS(localtime_r VMIME_HAVE_LOCALTIME_R) ############################################################################## +# Windows-specific checks + +IF(WIN32) + + # Winsock + CHECK_LIBRARY_EXISTS("ws2_32" getch "${CMAKE_LIBRARY_PATH}" VMIME_HAVE_LIBWS2_32) + + IF(VMIME_HAVE_LIBWS2_32) + TARGET_LINK_LIBRARIES( + ${VMIME_LIBRARY_NAME} + ${TARGET_LINK_LIBRARIES} + "ws2_32" + ) + ENDIF() + +ENDIF() + + +############################################################################## # POSIX-specific checks CHECK_FUNCTION_EXISTS(getaddrinfo VMIME_HAVE_GETADDRINFO) |