summaryrefslogtreecommitdiff
path: root/CMake/FindXLib.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMake/FindXLib.cmake')
-rw-r--r--CMake/FindXLib.cmake34
1 files changed, 34 insertions, 0 deletions
diff --git a/CMake/FindXLib.cmake b/CMake/FindXLib.cmake
new file mode 100644
index 00000000..5047a0f3
--- /dev/null
+++ b/CMake/FindXLib.cmake
@@ -0,0 +1,34 @@
+#
+# Try to find X library and include path.
+# Once done this will define
+#
+# XLIB_FOUND
+# XLIB_INCLUDE_PATH
+# XLIB_LIBRARY
+#
+
+FIND_PATH(XLIB_INCLUDE_PATH X11/Xlib.h
+ /usr/include
+ /usr/local/include
+ /sw/include
+ /opt/local/include
+ DOC "The directory where X11/Xlib.h resides")
+FIND_LIBRARY(XLIB_LIBRARY
+ NAMES XLIB X11
+ PATHS
+ /usr/lib64
+ /usr/lib
+ /usr/local/lib64
+ /usr/local/lib
+ /sw/lib
+ /opt/local/lib
+ DOC "The XLIB library")
+
+IF(XLIB_INCLUDE_PATH)
+ SET(XLIB_FOUND 1 CACHE STRING "Set to 1 if XLIB is found, 0 otherwise")
+ELSE(XLIB_INCLUDE_PATH)
+ SET(XLIB_FOUND 0 CACHE STRING "Set to 1 if XLIB is found, 0 otherwise")
+ENDIF(XLIB_INCLUDE_PATH)
+
+MARK_AS_ADVANCED(XLIB_FOUND)
+