Our FLTK patches modified FLTK's autotools-based build system so that HAVE_XFIXES and HAVE_XCURSOR were defined in FLTK's config.h, but those changes never made it into the CMake-based build system used by the in-tree version of FLTK. Further, our build system was allowing silent failures whenever Xft, Xinerama, Xcursor, or Xfixes were not present on the build system. Now, the lack of these libraries is treated as a fatal error, since these libraries are critical for TigerVNC functionality.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4834 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e2e265..4a59d81 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -247,15 +247,23 @@
# No proper handling for extra X11 libs that FLTK might need...
if(X11_Xft_FOUND)
set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xft_LIB})
+ else()
+ message(FATAL_ERROR "Xft headers/libraries not found (needed by FLTK.)")
endif()
if(X11_Xinerama_FOUND)
set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xinerama_LIB})
+ else()
+ message(FATAL_ERROR "Xinerama headers/libraries not found (needed by FLTK.)")
endif()
if(X11_Xfixes_FOUND)
set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xfixes_LIB})
+ else()
+ message(FATAL_ERROR "Xfixes headers/libraries not found (needed by FLTK.)")
endif()
if(X11_Xcursor_FOUND)
set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xcursor_LIB})
+ else()
+ message(FATAL_ERROR "Xcursor headers/libraries not found (needed by FLTK.)")
endif()
endif()
@@ -304,7 +312,7 @@
endif()
message(STATUS "Using included FLTK library")
endif()
-
+
# Check for GNUTLS library
option(ENABLE_GNUTLS "Enable protocol encryption and advanced authentication" ON)
if(ENABLE_GNUTLS)
diff --git a/common/fltk/CMakeLists.txt b/common/fltk/CMakeLists.txt
index f13eec7..5d1d476 100644
--- a/common/fltk/CMakeLists.txt
+++ b/common/fltk/CMakeLists.txt
@@ -229,6 +229,24 @@
endif(OPTION_USE_XFT)
#######################################################################
+if(X11_Xfixes_FOUND)
+ option(OPTION_USE_XFIXES "use lib Xfixes" ON)
+endif(X11_Xfixes_FOUND)
+
+if(OPTION_USE_XFIXES)
+ set(HAVE_XFIXES ${X11_Xfixes_FOUND})
+endif(OPTION_USE_XFIXES)
+
+#######################################################################
+if(X11_Xcursor_FOUND)
+ option(OPTION_USE_XCURSOR "use lib Xcursor" ON)
+endif(X11_Xcursor_FOUND)
+
+if(OPTION_USE_XCURSOR)
+ set(HAVE_XCURSOR ${X11_Xcursor_FOUND})
+endif(OPTION_USE_XCURSOR)
+
+#######################################################################
add_subdirectory(src)
diff --git a/common/fltk/configh.cmake.in b/common/fltk/configh.cmake.in
index 092f491..a2dbb58 100644
--- a/common/fltk/configh.cmake.in
+++ b/common/fltk/configh.cmake.in
@@ -117,6 +117,22 @@
#define USE_XDBE HAVE_XDBE
/*
+ * HAVE_XFIXES:
+ *
+ * Do we have the X fixes extension?
+ */
+
+#cmakedefine01 HAVE_XFIXES
+
+/*
+ * HAVE_XCURSOR:
+ *
+ * Do we have the X cursor library?
+ */
+
+#cmakedefine01 HAVE_XCURSOR
+
+/*
* __APPLE_QUARTZ__:
*
* If __APPLE_QUARTZ__ is defined, FLTK will be
diff --git a/common/fltk/src/CMakeLists.txt b/common/fltk/src/CMakeLists.txt
index c8247db..4cb64e5 100644
--- a/common/fltk/src/CMakeLists.txt
+++ b/common/fltk/src/CMakeLists.txt
@@ -193,3 +193,11 @@
if(USE_XFT)
target_link_libraries(fltk_static ${X11_Xft_LIB})
endif(USE_XFT)
+
+if(HAVE_XFIXES)
+ target_link_libraries(fltk_static ${X11_Xfixes_LIB})
+endif(HAVE_XFIXES)
+
+if(HAVE_XCURSOR)
+ target_link_libraries(fltk_static ${X11_Xcursor_LIB})
+endif(HAVE_XCURSOR)