1 # a simple C only test case
2 cmake_minimum_required (VERSION 2.6)
5 INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
6 MESSAGE("X11_FOUND: ${X11_FOUND}")
8 ADD_EXECUTABLE (UseX11 X11.c)
9 install(TARGETS UseX11 DESTINATION bin)
11 # so for universal binaries this test will fail if
14 LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH)
16 IF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
18 MESSAGE("disable X11, because of universal binary and sysroot")
19 ENDIF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib)
20 ENDIF(NUMARCH GREATER 1)
24 ADD_DEFINITIONS(-DCMAKE_HAS_X)
25 INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
26 TARGET_LINK_LIBRARIES(UseX11 ${X11_LIBRARIES})
28 ADD_EXECUTABLE(HelloWorldX11 HelloWorldX11.cxx)
29 TARGET_LINK_LIBRARIES(HelloWorldX11 ${X11_LIBRARIES})
30 install(TARGETS HelloWorldX11 DESTINATION bin)
32 set(CPACK_BINARY_OSXX11 ON CACHE BOOL "" FORCE)
33 set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE )
34 set(CPACK_PACKAGE_NAME HelloWorldX11Package)
35 set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11)
39 # build a CPack driven installer package