summaryrefslogtreecommitdiffstats
path: root/Tests/X11/X11.c
blob: 7804352ade4862c3caa28eff09b46f260437ffcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifdef CMAKE_HAS_X

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdlib.h>

int main()
{
  Display *mydisplay;
  char* display = ":0";


  if ( getenv("DISPLAY") )
    {
    display = getenv("DISPLAY");
    }

  mydisplay=XOpenDisplay(display);
  if ( mydisplay )
    {
    XCloseDisplay(mydisplay);
    }
  return 0;
}


#else

#include "stdio.h"

int main()
{
  printf("No X on this computer\n");
  return 0;
}

#endif