CMakeLists.txt
changeset 8137 6dbd80731aa0
parent 8136 175cac5d90a6
child 8153 3e43c73ac79b
     1.1 --- a/CMakeLists.txt	Tue Jan 28 12:37:04 2014 -0500
     1.2 +++ b/CMakeLists.txt	Tue Jan 28 12:42:01 2014 -0500
     1.3 @@ -51,17 +51,17 @@
     1.4  else()
     1.5    set(ARCH_64 FALSE)
     1.6    set(PROCESSOR_ARCH "x86")
     1.7 -endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
     1.8 +endif()
     1.9  set(LIBNAME SDL2)
    1.10  if(NOT LIBTYPE)
    1.11    set(LIBTYPE SHARED)
    1.12 -endif(NOT LIBTYPE)
    1.13 +endif()
    1.14  
    1.15  # Get the platform
    1.16  if(WIN32)
    1.17    if(NOT WINDOWS)
    1.18      set(WINDOWS TRUE)
    1.19 -  endif(NOT WINDOWS)
    1.20 +  endif()
    1.21  elseif(UNIX AND NOT APPLE)
    1.22    if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
    1.23      set(LINUX TRUE)
    1.24 @@ -106,13 +106,13 @@
    1.25    set(UNIX_SYS ON)
    1.26  else()
    1.27    set(UNIX_SYS OFF)
    1.28 -endif(UNIX AND NOT APPLE)
    1.29 +endif()
    1.30  
    1.31  if(UNIX OR APPLE)
    1.32    set(UNIX_OR_MAC_SYS ON)
    1.33  else()
    1.34    set(UNIX_OR_MAC_SYS OFF)
    1.35 -endif(UNIX OR APPLE)
    1.36 +endif()
    1.37  
    1.38  # Default option knobs
    1.39  if(APPLE OR ARCH_64)
    1.40 @@ -120,7 +120,7 @@
    1.41  endif()
    1.42  if(UNIX OR MINGW OR MSYS)
    1.43    set(OPT_DEF_LIBC ON)
    1.44 -endif(UNIX OR MINGW OR MSYS)
    1.45 +endif()
    1.46  
    1.47  # Compiler info
    1.48  if(CMAKE_COMPILER_IS_GNUCC)
    1.49 @@ -134,20 +134,20 @@
    1.50    #set(CMAKE_C_FLAGS "/ZI /WX- /
    1.51  else()
    1.52    set(OPT_DEF_ASM FALSE)
    1.53 -endif(CMAKE_COMPILER_IS_GNUCC)
    1.54 +endif()
    1.55  
    1.56  # Default flags, if not set otherwise
    1.57  if("$ENV{CFLAGS}" STREQUAL "")
    1.58    if(USE_GCC OR USE_CLANG)
    1.59      set(CMAKE_C_FLAGS "-g -O3")
    1.60 -  endif(USE_GCC OR USE_CLANG)
    1.61 +  endif()
    1.62  else("$ENV{CFLAGS}" STREQUAL "")
    1.63    set(CMAKE_C_FLAGS "$ENV{CFLAGS}")
    1.64    list(APPEND EXTRA_CFLAGS "$ENV{CFLAGS}")
    1.65 -endif("$ENV{CFLAGS}" STREQUAL "")
    1.66 +endif()
    1.67  if(NOT ("$ENV{CFLAGS}" STREQUAL "")) # Hackish, but does the trick on Win32
    1.68    list(APPEND EXTRA_LDFLAGS "$ENV{LDFLAGS}")
    1.69 -endif(NOT ("$ENV{CFLAGS}" STREQUAL ""))
    1.70 +endif()
    1.71  
    1.72  if(MSVC)
    1.73    option(FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
    1.74 @@ -160,7 +160,7 @@
    1.75        endif()
    1.76      endforeach(flag_var)
    1.77    endif()
    1.78 -endif(MSVC)
    1.79 +endif()
    1.80  
    1.81  # Those are used for pkg-config and friends, so that the SDL2.pc, sdl2-config,
    1.82  # etc. are created correctly.
    1.83 @@ -177,9 +177,9 @@
    1.84    if(HAVE_GCC_NO_CYGWIN)
    1.85      list(APPEND EXTRA_LDFLAGS "-mno-cygwin")
    1.86      list(APPEND SDL_LIBS "-mno-cygwin")
    1.87 -  endif(HAVE_GCC_NO_CYGWIN)
    1.88 +  endif()
    1.89    set(SDL_CFLAGS "${SDL_CFLAGS} -I/usr/include/mingw")
    1.90 -endif(CYGWIN)
    1.91 +endif()
    1.92  
    1.93  add_definitions(-DUSING_GENERATED_CONFIG_H)
    1.94  # General includes
    1.95 @@ -278,7 +278,7 @@
    1.96    set(SDL_DEFAULT_ASSERT_LEVEL 3)
    1.97  else()
    1.98    message_error("unknown assertion level")
    1.99 -endif(ASSERTIONS STREQUAL "auto")
   1.100 +endif()
   1.101  set(HAVE_ASSERTIONS ${ASSERTIONS})
   1.102  
   1.103  # Compiler option evaluation
   1.104 @@ -289,7 +289,7 @@
   1.105          #error Dependency tracking requires GCC 3.0 or newer
   1.106          #endif
   1.107          int main(int argc, char **argv) { }" HAVE_DEPENDENCY_TRACKING)
   1.108 -  endif(DEPENDENCY_TRACKING)
   1.109 +  endif()
   1.110  
   1.111    if(GCC_ATOMICS)
   1.112      check_c_source_compiles("int main(int argc, char **argv) {
   1.113 @@ -305,8 +305,8 @@
   1.114            int a;
   1.115            __sync_lock_test_and_set(&a, 1);
   1.116            __sync_lock_release(&a); }" HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
   1.117 -    endif(NOT HAVE_GCC_ATOMICS)
   1.118 -  endif(GCC_ATOMICS)
   1.119 +    endif()
   1.120 +  endif()
   1.121  
   1.122    set(CMAKE_REQUIRED_FLAGS "-mpreferred-stack-boundary=2")
   1.123    check_c_source_compiles("int x = 0; int main(int argc, char **argv) {}"
   1.124 @@ -321,16 +321,16 @@
   1.125        int main(int argc, char **argv) {}" HAVE_GCC_FVISIBILITY)
   1.126    if(HAVE_GCC_FVISIBILITY)
   1.127      list(APPEND EXTRA_CFLAGS "-fvisibility=hidden")
   1.128 -  endif(HAVE_GCC_FVISIBILITY)
   1.129 +  endif()
   1.130    set(CMAKE_REQUIRED_FLAGS)
   1.131  
   1.132    check_c_compiler_flag(-Wall HAVE_GCC_WALL)
   1.133    if(HAVE_GCC_WALL)
   1.134      if(HAIKU)
   1.135        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
   1.136 -    endif(HAIKU)
   1.137 -  endif(HAVE_GCC_WALL)
   1.138 -endif(USE_GCC OR USE_CLANG)
   1.139 +    endif()
   1.140 +  endif()
   1.141 +endif()
   1.142  
   1.143  if(ASSEMBLY)
   1.144    if(USE_GCC OR USE_CLANG)
   1.145 @@ -357,9 +357,9 @@
   1.146            int main(int argc, char **argv) { }" HAVE_MMX)
   1.147        if(HAVE_MMX)
   1.148          list(APPEND EXTRA_CFLAGS "-mmmx")
   1.149 -      endif(HAVE_MMX)
   1.150 +      endif()
   1.151        set(CMAKE_REQUIRED_FLAGS)
   1.152 -    endif(MMX)
   1.153 +    endif()
   1.154  
   1.155      if(3DNOW)
   1.156        set(CMAKE_REQUIRED_FLAGS "-m3dnow")
   1.157 @@ -374,9 +374,9 @@
   1.158            }" HAVE_3DNOW)
   1.159        if(HAVE_3DNOW)
   1.160          list(APPEND EXTRA_CFLAGS "-m3dnow")
   1.161 -      endif(HAVE_3DNOW)
   1.162 +      endif()
   1.163        set(CMAKE_REQUIRED_FLAGS)
   1.164 -    endif(3DNOW)
   1.165 +    endif()
   1.166  
   1.167      if(SSE)
   1.168        set(CMAKE_REQUIRED_FLAGS "-msse")
   1.169 @@ -397,9 +397,9 @@
   1.170            int main(int argc, char **argv) { }" HAVE_SSE)
   1.171        if(HAVE_SSE)
   1.172          list(APPEND EXTRA_CFLAGS "-msse")
   1.173 -      endif(HAVE_SSE)
   1.174 +      endif()
   1.175        set(CMAKE_REQUIRED_FLAGS)
   1.176 -    endif(SSE)
   1.177 +    endif()
   1.178  
   1.179      if(SSE2)
   1.180        set(CMAKE_REQUIRED_FLAGS "-msse2")
   1.181 @@ -420,18 +420,18 @@
   1.182            int main(int argc, char **argv) { }" HAVE_SSE2)
   1.183        if(HAVE_SSE2)
   1.184          list(APPEND EXTRA_CFLAGS "-msse2")
   1.185 -      endif(HAVE_SSE2)
   1.186 +      endif()
   1.187        set(CMAKE_REQUIRED_FLAGS)
   1.188 -    endif(SSE2)
   1.189 +    endif()
   1.190  
   1.191      if(SSEMATH)
   1.192        if(SSE OR SSE2)
   1.193          if(USE_GCC)
   1.194            list(APPEND EXTRA_CFLAGS "-mfpmath=387")
   1.195 -        endif(USE_GCC)
   1.196 +        endif()
   1.197          set(HAVE_SSEMATH TRUE)
   1.198 -      endif(SSE OR SSE2)
   1.199 -    endif(SSEMATH)
   1.200 +      endif()
   1.201 +    endif()
   1.202  
   1.203      if(ALTIVEC)
   1.204        set(CMAKE_REQUIRED_FLAGS "-maltivec")
   1.205 @@ -453,26 +453,26 @@
   1.206          set(SDL_ALTIVEC_BLITTERS 1)
   1.207          if(HAVE_ALTIVEC_H_HDR)
   1.208            set(HAVE_ALTIVEC_H 1)
   1.209 -        endif(HAVE_ALTIVEC_H_HDR)
   1.210 -      endif(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR)
   1.211 -    endif(ALTIVEC)
   1.212 +        endif()
   1.213 +      endif()
   1.214 +    endif()
   1.215    elseif(MSVC_VERSION GREATER 1500)
   1.216      # TODO: SDL_cpuinfo.h needs to support the user's configuration wish
   1.217      # for MSVC - right now it is always activated
   1.218      if(NOT ARCH_64)
   1.219        set(HAVE_MMX TRUE)
   1.220        set(HAVE_3DNOW TRUE)
   1.221 -    endif(NOT ARCH_64)
   1.222 +    endif()
   1.223      set(HAVE_SSE TRUE)
   1.224      set(HAVE_SSE2 TRUE)
   1.225      set(SDL_ASSEMBLY_ROUTINES 1)
   1.226 -  endif(USE_GCC OR USE_CLANG)
   1.227 +  endif()
   1.228  # TODO:
   1.229  #else(ASSEMBLY)
   1.230  #  if(USE_GCC OR USE_CLANG)
   1.231  #    list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx")
   1.232 -#  endif(USE_GCC OR USE_CLANG)
   1.233 -endif(ASSEMBLY)
   1.234 +#  endif()
   1.235 +endif()
   1.236  
   1.237  # TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define
   1.238  # anything.
   1.239 @@ -496,7 +496,7 @@
   1.240      endforeach()
   1.241      if(NOT CYGWIN AND NOT MINGW)
   1.242        set(HAVE_ALLOCA 1)
   1.243 -    endif(NOT CYGWIN AND NOT MINGW)
   1.244 +    endif()
   1.245      set(HAVE_M_PI 1)
   1.246      add_definitions(-D_USE_MATH_DEFINES) # needed for M_PI
   1.247      set(STDC_HEADERS 1)
   1.248 @@ -544,21 +544,21 @@
   1.249        endforeach()
   1.250        set(CMAKE_REQUIRED_LIBRARIES)
   1.251        list(APPEND EXTRA_LIBS m)
   1.252 -    endif(HAVE_LIBM)
   1.253 +    endif()
   1.254  
   1.255      check_library_exists(iconv iconv_open "" HAVE_LIBICONV)
   1.256      if(HAVE_LIBICONV)
   1.257        list(APPEND EXTRA_LIBS iconv)
   1.258 -    endif(HAVE_LIBICONV)
   1.259 +    endif()
   1.260  
   1.261      check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION)
   1.262 -  endif(WINDOWS AND NOT MINGW)
   1.263 +  endif()
   1.264  else(LIBC)
   1.265    if(WINDOWS)
   1.266      set(HAVE_STDARG_H 1)
   1.267      set(HAVE_STDDEF_H 1)
   1.268 -  endif(WINDOWS)
   1.269 -endif(LIBC)
   1.270 +  endif()
   1.271 +endif()
   1.272  
   1.273  
   1.274  # Enable/disable various subsystems of the SDL library
   1.275 @@ -566,24 +566,24 @@
   1.276    string(TOUPPER ${_SUB} _OPT)
   1.277    if(NOT SDL_${_OPT})
   1.278      set(SDL_${_OPT}_DISABLED 1)
   1.279 -  endif(NOT SDL_${_OPT})
   1.280 +  endif()
   1.281  endforeach()
   1.282  if(SDL_JOYSTICK)
   1.283    file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/*.c)
   1.284    set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
   1.285 -endif(SDL_JOYSTICK)
   1.286 +endif()
   1.287  if(SDL_HAPTIC)
   1.288    if(NOT SDL_JOYSTICK)
   1.289      # Haptic requires some private functions from the joystick subsystem.
   1.290      message_error("SDL_HAPTIC requires SDL_JOYSTICK, which is not enabled")
   1.291 -  endif(NOT SDL_JOYSTICK)
   1.292 +  endif()
   1.293    file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/*.c)
   1.294    set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
   1.295 -endif(SDL_HAPTIC)
   1.296 +endif()
   1.297  if(SDL_POWER)
   1.298    file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/*.c)
   1.299    set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
   1.300 -endif(SDL_POWER)
   1.301 +endif()
   1.302  # TODO: in configure.in, the test for LOADSO and SDL_DLOPEN is a bit weird:
   1.303  # if LOADSO is not wanted, SDL_LOADSO_DISABLED is set
   1.304  # If however on Unix or APPLE dlopen() is detected via CheckDLOPEN(),
   1.305 @@ -597,21 +597,21 @@
   1.306      file(GLOB DUMMYAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dummy/*.c)
   1.307      set(SOURCE_FILES ${SOURCE_FILES} ${DUMMYAUDIO_SOURCES})
   1.308      set(HAVE_DUMMYAUDIO TRUE)
   1.309 -  endif(DUMMYAUDIO)
   1.310 +  endif()
   1.311    if(DISKAUDIO)
   1.312      set(SDL_AUDIO_DRIVER_DISK 1)
   1.313      file(GLOB DISKAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/disk/*.c)
   1.314      set(SOURCE_FILES ${SOURCE_FILES} ${DISKAUDIO_SOURCES})
   1.315      set(HAVE_DISKAUDIO TRUE)
   1.316 -  endif(DISKAUDIO)
   1.317 -endif(SDL_AUDIO)
   1.318 +  endif()
   1.319 +endif()
   1.320  
   1.321  if(SDL_DLOPEN)
   1.322    # Relevant for Unix/Darwin only
   1.323    if(UNIX OR APPLE)
   1.324      CheckDLOPEN()
   1.325 -  endif(UNIX OR APPLE)
   1.326 -endif(SDL_DLOPEN)
   1.327 +  endif()
   1.328 +endif()
   1.329  
   1.330  if(SDL_VIDEO)
   1.331    if(VIDEO_DUMMY)
   1.332 @@ -620,8 +620,8 @@
   1.333      set(SOURCE_FILES ${SOURCE_FILES} ${VIDEO_DUMMY_SOURCES})
   1.334      set(HAVE_VIDEO_DUMMY TRUE)
   1.335      set(HAVE_SDL_VIDEO TRUE)
   1.336 -  endif(VIDEO_DUMMY)
   1.337 -endif(SDL_VIDEO)
   1.338 +  endif()
   1.339 +endif()
   1.340  
   1.341  # Platform-specific options and settings
   1.342  if(UNIX AND NOT APPLE)
   1.343 @@ -650,7 +650,7 @@
   1.344      CheckNAS()
   1.345      CheckSNDIO()
   1.346      CheckFusionSound()
   1.347 -  endif(SDL_AUDIO)
   1.348 +  endif()
   1.349  
   1.350    if(SDL_VIDEO)
   1.351      CheckX11()
   1.352 @@ -658,7 +658,7 @@
   1.353      CheckOpenGLX11()
   1.354      CheckOpenGLESX11()
   1.355      CheckWayland()
   1.356 -  endif(SDL_VIDEO)
   1.357 +  endif()
   1.358  
   1.359    if(LINUX)
   1.360      check_c_source_compiles("
   1.361 @@ -684,24 +684,24 @@
   1.362  
   1.363      if(HAVE_INPUT_EVENTS)
   1.364        set(SDL_INPUT_LINUXEV 1)
   1.365 -    endif(HAVE_INPUT_EVENTS)
   1.366 +    endif()
   1.367  
   1.368      if(SDL_HAPTIC AND HAVE_INPUT_EVENTS)
   1.369        set(SDL_HAPTIC_LINUX 1)
   1.370        file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c)
   1.371        set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
   1.372        set(HAVE_SDL_HAPTIC TRUE)
   1.373 -    endif(SDL_HAPTIC AND HAVE_INPUT_EVENTS)
   1.374 +    endif()
   1.375  
   1.376      if(HAVE_INPUT_KD)
   1.377        set(SDL_INPUT_LINUXKD 1)
   1.378 -    endif(HAVE_INPUT_KD)
   1.379 +    endif()
   1.380  
   1.381      check_include_file("libudev.h" HAVE_LIBUDEV_H)
   1.382  
   1.383      # !!! FIXME: this needs pkg-config to find the include path, I think.
   1.384      check_include_file("dbus/dbus.h" HAVE_DBUS_DBUS_H)
   1.385 -  endif(LINUX)
   1.386 +  endif()
   1.387  
   1.388    if(INPUT_TSLIB)
   1.389      check_c_source_compiles("
   1.390 @@ -710,8 +710,8 @@
   1.391      if(HAVE_INPUT_TSLIB)
   1.392        set(SDL_INPUT_TSLIB 1)
   1.393        list(APPEND EXTRA_LIBS ts)
   1.394 -    endif(HAVE_INPUT_TSLIB)
   1.395 -  endif(INPUT_TSLIB)
   1.396 +    endif()
   1.397 +  endif()
   1.398  
   1.399    if(SDL_JOYSTICK)
   1.400      CheckUSBHID()   # seems to be BSD specific - limit the test to BSD only?
   1.401 @@ -720,8 +720,8 @@
   1.402        file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c)
   1.403        set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
   1.404        set(HAVE_SDL_JOYSTICK TRUE)
   1.405 -    endif(LINUX)
   1.406 -  endif(SDL_JOYSTICK)
   1.407 +    endif()
   1.408 +  endif()
   1.409  
   1.410    CheckPTHREAD()
   1.411  
   1.412 @@ -734,14 +734,14 @@
   1.413        check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME)
   1.414        if(FOUND_CLOCK_GETTIME)
   1.415          set(HAVE_CLOCK_GETTIME 1)
   1.416 -      endif(FOUND_CLOCK_GETTIME)
   1.417 -    endif(HAVE_CLOCK_GETTIME)
   1.418 -  endif(CLOCK_GETTIME)
   1.419 +      endif()
   1.420 +    endif()
   1.421 +  endif()
   1.422  
   1.423    check_include_file(linux/version.h HAVE_LINUX_VERSION_H)
   1.424    if(HAVE_LINUX_VERSION_H)
   1.425      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LINUX_VERSION_H")
   1.426 -  endif(HAVE_LINUX_VERSION_H)
   1.427 +  endif()
   1.428  
   1.429    if(SDL_POWER)
   1.430      if(LINUX)
   1.431 @@ -749,22 +749,22 @@
   1.432        file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/linux/*.c)
   1.433        set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
   1.434        set(HAVE_SDL_POWER TRUE)
   1.435 -    endif(LINUX)
   1.436 -  endif(SDL_POWER)
   1.437 +    endif()
   1.438 +  endif()
   1.439  
   1.440    if(SDL_FILESYSTEM)
   1.441      set(SDL_FILESYSTEM_UNIX 1)
   1.442      file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/unix/*.c)
   1.443      set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
   1.444      set(HAVE_SDL_FILESYSTEM TRUE)
   1.445 -  endif(SDL_FILESYSTEM)
   1.446 +  endif()
   1.447  
   1.448    if(SDL_TIMERS)
   1.449      set(SDL_TIMER_UNIX 1)
   1.450      file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
   1.451      set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
   1.452      set(HAVE_SDL_TIMERS TRUE)
   1.453 -  endif(SDL_TIMERS)
   1.454 +  endif()
   1.455  
   1.456    if(RPATH)
   1.457      set(SDL_RLD_FLAGS "")
   1.458 @@ -775,7 +775,7 @@
   1.459      endif()
   1.460      set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
   1.461      set(HAVE_RPATH TRUE)
   1.462 -  endif(RPATH)
   1.463 +  endif()
   1.464  
   1.465  elseif(WINDOWS)
   1.466    find_program(WINDRES windres)
   1.467 @@ -791,7 +791,7 @@
   1.468    if(DIRECTX)
   1.469      if("$ENV{DXSDK_DIR}" STREQUAL "")
   1.470        message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set")
   1.471 -    endif("$ENV{DXSDK_DIR}" STREQUAL "")
   1.472 +    endif()
   1.473      set(CMAKE_REQUIRED_FLAGS "/I\"$ENV{DXSDK_DIR}\\Include\"")
   1.474      check_include_file(d3d9.h HAVE_D3D_H)
   1.475      check_include_file(ddraw.h HAVE_DDRAW_H)
   1.476 @@ -805,7 +805,7 @@
   1.477        include_directories($ENV{DXSDK_DIR}\\Include)
   1.478      endif()
   1.479      set(CMAKE_REQUIRED_FLAGS)
   1.480 -  endif(DIRECTX)
   1.481 +  endif()
   1.482  
   1.483    if(SDL_AUDIO)
   1.484      set(SDL_AUDIO_DRIVER_WINMM 1)
   1.485 @@ -817,20 +817,20 @@
   1.486        set(SDL_AUDIO_DRIVER_DSOUND 1)
   1.487        file(GLOB DSOUND_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/directsound/*.c)
   1.488        set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES})
   1.489 -    endif(HAVE_DSOUND_H)
   1.490 +    endif()
   1.491  
   1.492      if(HAVE_XAUDIO2_H)
   1.493        set(SDL_AUDIO_DRIVER_XAUDIO2 1)
   1.494        file(GLOB XAUDIO2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/xaudio2/*.c)
   1.495        set(SOURCE_FILES ${SOURCE_FILES} ${XAUDIO2_AUDIO_SOURCES})
   1.496 -    endif(HAVE_XAUDIO2_H)
   1.497 -  endif(SDL_AUDIO)
   1.498 +    endif()
   1.499 +  endif()
   1.500  
   1.501    if(SDL_VIDEO)
   1.502      # requires SDL_LOADSO on Windows (IME, DX, etc.)
   1.503      if(NOT SDL_LOADSO)
   1.504        message_error("SDL_VIDEO requires SDL_LOADSO, which is not enabled")
   1.505 -    endif(NOT SDL_LOADSO)
   1.506 +    endif()
   1.507      set(SDL_VIDEO_DRIVER_WINDOWS 1)
   1.508      file(GLOB WIN_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/windows/*.c)
   1.509      set(SOURCE_FILES ${SOURCE_FILES} ${WIN_VIDEO_SOURCES})
   1.510 @@ -838,9 +838,9 @@
   1.511      if(RENDER_D3D AND HAVE_D3D_H)
   1.512        set(SDL_VIDEO_RENDER_D3D 1)
   1.513        set(HAVE_RENDER_D3D TRUE)
   1.514 -    endif(RENDER_D3D AND HAVE_D3D_H)
   1.515 +    endif()
   1.516      set(HAVE_SDL_VIDEO TRUE)
   1.517 -  endif(SDL_VIDEO)
   1.518 +  endif()
   1.519  
   1.520    if(SDL_THREADS)
   1.521      set(SDL_THREAD_WINDOWS 1)
   1.522 @@ -851,20 +851,20 @@
   1.523        ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systls.c
   1.524        ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c)
   1.525      set(HAVE_SDL_THREADS TRUE)
   1.526 -  endif(SDL_THREADS)
   1.527 +  endif()
   1.528  
   1.529    if(SDL_POWER)
   1.530      set(SDL_POWER_WINDOWS 1)
   1.531      set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/power/windows/SDL_syspower.c)
   1.532      set(HAVE_SDL_POWER TRUE)
   1.533 -  endif(SDL_POWER)
   1.534 +  endif()
   1.535  
   1.536    if(SDL_FILESYSTEM)
   1.537      set(SDL_FILESYSTEM_WINDOWS 1)
   1.538      file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/windows/*.c)
   1.539      set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
   1.540      set(HAVE_SDL_FILESYSTEM TRUE)
   1.541 -  endif(SDL_FILESYSTEM)
   1.542 +  endif()
   1.543  
   1.544    # Libraries for Win32 native and MinGW
   1.545    list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)
   1.546 @@ -876,14 +876,14 @@
   1.547      file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/windows/*.c)
   1.548      set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
   1.549      set(HAVE_SDL_TIMERS TRUE)
   1.550 -  endif(SDL_TIMERS)
   1.551 +  endif()
   1.552  
   1.553    if(SDL_LOADSO)
   1.554      set(SDL_LOADSO_WINDOWS 1)
   1.555      file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/windows/*.c)
   1.556      set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
   1.557      set(HAVE_SDL_LOADSO TRUE)
   1.558 -  endif(SDL_LOADSO)
   1.559 +  endif()
   1.560  
   1.561    file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c)
   1.562    set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES})
   1.563 @@ -894,8 +894,8 @@
   1.564        set(SDL_VIDEO_OPENGL_WGL 1)
   1.565        set(SDL_VIDEO_RENDER_OGL 1)
   1.566        set(HAVE_VIDEO_OPENGL TRUE)
   1.567 -    endif(VIDEO_OPENGL)
   1.568 -  endif(SDL_VIDEO)
   1.569 +    endif()
   1.570 +  endif()
   1.571  
   1.572    if(SDL_JOYSTICK)
   1.573      if(HAVE_DINPUT_H)
   1.574 @@ -905,15 +905,15 @@
   1.575      else()
   1.576        set(SDL_JOYSTICK_WINMM 1)
   1.577        set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_mmjoystick.c)
   1.578 -    endif(HAVE_DINPUT_H)
   1.579 +    endif()
   1.580      set(HAVE_SDL_JOYSTICK TRUE)
   1.581 -  endif(SDL_JOYSTICK)
   1.582 +  endif()
   1.583  
   1.584    if(SDL_HAPTIC AND HAVE_DINPUT_H)
   1.585      set(SDL_HAPTIC_DINPUT 1)
   1.586      set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/haptic/windows/SDL_syshaptic.c)
   1.587      set(HAVE_SDL_HAPTIC TRUE)
   1.588 -  endif(SDL_HAPTIC AND HAVE_DINPUT_H)
   1.589 +  endif()
   1.590  
   1.591    file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc)
   1.592    file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c)
   1.593 @@ -922,7 +922,7 @@
   1.594      list(APPEND EXTRA_LDFLAGS "-mwindows")
   1.595      set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main")
   1.596      list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows")
   1.597 -  endif(MINGW OR CYGWIN)
   1.598 +  endif()
   1.599  elseif(APPLE)
   1.600    # TODO: rework this for proper MacOS X, iOS and Darwin support
   1.601  
   1.602 @@ -1026,10 +1026,10 @@
   1.603        if(DARWIN)
   1.604          find_library(OpenGL_LIBRARY OpenGL)
   1.605          list(APPEND EXTRA_LIBRARIES ${OpenGL_LIBRARY})
   1.606 -      endif(DARWIN)
   1.607 +      endif()
   1.608        set(HAVE_VIDEO_OPENGL TRUE)
   1.609 -    endif(VIDEO_OPENGL)
   1.610 -  endif(SDL_VIDEO)
   1.611 +    endif()
   1.612 +  endif()
   1.613  
   1.614    CheckPTHREAD()
   1.615  elseif(HAIKU)
   1.616 @@ -1058,8 +1058,8 @@
   1.617        set(SDL_VIDEO_RENDER_OGL 1)
   1.618        list(APPEND EXTRA_LIBS GL)
   1.619        set(HAVE_VIDEO_OPENGL TRUE)
   1.620 -    endif(VIDEO_OPENGL)
   1.621 -  endif(SDL_VIDEO)
   1.622 +    endif()
   1.623 +  endif()
   1.624  
   1.625    CheckPTHREAD()
   1.626  endif()
   1.627 @@ -1079,45 +1079,45 @@
   1.628      file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c)
   1.629      set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
   1.630    endif()
   1.631 -endif(NOT HAVE_SDL_JOYSTICK)
   1.632 +endif()
   1.633  if(NOT HAVE_SDL_HAPTIC)
   1.634    set(SDL_HAPTIC_DISABLED 1)
   1.635    file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
   1.636    set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
   1.637 -endif(NOT HAVE_SDL_HAPTIC)
   1.638 +endif()
   1.639  if(NOT HAVE_SDL_LOADSO)
   1.640    set(SDL_LOADSO_DISABLED 1)
   1.641    file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
   1.642    set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
   1.643 -endif(NOT HAVE_SDL_LOADSO)
   1.644 +endif()
   1.645  if(NOT HAVE_SDL_FILESYSTEM)
   1.646    set(SDL_FILESYSTEM_DISABLED 1)
   1.647    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
   1.648    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
   1.649 -endif(NOT HAVE_SDL_FILESYSTEM)
   1.650 +endif()
   1.651  
   1.652  # We always need to have threads and timers around
   1.653  if(NOT HAVE_SDL_THREADS)
   1.654    set(SDL_THREADS_DISABLED 1)
   1.655    file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c)
   1.656    set(SOURCE_FILES ${SOURCE_FILES} ${THREADS_SOURCES})
   1.657 -endif(NOT HAVE_SDL_THREADS)
   1.658 +endif()
   1.659  if(NOT HAVE_SDL_TIMERS)
   1.660    set(SDL_TIMERS_DISABLED 1)
   1.661    file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/dummy/*.c)
   1.662    set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
   1.663 -endif(NOT HAVE_SDL_TIMERS)
   1.664 +endif()
   1.665  
   1.666  if(NOT SDLMAIN_SOURCES)
   1.667    file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c)
   1.668 -endif(NOT SDLMAIN_SOURCES)
   1.669 +endif()
   1.670  
   1.671  # Append the -MMD -MT flags
   1.672  # if(DEPENDENCY_TRACKING)
   1.673  #   if(COMPILER_IS_GNUCC)
   1.674  #     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MMD -MT \$@")
   1.675 -#   endif(COMPILER_IS_GNUCC)
   1.676 -# endif(DEPENDENCY_TRACKING)
   1.677 +#   endif()
   1.678 +# endif()
   1.679  
   1.680  configure_file("${SDL2_SOURCE_DIR}/include/SDL_config.h.cmake"
   1.681    "${SDL2_BINARY_DIR}/include/SDL_config.h")
   1.682 @@ -1125,13 +1125,13 @@
   1.683  # Prepare the flags and remove duplicates
   1.684  if(EXTRA_LDFLAGS)
   1.685    list(REMOVE_DUPLICATES EXTRA_LDFLAGS)
   1.686 -endif(EXTRA_LDFLAGS)
   1.687 +endif()
   1.688  if(EXTRA_LIBS)
   1.689    list(REMOVE_DUPLICATES EXTRA_LIBS)
   1.690 -endif(EXTRA_LIBS)
   1.691 +endif()
   1.692  if(EXTRA_CFLAGS)
   1.693    list(REMOVE_DUPLICATES EXTRA_CFLAGS)
   1.694 -endif(EXTRA_CFLAGS)
   1.695 +endif()
   1.696  listtostr(EXTRA_CFLAGS _EXTRA_CFLAGS)
   1.697  set(EXTRA_CFLAGS ${_EXTRA_CFLAGS})
   1.698  
   1.699 @@ -1151,14 +1151,14 @@
   1.700    else(SDL_STATIC)
   1.701      set(ENABLE_STATIC_TRUE "#")
   1.702      set(ENABLE_STATIC_FALSE "")
   1.703 -  endif(SDL_STATIC)
   1.704 +  endif()
   1.705    if(SDL_SHARED)
   1.706      set(ENABLE_SHARED_TRUE "")
   1.707      set(ENABLE_SHARED_FALSE "#")
   1.708    else(SDL_SHARED)
   1.709      set(ENABLE_SHARED_TRUE "#")
   1.710      set(ENABLE_SHARED_FALSE "")
   1.711 -  endif(SDL_SHARED)
   1.712 +  endif()
   1.713  
   1.714    # Clean up the different lists
   1.715    listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
   1.716 @@ -1180,7 +1180,7 @@
   1.717      "${SDL2_BINARY_DIR}/sdl2-config" @ONLY)
   1.718    configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in"
   1.719      "${SDL2_BINARY_DIR}/SDL2.spec" @ONLY)
   1.720 -endif(NOT WINDOWS OR CYGWIN)
   1.721 +endif()
   1.722  
   1.723  ##### Info output #####
   1.724  message(STATUS "")
   1.725 @@ -1220,7 +1220,7 @@
   1.726    message(STATUS "were installed, then make sure you have set the")
   1.727    message(STATUS "CFLAGS and LDFLAGS environment variables correctly.")
   1.728    message(STATUS "")
   1.729 -endif(UNIX)
   1.730 +endif()
   1.731  
   1.732  # Ensure that the extra cflags are used at compile time
   1.733  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
   1.734 @@ -1241,10 +1241,10 @@
   1.735        VERSION ${SDL_VERSION}
   1.736        SOVERSION ${LT_CURRENT}
   1.737        OUTPUT_NAME "SDL2")
   1.738 -  endif(UNIX)
   1.739 +  endif()
   1.740   set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
   1.741   target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
   1.742 -endif(SDL_SHARED)
   1.743 +endif()
   1.744  
   1.745  if(SDL_STATIC)
   1.746    set (BUILD_SHARED_LIBS FALSE)
   1.747 @@ -1254,12 +1254,12 @@
   1.748      set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
   1.749      set_target_properties(SDL2-static PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
   1.750      set_target_properties(SDL2-static PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
   1.751 -  endif(WINDOWS)
   1.752 +  endif()
   1.753    # TODO: Win32 platforms keep the same suffix .lib for import and static
   1.754    # libraries - do we need to consider this?
   1.755    set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
   1.756    target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
   1.757 -endif(SDL_STATIC)
   1.758 +endif()
   1.759  
   1.760  ##### Installation targets #####
   1.761  install(TARGETS ${_INSTALL_LIBS}
   1.762 @@ -1280,7 +1280,7 @@
   1.763      execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
   1.764      \"libSDL2-2.0.so\" \"libSDL2.so\")")
   1.765    install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}")
   1.766 -endif(SDL_SHARED)
   1.767 +endif()
   1.768  
   1.769  if(NOT WINDOWS OR CYGWIN)
   1.770    if(FREEBSD)
   1.771 @@ -1289,8 +1289,9 @@
   1.772    else(FREEBSD)
   1.773      install(FILES ${SDL2_BINARY_DIR}/sdl2.pc
   1.774        DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
   1.775 -  endif(FREEBSD)
   1.776 +  endif()
   1.777    install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin)
   1.778    # TODO: what about the .spec file? Is it only needed for RPM creation?
   1.779    install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal")
   1.780 -endif(NOT WINDOWS OR CYGWIN)
   1.781 +endif()
   1.782 +