--- a/CMakeLists.txt Mon Nov 11 00:15:20 2013 +0400
+++ b/CMakeLists.txt Fri Dec 06 00:02:10 2013 +0100
@@ -15,7 +15,7 @@
option(NOSERVER "Disable gameServer build (off)]" OFF)
option(NOPNG "Disable screenshoot compression (off)" OFF)
option(NOVIDEOREC "Disable video recording (off)" OFF)
-option(USESDL12 "Use SDL 1.2 (off)" OFF)
+option(NOSDL2 "Disable SDL2+ and use SDL 1.2 (off)" OFF)
#libraries are built shared unless explicitly added as a static
option(BUILD_SHARED_LIBS "Build libraries as shared modules (on)" ON)
--- a/QTfrontend/CMakeLists.txt Mon Nov 11 00:15:20 2013 +0400
+++ b/QTfrontend/CMakeLists.txt Fri Dec 06 00:02:10 2013 +0100
@@ -19,17 +19,17 @@
message(FATAL_ERROR "This version of QT is known *not* to work, please update or use a lower version")
endif()
-if(${USESDL12})
+if(${NOSDL2})
find_package(SDL REQUIRED) #video in SDLInteraction
find_package(SDL_mixer REQUIRED) #audio in SDLInteraction
include_directories(${SDL_INCLUDE_DIR})
include_directories(${SDLMIXER_INCLUDE_DIR})
-else(${USESDL12})
+else(${NOSDL2})
find_package(SDL2 REQUIRED)
find_package(SDL2_mixer REQUIRED) #audio in SDLInteraction
include_directories(${SDL2_INCLUDE_DIR})
include_directories(${SDL2MIXER_INCLUDE_DIR})
-endif(${USESDL12})
+endif(${NOSDL2})
if(${FFMPEG_FOUND})
add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS)
@@ -207,7 +207,7 @@
${QT_LIBRARIES}
)
-if(USESDL12)
+if(NOSDL2)
list(APPEND HW_LINK_LIBS
${SDL_LIBRARY}
${SDLMIXER_LIBRARY}
--- a/hedgewars/CMakeLists.txt Mon Nov 11 00:15:20 2013 +0400
+++ b/hedgewars/CMakeLists.txt Fri Dec 06 00:02:10 2013 +0100
@@ -1,19 +1,19 @@
enable_language(Pascal)
-if(${USESDL12})
+if(${NOSDL2})
find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)
find_package(SDL_net REQUIRED)
find_package(SDL_ttf REQUIRED)
find_package(SDL_mixer REQUIRED)
-else(${USESDL12})
+else(${NOSDL2})
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_net REQUIRED)
find_package(SDL2_ttf REQUIRED)
find_package(SDL2_mixer REQUIRED)
add_definitions(-dSDL2)
-endif(${USESDL12})
+endif(${NOSDL2})
include (CheckLibraryExists)
@@ -108,7 +108,7 @@
#DEPENDECIES AND EXECUTABLES SECTION
-if(NOT ${BUILD_ENGINE_LIBRARY} AND APPLE AND ${USESDL12})
+if(NOT ${BUILD_ENGINE_LIBRARY} AND APPLE AND ${NOSDL2})
#on OSX we need to provide the SDL_main() function when building as executable
add_subdirectory(sdlmain)
list(APPEND HW_LINK_LIBS SDLmain)
@@ -121,10 +121,10 @@
add_definitions(-dUSE_VIDEO_RECORDING)
add_flag_append(CMAKE_Pascal_FLAGS -Fl${LIBRARY_OUTPUT_PATH})
- if(${USESDL12})
+ if(${NOSDL2})
#only for SDL < 2, linking carried out by fpc
find_package_or_disable_msg(GLUT NOVIDEOREC "Video recording will not be built")
- endif(${USESDL12})
+ endif(${NOSDL2})
endif()
find_package_or_disable_msg(PNG NOPNG "Screenshots will be saved in BMP")
@@ -160,7 +160,7 @@
list(APPEND HW_LINK_LIBS physlayer)
#Mix_Init/Mix_Quit from SDL_mixer 1.2.10
-if(${USESDL12})
+if(${NOSDL2})
check_library_exists(${SDLMIXER_LIBRARY} Mix_Init "" HAVE_MIXINIT)
if(HAVE_MIXINIT)
add_definitions(-dSDL_MIXER_NEWER)
@@ -171,7 +171,7 @@
if(HAVE_IMGINIT)
add_definitions(-dSDL_IMAGE_NEWER)
endif(HAVE_IMGINIT)
-endif(${USESDL12})
+endif(${NOSDL2})
#needs to be last
add_definitions(-dDEBUGFILE)
--- a/misc/libphyslayer/CMakeLists.txt Mon Nov 11 00:15:20 2013 +0400
+++ b/misc/libphyslayer/CMakeLists.txt Fri Dec 06 00:02:10 2013 +0100
@@ -1,12 +1,12 @@
-if(${USESDL12})
+if(${NOSDL2})
find_package(SDL REQUIRED)
include_directories(${SDL_INCLUDE_DIR})
-else(${USESDL12})
+else(${NOSDL2})
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIR})
set(SDL_LIBRARY ${SDL2_LIBRARY})
-endif(${USESDL12})
+endif(${NOSDL2})
include_directories(${PHYSFS_INCLUDE_DIR})
include_directories(${LUA_INCLUDE_DIR})
--- a/tools/CMakeLists.txt Mon Nov 11 00:15:20 2013 +0400
+++ b/tools/CMakeLists.txt Fri Dec 06 00:02:10 2013 +0100
@@ -8,20 +8,20 @@
if (APPLE)
find_package(Qt4 REQUIRED QUIET)
- if(${USESDL12})
+ if(${NOSDL2})
find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)
find_package(SDL_net REQUIRED)
find_package(SDL_ttf REQUIRED)
find_package(SDL_mixer REQUIRED)
find_package(OggVorbis REQUIRED)
- else(${USESDL12})
+ else(${NOSDL2})
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_net REQUIRED)
find_package(SDL2_ttf REQUIRED)
find_package(SDL2_mixer REQUIRED)
- endif(${USESDL12})
+ endif(${NOSDL2})
if(NOT NOAUTOUPDATE)
find_package(Sparkle) #needed for SPARKLE_FOUND variable