summaryrefslogtreecommitdiffstats
path: root/Tests/X11
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-10-29 20:46:38 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-10-29 20:46:38 (GMT)
commit2d970c26f02b56e4d98ab148fbed5d2753427672 (patch)
tree1d5c825a49336b8e5656e68f035272bd29344bb5 /Tests/X11
parent5e2cc830f85eea886944f16395f0ba532ac26882 (diff)
downloadCMake-2d970c26f02b56e4d98ab148fbed5d2753427672.zip
CMake-2d970c26f02b56e4d98ab148fbed5d2753427672.tar.gz
CMake-2d970c26f02b56e4d98ab148fbed5d2753427672.tar.bz2
Add test for X11
Diffstat (limited to 'Tests/X11')
-rw-r--r--Tests/X11/CMakeLists.txt11
-rw-r--r--Tests/X11/X11.c38
2 files changed, 49 insertions, 0 deletions
diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt
new file mode 100644
index 0000000..d97b4fb
--- /dev/null
+++ b/Tests/X11/CMakeLists.txt
@@ -0,0 +1,11 @@
+# a simple C only test case
+PROJECT (X11 C)
+
+INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
+
+IF(CMAKE_HAS_X)
+ INCLUDE_DIRECTORIES(${CMAKE_X_CFLAGS})
+
+ ADD_EXECUTABLE (X11 X11.c)
+ TARGET_LINK_LIBRARIES(X11 ${CMAKE_X_LIBS})
+ENDIF(CMAKE_HAS_X)
diff --git a/Tests/X11/X11.c b/Tests/X11/X11.c
new file mode 100644
index 0000000..b877b31
--- /dev/null
+++ b/Tests/X11/X11.c
@@ -0,0 +1,38 @@
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+char hello[]="hello.world";
+char hi[]="Hi";
+
+main(argc, argv)
+int argc;
+char **argv;
+{
+ Display *mydisplay;
+ Window mywindow;
+ GC mygc;
+
+ XEvent myevent;
+ KeySym mykey;
+
+ XSizeHints myhint;
+ int myscreen;
+ unsigned long myforeground, mybackground;
+ int i;
+ char text[10];
+ int done;
+
+ mydisplay=XOpenDisplay("");
+ myscreen=DefaultScreen(mydisplay);
+ myforeground=BlackPixel(mydisplay, myscreen);
+
+ mywindow=XCreateSimpleWindow(mydisplay,
+ DefaultRootWindow(mydisplay),
+ myhint.x, myhint.y, myhint.width, myhint.height, 5,
+ myforeground, mybackground );
+ XDestroyWindow(mydisplay, mywindow);
+ XCloseDisplay(mydisplay);
+ exit(0);
+}
+
+