aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-02-08 13:24:20 +0000
committerVincent Richard <[email protected]>2013-02-08 13:24:20 +0000
commit3829cc2f86c8b93d4530da639fa1072e40e89eaa (patch)
tree6fa04a8985063903fb11554c5e21efd482605f94
parentAdditional MDN fields (thanks to Mehmet Bozkurt). (diff)
downloadvmime-3829cc2f86c8b93d4530da639fa1072e40e89eaa.tar.gz
vmime-3829cc2f86c8b93d4530da639fa1072e40e89eaa.zip
Link with "ws2_32" library on Windows, if available.
-rw-r--r--CMakeLists.txt20
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)