add_definitions(-DHAVE_CONFIG_H)
include_directories(${CMAKE_BINARY_DIR})
+add_definitions(-D_WIN32_IE=0x0500 -D_WIN32_WINNT=0x0500)
+
add_subdirectory(common)
add_subdirectory(win)
set(RDR_LIBRARIES zlib os)
if(GNUTLS_FOUND)
- set(RDR_LIBRARIES ${RDR_LIBRARIES} ${GNUTLS_LIBRARIES})
+ set(RDR_LIBRARIES ${RDR_LIBRARIES} ${GNUTLS_LIBRARIES} ws2_32)
endif()
target_link_libraries(rdr ${RDR_LIBRARIES})
#cmakedefine HAVE_VSNPRINTF
/* MS Visual Studio 2008 and newer doesn't know ssize_t */
-#if defined(HAVE_GNUTLS) && defined(WIN32)
-#define ssize_t long
+#if defined(HAVE_GNUTLS) && defined(WIN32) && !defined(__MINGW32__)
+typedef size_t ssize_t;
#endif
-add_definitions(-D_WIN32_IE=0x0500 -D_WIN32_WINNT=0x0500)
-
include_directories(${CMAKE_SOURCE_DIR}/common ${CMAKE_SOURCE_DIR}/win)
configure_file(resdefs.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/resdefs.h)
vncviewer.cxx
vncviewer.rc)
-target_link_libraries(vncviewer rfb rfb_win32 Xregion network rdr
- ws2_32.lib)
+set(VNCVIEWER_LIBRARIES rfb rfb_win32 Xregion network rdr)
+
+# When building with GnuTLS, librdr depends on ws2_32, so in order to make
+# MinGW happy, we need to put ws2_32 in librdr's target_link_libraries string,
+# not here.
+if(NOT GNUTLS_FOUND)
+ set(VNCVIEWER_LIBRARIES ${VNCVIEWER_LIBRARIES} ws2_32)
+endif()
+
+target_link_libraries(vncviewer ${VNCVIEWER_LIBRARIES})
install(TARGETS vncviewer
RUNTIME DESTINATION .