cmake/sdlchecks.cmake
changeset 7835 4be86f76e710
parent 7690 76d7b6007a64
child 7977 5272ae8fccd7
equal deleted inserted replaced
7834:e22726c82922 7835:4be86f76e710
   302         get_filename_component(_TMP ${${_LNAME}_LIB} NAME)
   302         get_filename_component(_TMP ${${_LNAME}_LIB} NAME)
   303         set(${_LNAME}_LIB ${_TMP})
   303         set(${_LNAME}_LIB ${_TMP})
   304       endif()
   304       endif()
   305     endforeach()
   305     endforeach()
   306 
   306 
       
   307     find_path(X_INCLUDEDIR X11/Xlib.h)
       
   308     if(X_INCLUDEDIR)
       
   309       set(X_CFLAGS "-I${X_INCLUDEDIR}")
       
   310     endif()
       
   311 
   307     check_include_file(X11/Xcursor/Xcursor.h HAVE_XCURSOR_H)
   312     check_include_file(X11/Xcursor/Xcursor.h HAVE_XCURSOR_H)
   308     check_include_file(X11/extensions/Xinerama.h HAVE_XINERAMA_H)
   313     check_include_file(X11/extensions/Xinerama.h HAVE_XINERAMA_H)
   309     check_include_file(X11/extensions/XInput2.h HAVE_XINPUT_H)
   314     check_include_file(X11/extensions/XInput2.h HAVE_XINPUT_H)
   310     check_include_file(X11/extensions/Xrandr.h HAVE_XRANDR_H)
   315     check_include_file(X11/extensions/Xrandr.h HAVE_XRANDR_H)
   311     check_include_file(X11/extensions/Xrender.h HAVE_XRENDER_H)
   316     check_include_file(X11/extensions/Xrender.h HAVE_XRENDER_H)
   343         if(HAVE_SHMAT)
   348         if(HAVE_SHMAT)
   344           list(APPEND EXTRA_LIBS ipc)
   349           list(APPEND EXTRA_LIBS ipc)
   345         endif(HAVE_SHMAT)
   350         endif(HAVE_SHMAT)
   346         if(NOT HAVE_SHMAT)
   351         if(NOT HAVE_SHMAT)
   347           add_definitions(-DNO_SHARED_MEMORY)
   352           add_definitions(-DNO_SHARED_MEMORY)
       
   353           set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY")
   348         endif(NOT HAVE_SHMAT)
   354         endif(NOT HAVE_SHMAT)
   349       endif(NOT HAVE_SHMAT)
   355       endif(NOT HAVE_SHMAT)
   350 
   356 
   351       if(X11_SHARED)
   357       if(X11_SHARED)
   352         if(NOT HAVE_DLOPEN)
   358         if(NOT HAVE_DLOPEN)
   364           set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "\"${XEXT_LIB}\"")
   370           set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "\"${XEXT_LIB}\"")
   365         else(HAVE_X11_SHARED)
   371         else(HAVE_X11_SHARED)
   366           list(APPEND EXTRA_LIBS ${X11_LIB} ${XEXT_LIB})
   372           list(APPEND EXTRA_LIBS ${X11_LIB} ${XEXT_LIB})
   367         endif(HAVE_X11_SHARED)
   373         endif(HAVE_X11_SHARED)
   368       endif(X11_SHARED)
   374       endif(X11_SHARED)
       
   375 
       
   376       set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}")
   369 
   377 
   370       set(CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB})
   378       set(CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB})
   371       check_c_source_compiles("
   379       check_c_source_compiles("
   372           #include <X11/Xlib.h>
   380           #include <X11/Xlib.h>
   373           #include <X11/Xproto.h>
   381           #include <X11/Xproto.h>