Initial commit of new FLTK based vncviewer. Most of the code comes from the
current Unix vncviewer.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4345 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 83926e7..b8507ab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,9 @@
 # The RC version must always be four comma-separated numbers
 set(RCVERSION 1,0,90,0)
 
+# Manual toggle until we can deprecate the old viewers
+option(BUILD_NEW_VNCVIEWER "Build the new FLTK based vncviewer instead of the old ones")
+
 # Compatibility variables for the migration from autotools
 add_definitions(-DPACKAGE_NAME="${CMAKE_PROJECT_NAME}")
 add_definitions(-DPACKAGE_VERSION="${VERSION}")
@@ -128,6 +131,13 @@
   message(STATUS "WARNING: You are not using libjpeg-turbo. Performance will suffer.")
 endif()
 
+# Check for FLTK
+if(BUILD_NEW_VNCVIEWER)
+  set(FLTK_SKIP_FLUID TRUE)
+  set(FLTK_SKIP_OPENGL TRUE)
+  find_package(FLTK COMPONENTS REQUIRED)
+endif()
+
 # Check for GNUTLS library
 find_package(GnuTLS)
 if(GNUTLS_FOUND)
@@ -179,3 +189,7 @@
 else()
   add_subdirectory(unix)
 endif()
+
+if(BUILD_NEW_VNCVIEWER)
+  add_subdirectory(vncviewer)
+endif()