blob: 9f867472100db695b1f9ebb4331c7742f388eebd [file] [log] [blame]
diff --git a/a/CMakeLists.txt b/b/CMakeLists.txt
index eaaf8c0..ef94fde 100644
--- a/a/CMakeLists.txt
+++ b/b/CMakeLists.txt
@@ -25,6 +25,7 @@ endif ()
# still providing a mechanism to force/disable these optional dependencies, as
# prescribed in http://www.gentoo.org/proj/en/qa/automagic.xml
set (ENABLE_GUI "AUTO" CACHE STRING "Enable Qt GUI.")
+set (ENABLE_X11 "AUTO" CACHE STRING "Enable X11.")
set (ENABLE_CLI true CACHE BOOL "Enable command Line interface.")
@@ -75,7 +76,17 @@ if (WIN32)
set (ENABLE_EGL false)
elseif (APPLE)
set (ENABLE_EGL false)
-else ()
+endif ()
+
+if (WIN32 OR APPLE OR ANDROID)
+ set (ENABLE_X11 false)
+endif ()
+
+if (ENABLE_X11)
+ if (NOT (ENABLE_X11 STREQUAL "AUTO"))
+ set (REQUIRE_X11 REQUIRED)
+ endif ()
+
find_package (X11)
if (X11_FOUND)
@@ -85,6 +96,9 @@ else ()
# Print a clear message when X11 is not found
include (FindPackageMessage)
find_package_message (X11 "Could not find X11" "")
+ if (DEFINED REQUIRE_X11)
+ message(FATAL_ERROR "X11 is required")
+ endif ()
endif ()
endif ()