Author: Jan Dittberner <jandd@debian.org>
Subject: Use Debian version of SDL headers instead of missing included

--- a/rts/lib/headlessStubs/CMakeLists.txt
+++ b/rts/lib/headlessStubs/CMakeLists.txt
@@ -12,18 +12,8 @@
 		)
 ENDIF (WIN32)
 
-IF    (MINGW)
-	# We still need these header files,
-	# even if we are not going to link with SDL.
-	# We have them available anyway (mingwlibs).
-	FIND_PACKAGE(SDL REQUIRED)
-	INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
-ELSE  (MINGW)
-	# Use a direct copy of the GL and SDL headers,
-	# as these may not be available on headless systems.
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL)
-ENDIF (MINGW)
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 
 ADD_LIBRARY(headlessStubs STATIC EXCLUDE_FROM_ALL ${headlessStubsSources})
 TARGET_LINK_LIBRARIES(headlessStubs ${Boost_THREAD_LIBRARY})
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -165,9 +165,8 @@
 	add_definitions(${CUSTOM_COMPILER_DEFINITIONS})
 endif (CUSTOM_COMPILER_DEFINITIONS)
 
-if    (MINGW)
-	set(SDL_INCLUDE_DIR "${MINGWLIBS}/include/SDL")
-endif (MINGW)
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 if    (WIN32)
 	FIND_PACKAGE(Windres)
 endif (WIN32)
--- a/tools/unitsync/CMakeLists.txt
+++ b/tools/unitsync/CMakeLists.txt
@@ -13,18 +13,8 @@
 LIST(APPEND unitsync_libs 7zip lua)
 LIST(APPEND unitsync_libs headlessStubs)
 
-IF    (MINGW)
-	# We still need these header files,
-	# even if we are not going to link with SDL.
-	# We have them available anyway (mingwlibs).
-	FIND_PACKAGE(SDL REQUIRED)
-	INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
-ELSE  (MINGW)
-	# Use a direct copy of the GL and SDL headers,
-	# as these may not be available on headless systems.
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL)
-ENDIF (MINGW)
-
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 
 ADD_DEFINITIONS(-DUNITSYNC)
 ADD_DEFINITIONS(${PIC_FLAG})
--- a/rts/builds/dedicated/CMakeLists.txt
+++ b/rts/builds/dedicated/CMakeLists.txt
@@ -27,21 +27,8 @@
 	LIST(APPEND engineDedicatedLibraries dl)
 ENDIF (UNIX)
 
-IF    (MINGW OR APPLE)
-	# Windows:
-	# We still need these header files,
-	# even if we are not going to link with SDL.
-	# We have them available anyway (mingwlibs).
-	# OS X:
-	# Cocoa requires the SDL libary, whenever the SDL headers are used,
-	# due to some #define magic, which is practically impossible to workaround.
-	FIND_PACKAGE(SDL REQUIRED)
-	INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
-ELSE  (MINGW OR APPLE)
-	# Use a direct copy of the GL and SDL headers,
-	# as these may not be available on headless systems.
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL)
-ENDIF (MINGW OR APPLE)
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 
 
 ### Assemble the incude dirs
--- a/rts/builds/headless/CMakeLists.txt
+++ b/rts/builds/headless/CMakeLists.txt
@@ -12,25 +12,10 @@
 ADD_DEFINITIONS(-DBITMAP_NO_OPENGL)
 REMOVE_DEFINITIONS(-DAVI_CAPTURING)
 
-IF    (MINGW OR APPLE)
-	# Windows:
-	# We still need these header files,
-	# even if we are not going to link with gl, glu and SDL.
-	# We have them available anyway (mingwlibs).
-	# OS X:
-	# Cocoa requires the SDL libary, whenever the SDL headers are used,
-	# due to some #define magic, which is practically impossible to workaround.
-	FIND_PACKAGE(OpenGL REQUIRED)
-	FIND_PACKAGE(GLU REQUIRED)
-	FIND_PACKAGE(SDL REQUIRED)
-	INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
-ELSE  (MINGW OR APPLE)
-	# Use a direct copy of the GL and SDL headers,
-	# as these may not be available on headless systems.
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL)
-ENDIF (MINGW OR APPLE)
-
+FIND_PACKAGE(OpenGL REQUIRED)
+FIND_PACKAGE(GLU REQUIRED)
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 
 # headlessstubs are our stubs that replace libGL, libGLU, libGLEW, libSDL (yes really!)
 LIST(APPEND engineHeadlessLibraries headlessStubs)
