CVS resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Tests / X11 / CMakeLists.txt
blobf0652578fbf609b415b38b0d7edf1cd57f72d539
1 # a simple C only test case
2 PROJECT (UseX11 C)
4 INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
5 MESSAGE("X11_FOUND: ${X11_FOUND}")
7 ADD_EXECUTABLE (UseX11 X11.c)
9 # so for universal binaries this test will fail if 
10
11 IF(APPLE)
12   LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH)
13   IF(NUMARCH GREATER 1)
14     IF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
15       SET(X11_FOUND FALSE)
16       MESSAGE("disable X11, because of universal binary and sysroot")
17     ENDIF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
18   ENDIF(NUMARCH GREATER 1)
19 ENDIF(APPLE)
21 IF(X11_FOUND)
22   ADD_DEFINITIONS(-DCMAKE_HAS_X)
23   INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
24   TARGET_LINK_LIBRARIES(UseX11 ${X11_LIBRARIES})
25 ENDIF(X11_FOUND)