cmake/sdlchecks.cmake
changeset 9277 f0bd40782fc7
parent 9170 872d1b4b34a1
child 9409 9df20f292907
     1.1 --- a/cmake/sdlchecks.cmake	Sat Dec 13 13:20:19 2014 -0800
     1.2 +++ b/cmake/sdlchecks.cmake	Sat Dec 13 02:33:52 2014 -0500
     1.3 @@ -39,7 +39,7 @@
     1.4          set(_DLLIB ${_LIBNAME})
     1.5          set(HAVE_DLOPEN TRUE)
     1.6          break()
     1.7 -      endif(DLOPEN_LIB)
     1.8 +      endif()
     1.9      endforeach()
    1.10    endif()
    1.11  
    1.12 @@ -63,7 +63,7 @@
    1.13      set(SOURCE_FILES ${SOURCE_FILES} ${DLOPEN_SOURCES})
    1.14      set(HAVE_SDL_LOADSO TRUE)
    1.15    endif()
    1.16 -endmacro(CheckDLOPEN)
    1.17 +endmacro()
    1.18  
    1.19  # Requires:
    1.20  # - n/a
    1.21 @@ -78,23 +78,23 @@
    1.22        check_c_source_compiles("
    1.23            #include <soundcard.h>
    1.24            int main() { int arg = SNDCTL_DSP_SETFRAGMENT; }" OSS_FOUND)
    1.25 -    endif(NOT OSS_FOUND)
    1.26 +    endif()
    1.27  
    1.28      if(OSS_FOUND)
    1.29        set(HAVE_OSS TRUE)
    1.30        file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c)
    1.31        if(OSS_HEADER_FILE STREQUAL "soundcard.h")
    1.32          set(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1)
    1.33 -      endif(OSS_HEADER_FILE STREQUAL "soundcard.h")
    1.34 +      endif()
    1.35        set(SDL_AUDIO_DRIVER_OSS 1)
    1.36        set(SOURCE_FILES ${SOURCE_FILES} ${OSS_SOURCES})
    1.37        if(NETBSD OR OPENBSD)
    1.38          list(APPEND EXTRA_LIBS ossaudio)
    1.39 -      endif(NETBSD OR OPENBSD)
    1.40 +      endif()
    1.41        set(HAVE_SDL_AUDIO TRUE)
    1.42 -    endif(OSS_FOUND)
    1.43 -  endif(OSS)
    1.44 -endmacro(CheckOSS)
    1.45 +    endif()
    1.46 +  endif()
    1.47 +endmacro()
    1.48  
    1.49  # Requires:
    1.50  # - n/a
    1.51 @@ -117,14 +117,14 @@
    1.52            FindLibraryAndSONAME("asound")
    1.53            set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${ASOUND_LIB_SONAME}\"")
    1.54            set(HAVE_ALSA_SHARED TRUE)
    1.55 -        endif(NOT HAVE_DLOPEN)
    1.56 -      else(ALSA_SHARED)
    1.57 +        endif()
    1.58 +      else()
    1.59          list(APPEND EXTRA_LIBS asound)
    1.60 -      endif(ALSA_SHARED)
    1.61 +      endif()
    1.62        set(HAVE_SDL_AUDIO TRUE)
    1.63 -    endif(HAVE_ASOUNDLIB_H)
    1.64 -  endif(ALSA)
    1.65 -endmacro(CheckALSA)
    1.66 +    endif()
    1.67 +  endif()
    1.68 +endmacro()
    1.69  
    1.70  # Requires:
    1.71  # - PkgCheckModules
    1.72 @@ -147,14 +147,14 @@
    1.73            FindLibraryAndSONAME("pulse-simple")
    1.74            set(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "\"${PULSE_SIMPLE_LIB_SONAME}\"")
    1.75            set(HAVE_PULSEAUDIO_SHARED TRUE)
    1.76 -        endif(NOT HAVE_DLOPEN)
    1.77 -      else(PULSEAUDIO_SHARED)
    1.78 +        endif()
    1.79 +      else()
    1.80          list(APPEND EXTRA_LDFLAGS ${PKG_PULSEAUDIO_LDFLAGS})
    1.81 -      endif(PULSEAUDIO_SHARED)
    1.82 +      endif()
    1.83        set(HAVE_SDL_AUDIO TRUE)
    1.84 -    endif(PKG_PULSEAUDIO_FOUND)
    1.85 -  endif(PULSEAUDIO)
    1.86 -endmacro(CheckPulseAudio)
    1.87 +    endif()
    1.88 +  endif()
    1.89 +endmacro()
    1.90  
    1.91  # Requires:
    1.92  # - PkgCheckModules
    1.93 @@ -177,14 +177,14 @@
    1.94            FindLibraryAndSONAME(esd)
    1.95            set(SDL_AUDIO_DRIVER_ESD_DYNAMIC "\"${ESD_LIB_SONAME}\"")
    1.96            set(HAVE_ESD_SHARED TRUE)
    1.97 -        endif(NOT HAVE_DLOPEN)
    1.98 -      else(ESD_SHARED)
    1.99 +        endif()
   1.100 +      else()
   1.101          list(APPEND EXTRA_LDFLAGS ${PKG_ESD_LDFLAGS})
   1.102 -      endif(ESD_SHARED)
   1.103 +      endif()
   1.104        set(HAVE_SDL_AUDIO TRUE)
   1.105 -    endif(PKG_ESD_FOUND)
   1.106 -  endif(ESD)
   1.107 -endmacro(CheckESD)
   1.108 +    endif()
   1.109 +  endif()
   1.110 +endmacro()
   1.111  
   1.112  # Requires:
   1.113  # - n/a
   1.114 @@ -212,14 +212,14 @@
   1.115            FindLibraryAndSONAME(artsc)
   1.116            set(SDL_AUDIO_DRIVER_ARTS_DYNAMIC "\"${ARTSC_LIB_SONAME}\"")
   1.117            set(HAVE_ARTS_SHARED TRUE)
   1.118 -        endif(NOT HAVE_DLOPEN)
   1.119 -      else(ARTS_SHARED)
   1.120 +        endif()
   1.121 +      else()
   1.122          list(APPEND EXTRA_LDFLAGS ${ARTS_LIBS})
   1.123 -      endif(ARTS_SHARED)
   1.124 +      endif()
   1.125        set(HAVE_SDL_AUDIO TRUE)
   1.126 -    endif(ARTS_CONFIG)
   1.127 -  endif(ARTS)
   1.128 -endmacro(CheckARTS)
   1.129 +    endif()
   1.130 +  endif()
   1.131 +endmacro()
   1.132  
   1.133  # Requires:
   1.134  # - n/a
   1.135 @@ -243,14 +243,14 @@
   1.136            FindLibraryAndSONAME("audio")
   1.137            set(SDL_AUDIO_DRIVER_NAS_DYNAMIC "\"${AUDIO_LIB_SONAME}\"")
   1.138            set(HAVE_NAS_SHARED TRUE)
   1.139 -        endif(NOT HAVE_DLOPEN)
   1.140 -      else(NAS_SHARED)
   1.141 +        endif()
   1.142 +      else()
   1.143          list(APPEND EXTRA_LIBS ${D_NAS_LIB})
   1.144 -      endif(NAS_SHARED)
   1.145 +      endif()
   1.146        set(HAVE_SDL_AUDIO TRUE)
   1.147 -    endif(HAVE_NAS_H AND D_NAS_LIB)
   1.148 -  endif(NAS)
   1.149 -endmacro(CheckNAS)
   1.150 +    endif()
   1.151 +  endif()
   1.152 +endmacro()
   1.153  
   1.154  # Requires:
   1.155  # - n/a
   1.156 @@ -274,14 +274,14 @@
   1.157            FindLibraryAndSONAME("sndio")
   1.158            set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${SNDIO_LIB_SONAME}\"")
   1.159            set(HAVE_SNDIO_SHARED TRUE)
   1.160 -        endif(NOT HAVE_DLOPEN)
   1.161 -      else(SNDIO_SHARED)
   1.162 +        endif()
   1.163 +      else()
   1.164          list(APPEND EXTRA_LIBS ${D_SNDIO_LIB})
   1.165 -      endif(SNDIO_SHARED)
   1.166 +      endif()
   1.167        set(HAVE_SDL_AUDIO TRUE)
   1.168 -    endif(HAVE_SNDIO_H AND D_SNDIO_LIB)
   1.169 -  endif(SNDIO)
   1.170 -endmacro(CheckSNDIO)
   1.171 +    endif()
   1.172 +  endif()
   1.173 +endmacro()
   1.174  
   1.175  # Requires:
   1.176  # - PkgCheckModules
   1.177 @@ -304,14 +304,14 @@
   1.178            FindLibraryAndSONAME("fusionsound")
   1.179            set(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "\"${FUSIONSOUND_LIB_SONAME}\"")
   1.180            set(HAVE_FUSIONSOUND_SHARED TRUE)
   1.181 -        endif(NOT HAVE_DLOPEN)
   1.182 -      else(FUSIONSOUND_SHARED)
   1.183 +        endif()
   1.184 +      else()
   1.185          list(APPEND EXTRA_LDFLAGS ${PKG_FUSIONSOUND_LDFLAGS})
   1.186 -      endif(FUSIONSOUND_SHARED)
   1.187 +      endif()
   1.188        set(HAVE_SDL_AUDIO TRUE)
   1.189 -    endif(PKG_FUSIONSOUND_FOUND)
   1.190 -  endif(FUSIONSOUND)
   1.191 -endmacro(CheckFusionSound)
   1.192 +    endif()
   1.193 +  endif()
   1.194 +endmacro()
   1.195  
   1.196  # Requires:
   1.197  # - n/a
   1.198 @@ -353,34 +353,34 @@
   1.199  
   1.200        if(APPLE)
   1.201          set(X11_SHARED OFF)
   1.202 -      endif(APPLE)
   1.203 +      endif()
   1.204  
   1.205        check_function_exists("shmat" HAVE_SHMAT)
   1.206        if(NOT HAVE_SHMAT)
   1.207          check_library_exists(ipc shmat "" HAVE_SHMAT)
   1.208          if(HAVE_SHMAT)
   1.209            list(APPEND EXTRA_LIBS ipc)
   1.210 -        endif(HAVE_SHMAT)
   1.211 +        endif()
   1.212          if(NOT HAVE_SHMAT)
   1.213            add_definitions(-DNO_SHARED_MEMORY)
   1.214            set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY")
   1.215 -        endif(NOT HAVE_SHMAT)
   1.216 -      endif(NOT HAVE_SHMAT)
   1.217 +        endif()
   1.218 +      endif()
   1.219  
   1.220        if(X11_SHARED)
   1.221          if(NOT HAVE_DLOPEN)
   1.222            message_warn("You must have SDL_LoadObject() support for dynamic X11 loading")
   1.223            set(HAVE_X11_SHARED FALSE)
   1.224 -        else(NOT HAVE_DLOPEN)
   1.225 +        else()
   1.226            set(HAVE_X11_SHARED TRUE)
   1.227          endif()
   1.228          if(HAVE_X11_SHARED)
   1.229            set(SDL_VIDEO_DRIVER_X11_DYNAMIC "\"${X11_LIB_SONAME}\"")
   1.230            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "\"${XEXT_LIB_SONAME}\"")
   1.231 -        else(HAVE_X11_SHARED)
   1.232 +        else()
   1.233            list(APPEND EXTRA_LIBS ${X11_LIB} ${XEXT_LIB})
   1.234 -        endif(HAVE_X11_SHARED)
   1.235 -      endif(X11_SHARED)
   1.236 +        endif()
   1.237 +      endif()
   1.238  
   1.239        set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}")
   1.240  
   1.241 @@ -394,7 +394,7 @@
   1.242            int main(int argc, char **argv) {}" HAVE_CONST_XEXT_ADDDISPLAY)
   1.243        if(HAVE_CONST_XEXT_ADDDISPLAY)
   1.244          set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1)
   1.245 -      endif(HAVE_CONST_XEXT_ADDDISPLAY)
   1.246 +      endif()
   1.247  
   1.248        check_c_source_compiles("
   1.249            #include <X11/Xlib.h>
   1.250 @@ -407,7 +407,7 @@
   1.251              XFreeEventData(display, cookie); }" HAVE_XGENERICEVENT)
   1.252        if(HAVE_XGENERICEVENT)
   1.253          set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1)
   1.254 -      endif(HAVE_XGENERICEVENT)
   1.255 +      endif()
   1.256  
   1.257        check_c_source_compiles("
   1.258            #include <X11/Xlibint.h>
   1.259 @@ -415,7 +415,7 @@
   1.260            int main(int argc, char **argv) {}" HAVE_CONST_XDATA32)
   1.261        if(HAVE_CONST_XDATA32)
   1.262          set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1)
   1.263 -      endif(HAVE_CONST_XDATA32)
   1.264 +      endif()
   1.265  
   1.266        check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM)
   1.267  
   1.268 @@ -423,29 +423,29 @@
   1.269          set(HAVE_VIDEO_X11_XCURSOR TRUE)
   1.270          if(HAVE_X11_SHARED AND XCURSOR_LIB)
   1.271            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB_SONAME}\"")
   1.272 -        else(HAVE_X11_SHARED AND XCURSOR_LIB)
   1.273 +        else()
   1.274            list(APPEND EXTRA_LIBS ${XCURSOR_LIB})
   1.275 -        endif(HAVE_X11_SHARED AND XCURSOR_LIB)
   1.276 +        endif()
   1.277          set(SDL_VIDEO_DRIVER_X11_XCURSOR 1)
   1.278 -      endif(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H)
   1.279 +      endif()
   1.280  
   1.281        if(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H)
   1.282          set(HAVE_VIDEO_X11_XINERAMA TRUE)
   1.283          if(HAVE_X11_SHARED AND XINERAMA_LIB)
   1.284            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "\"${XINERAMA_LIB_SONAME}\"")
   1.285 -        else(HAVE_X11_SHARED AND XINERAMA_LIB)
   1.286 +        else()
   1.287            list(APPEND EXTRA_LIBS ${XINERAMA_LIB})
   1.288 -        endif(HAVE_X11_SHARED AND XINERAMA_LIB)
   1.289 +        endif()
   1.290          set(SDL_VIDEO_DRIVER_X11_XINERAMA 1)
   1.291 -      endif(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H)
   1.292 +      endif()
   1.293  
   1.294        if(VIDEO_X11_XINPUT AND HAVE_XINPUT_H)
   1.295          set(HAVE_VIDEO_X11_XINPUT TRUE)
   1.296          if(HAVE_X11_SHARED AND XI_LIB)
   1.297            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB_SONAME}\"")
   1.298 -        else(HAVE_X11_SHARED AND XI_LIB)
   1.299 +        else()
   1.300            list(APPEND EXTRA_LIBS ${XI_LIB})
   1.301 -        endif(HAVE_X11_SHARED AND XI_LIB)
   1.302 +        endif()
   1.303          set(SDL_VIDEO_DRIVER_X11_XINPUT2 1)
   1.304  
   1.305          # Check for multitouch
   1.306 @@ -462,48 +462,48 @@
   1.307              int main(int argc, char **argv) {}" HAVE_XINPUT2_MULTITOUCH)
   1.308          if(HAVE_XINPUT2_MULTITOUCH)
   1.309            set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1)
   1.310 -        endif(HAVE_XINPUT2_MULTITOUCH)
   1.311 -      endif(VIDEO_X11_XINPUT AND HAVE_XINPUT_H)
   1.312 +        endif()
   1.313 +      endif()
   1.314  
   1.315        if(VIDEO_X11_XRANDR AND HAVE_XRANDR_H)
   1.316          if(HAVE_X11_SHARED AND XRANDR_LIB)
   1.317            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB_SONAME}\"")
   1.318 -        else(HAVE_X11_SHARED AND XRANDR_LIB)
   1.319 +        else()
   1.320            list(APPEND EXTRA_LIBS ${XRANDR_LIB})
   1.321 -        endif(HAVE_X11_SHARED AND XRANDR_LIB)
   1.322 +        endif()
   1.323          set(SDL_VIDEO_DRIVER_X11_XRANDR 1)
   1.324          set(HAVE_VIDEO_X11_XRANDR TRUE)
   1.325 -      endif(VIDEO_X11_XRANDR AND HAVE_XRANDR_H)
   1.326 +      endif()
   1.327  
   1.328        if(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H)
   1.329          if(HAVE_X11_SHARED AND XSS_LIB)
   1.330            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB_SONAME}\"")
   1.331 -        else(HAVE_X11_SHARED AND XSS_LIB)
   1.332 +        else()
   1.333            list(APPEND EXTRA_LIBS ${XSS_LIB})
   1.334 -        endif(HAVE_X11_SHARED AND XSS_LIB)
   1.335 +        endif()
   1.336          set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1)
   1.337          set(HAVE_VIDEO_X11_XSCRNSAVER TRUE)
   1.338 -      endif(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H)
   1.339 +      endif()
   1.340  
   1.341        if(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H)
   1.342          set(SDL_VIDEO_DRIVER_X11_XSHAPE 1)
   1.343          set(HAVE_VIDEO_X11_XSHAPE TRUE)
   1.344 -      endif(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H)
   1.345 +      endif()
   1.346  
   1.347        if(VIDEO_X11_XVM AND HAVE_XF86VM_H)
   1.348          if(HAVE_X11_SHARED AND XXF86VM_LIB)
   1.349            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "\"${XXF86VM_LIB_SONAME}\"")
   1.350 -        else(HAVE_X11_SHARED AND XXF86VM_LIB)
   1.351 +        else()
   1.352            list(APPEND EXTRA_LIBS ${XXF86VM_LIB})
   1.353 -        endif(HAVE_X11_SHARED AND XXF86VM_LIB)
   1.354 +        endif()
   1.355          set(SDL_VIDEO_DRIVER_X11_XVIDMODE 1)
   1.356          set(HAVE_VIDEO_X11_XVM TRUE)
   1.357 -      endif(VIDEO_X11_XVM AND HAVE_XF86VM_H)
   1.358 +      endif()
   1.359  
   1.360        set(CMAKE_REQUIRED_LIBRARIES)
   1.361 -    endif(X11_LIB)
   1.362 -  endif(VIDEO_X11)
   1.363 -endmacro(CheckX11)
   1.364 +    endif()
   1.365 +  endif()
   1.366 +endmacro()
   1.367  
   1.368  macro(CheckMir)
   1.369  # !!! FIXME: hook up dynamic loading here.
   1.370 @@ -524,8 +524,8 @@
   1.371              list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CLFAGS} ${XKB_CLFLAGS})
   1.372              list(APPEND EXTRA_LDFLAGS ${MIR_TOOLKIT_LDFLAGS} ${EGL_LDLAGS} ${XKB_LDLAGS})
   1.373          endif (MIR_LIB AND MIR_TOOLKIT_FOUND AND EGL_FOUND AND XKB_FOUND)
   1.374 -    endif(VIDEO_MIR)
   1.375 -endmacro(CheckMir)
   1.376 +    endif()
   1.377 +endmacro()
   1.378  
   1.379  # Requires:
   1.380  # - EGL
   1.381 @@ -547,9 +547,9 @@
   1.382        file(GLOB WAYLAND_SOURCES ${SDL2_SOURCE_DIR}/src/video/wayland/*.c)
   1.383        set(SOURCE_FILES ${SOURCE_FILES} ${WAYLAND_SOURCES})
   1.384        set(SDL_VIDEO_DRIVER_WAYLAND 1)
   1.385 -    endif(WAYLAND_FOUND)
   1.386 -  endif(VIDEO_WAYLAND)
   1.387 -endmacro(CheckWayland)
   1.388 +    endif()
   1.389 +  endif()
   1.390 +endmacro()
   1.391  
   1.392  # Requires:
   1.393  # - n/a
   1.394 @@ -558,16 +558,16 @@
   1.395    if(VIDEO_COCOA)
   1.396      if(APPLE) # Apple always has Cocoa.
   1.397        set(HAVE_VIDEO_COCOA TRUE)
   1.398 -    endif(APPLE)
   1.399 +    endif()
   1.400      if(HAVE_VIDEO_COCOA)
   1.401        file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m)
   1.402        set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C)
   1.403        set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES})
   1.404        set(SDL_VIDEO_DRIVER_COCOA 1)
   1.405        set(HAVE_SDL_VIDEO TRUE)
   1.406 -    endif(HAVE_VIDEO_COCOA)
   1.407 -  endif(VIDEO_COCOA)
   1.408 -endmacro(CheckCOCOA)
   1.409 +    endif()
   1.410 +  endif()
   1.411 +endmacro()
   1.412  
   1.413  # Requires:
   1.414  # - PkgCheckModules
   1.415 @@ -591,14 +591,14 @@
   1.416            FindLibraryAndSONAME("directfb")
   1.417            set(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC "\"${DIRECTFB_LIB_SONAME}\"")
   1.418            set(HAVE_DIRECTFB_SHARED TRUE)
   1.419 -        endif(NOT HAVE_DLOPEN)
   1.420 -      else(DIRECTFB_SHARED)
   1.421 +        endif()
   1.422 +      else()
   1.423          list(APPEND EXTRA_LDFLAGS ${PKG_DIRECTFB_LDFLAGS})
   1.424 -      endif(DIRECTFB_SHARED)
   1.425 +      endif()
   1.426        set(HAVE_SDL_VIDEO TRUE)
   1.427 -    endif(PKG_DIRECTFB_FOUND)
   1.428 -  endif(VIDEO_DIRECTFB)
   1.429 -endmacro(CheckDirectFB)
   1.430 +    endif()
   1.431 +  endif()
   1.432 +endmacro()
   1.433  
   1.434  # Requires:
   1.435  # - n/a
   1.436 @@ -645,9 +645,9 @@
   1.437        set(SDL_VIDEO_OPENGL_GLX 1)
   1.438        set(SDL_VIDEO_RENDER_OGL 1)
   1.439        list(APPEND EXTRA_LIBS GL)
   1.440 -    endif(HAVE_VIDEO_OPENGL)
   1.441 -  endif(VIDEO_OPENGL)
   1.442 -endmacro(CheckOpenGLX11)
   1.443 +    endif()
   1.444 +  endif()
   1.445 +endmacro()
   1.446  
   1.447  # Requires:
   1.448  # - nada
   1.449 @@ -659,7 +659,7 @@
   1.450          int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL)
   1.451      if(HAVE_VIDEO_OPENGL_EGL)
   1.452          set(SDL_VIDEO_OPENGL_EGL 1)
   1.453 -    endif(HAVE_VIDEO_OPENGL_EGL) 
   1.454 +    endif()
   1.455      check_c_source_compiles("
   1.456        #include <GLES/gl.h>
   1.457        #include <GLES/glext.h>
   1.458 @@ -668,7 +668,7 @@
   1.459          set(HAVE_VIDEO_OPENGLES TRUE)
   1.460          set(SDL_VIDEO_OPENGL_ES 1)
   1.461          set(SDL_VIDEO_RENDER_OGL_ES 1)
   1.462 -    endif(HAVE_VIDEO_OPENGLES_V1)
   1.463 +    endif()
   1.464      check_c_source_compiles("
   1.465        #include <GLES2/gl2.h>
   1.466        #include <GLES2/gl2ext.h>
   1.467 @@ -677,10 +677,10 @@
   1.468          set(HAVE_VIDEO_OPENGLES TRUE)
   1.469          set(SDL_VIDEO_OPENGL_ES2 1)
   1.470          set(SDL_VIDEO_RENDER_OGL_ES2 1)
   1.471 -    endif(HAVE_VIDEO_OPENGLES_V2)
   1.472 +    endif()
   1.473  
   1.474 -  endif(VIDEO_OPENGLES)
   1.475 -endmacro(CheckOpenGLESX11)
   1.476 +  endif()
   1.477 +endmacro()
   1.478  
   1.479  # Rquires:
   1.480  # - nada
   1.481 @@ -729,7 +729,7 @@
   1.482      else()
   1.483        set(PTHREAD_CFLAGS "-D_REENTRANT")
   1.484        set(PTHREAD_LDFLAGS "-lpthread")
   1.485 -    endif(LINUX)
   1.486 +    endif()
   1.487  
   1.488      # Run some tests
   1.489      set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}")
   1.490 @@ -756,7 +756,7 @@
   1.491          }" HAVE_RECURSIVE_MUTEXES)
   1.492        if(HAVE_RECURSIVE_MUTEXES)
   1.493          set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1)
   1.494 -      else(HAVE_RECURSIVE_MUTEXES)
   1.495 +      else()
   1.496          check_c_source_compiles("
   1.497              #include <pthread.h>
   1.498              int main(int argc, char **argv) {
   1.499 @@ -766,8 +766,8 @@
   1.500              }" HAVE_RECURSIVE_MUTEXES_NP)
   1.501          if(HAVE_RECURSIVE_MUTEXES_NP)
   1.502            set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1)
   1.503 -        endif(HAVE_RECURSIVE_MUTEXES_NP)
   1.504 -      endif(HAVE_RECURSIVE_MUTEXES)
   1.505 +        endif()
   1.506 +      endif()
   1.507  
   1.508        if(PTHREADS_SEM)
   1.509          check_c_source_compiles("#include <pthread.h>
   1.510 @@ -781,8 +781,8 @@
   1.511                    sem_timedwait(NULL, NULL);
   1.512                    return 0;
   1.513                }" HAVE_SEM_TIMEDWAIT)
   1.514 -        endif(HAVE_PTHREADS_SEM)
   1.515 -      endif(PTHREADS_SEM)
   1.516 +        endif()
   1.517 +      endif()
   1.518  
   1.519        check_c_source_compiles("
   1.520            #include <pthread.h>
   1.521 @@ -801,14 +801,14 @@
   1.522        if(HAVE_PTHREADS_SEM)
   1.523          set(SOURCE_FILES ${SOURCE_FILES}
   1.524              ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syssem.c)
   1.525 -      else(HAVE_PTHREADS_SEM)
   1.526 +      else()
   1.527          set(SOURCE_FILES ${SOURCE_FILES}
   1.528              ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syssem.c)
   1.529 -      endif(HAVE_PTHREADS_SEM)
   1.530 +      endif()
   1.531        set(HAVE_SDL_THREADS TRUE)
   1.532 -    endif(HAVE_PTHREADS)
   1.533 -  endif(PTHREADS)
   1.534 -endmacro(CheckPTHREAD)
   1.535 +    endif()
   1.536 +  endif()
   1.537 +endmacro()
   1.538  
   1.539  # Requires
   1.540  # - nada
   1.541 @@ -822,27 +822,27 @@
   1.542      check_include_file(usbhid.h HAVE_USBHID_H)
   1.543      if(HAVE_USBHID_H)
   1.544        set(USB_CFLAGS "-DHAVE_USBHID_H")
   1.545 -    endif(HAVE_USBHID_H)
   1.546 +    endif()
   1.547  
   1.548      check_include_file(libusbhid.h HAVE_LIBUSBHID_H)
   1.549      if(HAVE_LIBUSBHID_H)
   1.550        set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSBHID_H")
   1.551 -    endif(HAVE_LIBUSBHID_H)
   1.552 +    endif()
   1.553      set(USB_LIBS ${USB_LIBS} usbhid)
   1.554 -  else(LIBUSBHID)
   1.555 +  else()
   1.556      check_include_file(usb.h HAVE_USB_H)
   1.557      if(HAVE_USB_H)
   1.558        set(USB_CFLAGS "-DHAVE_USB_H")
   1.559 -    endif(HAVE_USB_H)
   1.560 +    endif()
   1.561      check_include_file(libusb.h HAVE_LIBUSB_H)
   1.562      if(HAVE_LIBUSB_H)
   1.563        set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSB_H")
   1.564 -    endif(HAVE_LIBUSB_H)
   1.565 +    endif()
   1.566      check_library_exists(usb hid_init "" LIBUSB)
   1.567      if(LIBUSB)
   1.568        set(USB_LIBS ${USB_LIBS} usb)
   1.569 -    endif(LIBUSB)
   1.570 -  endif(LIBUSBHID)
   1.571 +    endif()
   1.572 +  endif()
   1.573  
   1.574    set(CMAKE_REQUIRED_FLAGS "${USB_CFLAGS}")
   1.575    set(CMAKE_REQUIRED_LIBRARIES "${USB_LIBS}")
   1.576 @@ -898,7 +898,7 @@
   1.577            }" HAVE_USBHID_UCR_DATA)
   1.578      if(HAVE_USBHID_UCR_DATA)
   1.579        set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_UCR_DATA")
   1.580 -    endif(HAVE_USBHID_UCR_DATA)
   1.581 +    endif()
   1.582  
   1.583      check_c_source_compiles("
   1.584            #include <sys/types.h>
   1.585 @@ -926,7 +926,7 @@
   1.586            }" HAVE_USBHID_NEW)
   1.587      if(HAVE_USBHID_NEW)
   1.588        set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_NEW")
   1.589 -    endif(HAVE_USBHID_NEW)
   1.590 +    endif()
   1.591  
   1.592      check_c_source_compiles("
   1.593          #include <machine/joystick.h>
   1.594 @@ -936,7 +936,7 @@
   1.595          }" HAVE_MACHINE_JOYSTICK)
   1.596      if(HAVE_MACHINE_JOYSTICK)
   1.597        set(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1)
   1.598 -    endif(HAVE_MACHINE_JOYSTICK)
   1.599 +    endif()
   1.600      set(SDL_JOYSTICK_USBHID 1)
   1.601      file(GLOB BSD_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/bsd/*.c)
   1.602      set(SOURCE_FILES ${SOURCE_FILES} ${BSD_JOYSTICK_SOURCES})
   1.603 @@ -946,8 +946,8 @@
   1.604  
   1.605      set(CMAKE_REQUIRED_LIBRARIES)
   1.606      set(CMAKE_REQUIRED_FLAGS)
   1.607 -  endif(HAVE_USBHID)
   1.608 -endmacro(CheckUSBHID)
   1.609 +  endif()
   1.610 +endmacro()
   1.611  
   1.612  # Requires:
   1.613  # - n/a