summaryrefslogtreecommitdiffstats
path: root/Tests/X11/CMakeLists.txt
blob: 6a4abef2f2b54bc5165bd0005f07b75aed3bc3ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# a simple C only test case
PROJECT (X11 C)

# Temporary hack to deal with dirty cache files.
IF(EXISTS ${X11_BINARY_DIR}/X11.exe)
  EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E remove ${X11_BINARY_DIR}/X11.exe)
ENDIF(EXISTS ${X11_BINARY_DIR}/X11.exe)
IF(EXISTS ${X11_BINARY_DIR}/X11)
  EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E remove ${X11_BINARY_DIR}/X11)
ENDIF(EXISTS ${X11_BINARY_DIR}/X11)

INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)

ADD_EXECUTABLE (useX11 X11.c)

IF(CMAKE_HAS_X)
  ADD_DEFINITIONS(-DCMAKE_HAS_X)
  INCLUDE_DIRECTORIES(${CMAKE_X_INCLUDE_DIRS})
  TARGET_LINK_LIBRARIES(useX11 ${CMAKE_X_LIBS})
ENDIF(CMAKE_HAS_X)