diff --git a/CMakeLists.txt b/CMakeLists.txt index 18f5f7ac..d2d75fc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -678,6 +678,10 @@ IF(VMIME_HAVE_TLS_SUPPORT) ) ENDIF() + IF(WIN32) + SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} crypt32.lib") + ENDIF() + SET(VMIME_PKGCONFIG_REQUIRES "${VMIME_PKGCONFIG_REQUIRES} openssl") SET(VMIME_TLS_SUPPORT_LIB_IS_GNUTLS "OFF") @@ -958,9 +962,9 @@ IF(VMIME_BUILD_SHARED_LIBRARY) ) ENDIF() -FIND_LIBRARY(PTHREAD_LIB pthread) +#FIND_LIBRARY(PTHREAD_LIB pthread) -IF(PTHREAD_LIB) +IF(CMAKE_THREAD_LIBS_INIT) SET(VMIME_HAVE_PTHREAD 1) IF(VMIME_BUILD_SHARED_LIBRARY) @@ -1007,6 +1011,9 @@ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") #SET(CMAKE_EXE_LINKER_FLAGS "-s") ELSE() + IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /EHsc") + ENDIF() IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)