cmake/sdlchecks.cmake
changeset 7835 4be86f76e710
parent 7690 76d7b6007a64
child 7977 5272ae8fccd7
     1.1 --- a/cmake/sdlchecks.cmake	Fri Oct 18 00:47:22 2013 -0700
     1.2 +++ b/cmake/sdlchecks.cmake	Fri Oct 18 00:49:59 2013 -0700
     1.3 @@ -304,6 +304,11 @@
     1.4        endif()
     1.5      endforeach()
     1.6  
     1.7 +    find_path(X_INCLUDEDIR X11/Xlib.h)
     1.8 +    if(X_INCLUDEDIR)
     1.9 +      set(X_CFLAGS "-I${X_INCLUDEDIR}")
    1.10 +    endif()
    1.11 +
    1.12      check_include_file(X11/Xcursor/Xcursor.h HAVE_XCURSOR_H)
    1.13      check_include_file(X11/extensions/Xinerama.h HAVE_XINERAMA_H)
    1.14      check_include_file(X11/extensions/XInput2.h HAVE_XINPUT_H)
    1.15 @@ -345,6 +350,7 @@
    1.16          endif(HAVE_SHMAT)
    1.17          if(NOT HAVE_SHMAT)
    1.18            add_definitions(-DNO_SHARED_MEMORY)
    1.19 +          set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY")
    1.20          endif(NOT HAVE_SHMAT)
    1.21        endif(NOT HAVE_SHMAT)
    1.22  
    1.23 @@ -367,6 +373,8 @@
    1.24          endif(HAVE_X11_SHARED)
    1.25        endif(X11_SHARED)
    1.26  
    1.27 +      set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}")
    1.28 +
    1.29        set(CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB})
    1.30        check_c_source_compiles("
    1.31            #include <X11/Xlib.h>