The previous fix for eliminating the console window in vncviewer.exe was not portable (it only worked in MinGW, which isn't what most people use.)  Use the CMake "WIN32" target property instead.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4576 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cda85ca..159de72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -309,9 +309,6 @@
 
 if(WIN32)
   add_subdirectory(win)
- if(CMAKE_C_COMPILER_ID STREQUAL GNU)
-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-subsystem,windows")
- endif(CMAKE_C_COMPILER_ID STREQUAL GNU)
 else()
   # No interest in building x related parts on Apple
   if(NOT APPLE)
diff --git a/vncviewer/CMakeLists.txt b/vncviewer/CMakeLists.txt
index ec89963..8be757e 100644
--- a/vncviewer/CMakeLists.txt
+++ b/vncviewer/CMakeLists.txt
@@ -29,7 +29,11 @@
   set(VNCVIEWER_SOURCES ${VNCVIEWER_SOURCES} X11PixelBuffer.cxx)
 endif()
 
-add_executable(vncviewer ${VNCVIEWER_SOURCES})
+if(WIN32)
+  add_executable(vncviewer WIN32 ${VNCVIEWER_SOURCES})
+else()
+  add_executable(vncviewer ${VNCVIEWER_SOURCES})
+endif()
 
 target_link_libraries(vncviewer rfb network rdr os Xregion ${FLTK_LIBRARIES} ${GETTEXT_LIBRARIES})