summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2013-10-18 00:49:59 -0700
committerSam Lantinga <slouken@libsdl.org>2013-10-18 00:49:59 -0700
commit2402c91e3011abf5ff41c73c3bc8c23b6c2b1d64 (patch)
tree177de3c81114efbe1d39fd906e45bf6cf5a50d34 /cmake
parent9de2cf0764d7e16bff4cb282ab5143405b00d73e (diff)
Fixed bug 2108 - CMake does not set X11 includes properly for sdl2-config and friends
Marcus von Appen The autotools-based code uses X_CFLAGS and some hackish x_includes code to add some necessary includes to SDL_CFLAGS for proper X11 and OpenGL include handling. At the moment, the cmake-baed build code does not do that. Below is a patch, which provides the necessary changes to add a proper include to the SDL_CFLAGS.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/sdlchecks.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 5666f52fca..fe763785cb 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -304,6 +304,11 @@ macro(CheckX11)
endif()
endforeach()
+ find_path(X_INCLUDEDIR X11/Xlib.h)
+ if(X_INCLUDEDIR)
+ set(X_CFLAGS "-I${X_INCLUDEDIR}")
+ endif()
+
check_include_file(X11/Xcursor/Xcursor.h HAVE_XCURSOR_H)
check_include_file(X11/extensions/Xinerama.h HAVE_XINERAMA_H)
check_include_file(X11/extensions/XInput2.h HAVE_XINPUT_H)
@@ -345,6 +350,7 @@ macro(CheckX11)
endif(HAVE_SHMAT)
if(NOT HAVE_SHMAT)
add_definitions(-DNO_SHARED_MEMORY)
+ set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY")
endif(NOT HAVE_SHMAT)
endif(NOT HAVE_SHMAT)
@@ -367,6 +373,8 @@ macro(CheckX11)
endif(HAVE_X11_SHARED)
endif(X11_SHARED)
+ set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}")
+
set(CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB})
check_c_source_compiles("
#include <X11/Xlib.h>