CMake: Replace "else(condition)" with "else()", etc.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 13 Dec 2014 02:33:52 -0500
changeset 9277f0bd40782fc7
parent 9276 2b2cfda26085
child 9278 8900afb78a19
CMake: Replace "else(condition)" with "else()", etc.

Bumped required CMake version to 2.8.

Thanks to the SDL/Emscripten porting team for this cleanup.
CMakeLists.txt
cmake/sdlchecks.cmake
     1.1 --- a/CMakeLists.txt	Sat Dec 13 13:20:19 2014 -0800
     1.2 +++ b/CMakeLists.txt	Sat Dec 13 02:33:52 2014 -0500
     1.3 @@ -2,7 +2,7 @@
     1.4    message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there")
     1.5  endif()
     1.6  
     1.7 -cmake_minimum_required(VERSION 2.6)
     1.8 +cmake_minimum_required(VERSION 2.8)
     1.9  project(SDL2 C)
    1.10  include(CheckFunctionExists)
    1.11  include(CheckLibraryExists)
    1.12 @@ -144,7 +144,7 @@
    1.13    if(USE_GCC OR USE_CLANG)
    1.14      set(CMAKE_C_FLAGS "-g -O3")
    1.15    endif()
    1.16 -else("$ENV{CFLAGS}" STREQUAL "")
    1.17 +else()
    1.18    set(CMAKE_C_FLAGS "$ENV{CFLAGS}")
    1.19    list(APPEND EXTRA_CFLAGS "$ENV{CFLAGS}")
    1.20  endif()
    1.21 @@ -161,7 +161,7 @@
    1.22        if(${flag_var} MATCHES "/MD")
    1.23          string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
    1.24        endif()
    1.25 -    endforeach(flag_var)
    1.26 +    endforeach()
    1.27    endif()
    1.28  endif()
    1.29  
    1.30 @@ -486,7 +486,7 @@
    1.31      set(SDL_ASSEMBLY_ROUTINES 1)
    1.32    endif()
    1.33  # TODO:
    1.34 -#else(ASSEMBLY)
    1.35 +#else()
    1.36  #  if(USE_GCC OR USE_CLANG)
    1.37  #    list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx")
    1.38  #  endif()
    1.39 @@ -518,7 +518,7 @@
    1.40      set(HAVE_M_PI 1)
    1.41      add_definitions(-D_USE_MATH_DEFINES) # needed for M_PI
    1.42      set(STDC_HEADERS 1)
    1.43 -  else(WINDOWS AND NOT MINGW)
    1.44 +  else()
    1.45      set(HAVE_LIBC TRUE)
    1.46      check_include_file(sys/types.h HAVE_SYS_TYPES_H)
    1.47      foreach(_HEADER
    1.48 @@ -571,7 +571,7 @@
    1.49  
    1.50      check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION)
    1.51    endif()
    1.52 -else(LIBC)
    1.53 +else()
    1.54    if(WINDOWS)
    1.55      set(HAVE_STDARG_H 1)
    1.56      set(HAVE_STDDEF_H 1)
    1.57 @@ -752,7 +752,7 @@
    1.58      if(FOUND_CLOCK_GETTIME)
    1.59        list(APPEND EXTRA_LIBS rt)
    1.60        set(HAVE_CLOCK_GETTIME 1)
    1.61 -    else(FOUND_CLOCK_GETTIME)
    1.62 +    else()
    1.63        check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME)
    1.64        if(FOUND_CLOCK_GETTIME)
    1.65          set(HAVE_CLOCK_GETTIME 1)
    1.66 @@ -1193,14 +1193,14 @@
    1.67    if(SDL_STATIC)
    1.68      set(ENABLE_STATIC_TRUE "")
    1.69      set(ENABLE_STATIC_FALSE "#")
    1.70 -  else(SDL_STATIC)
    1.71 +  else()
    1.72      set(ENABLE_STATIC_TRUE "#")
    1.73      set(ENABLE_STATIC_FALSE "")
    1.74    endif()
    1.75    if(SDL_SHARED)
    1.76      set(ENABLE_SHARED_TRUE "")
    1.77      set(ENABLE_SHARED_FALSE "#")
    1.78 -  else(SDL_SHARED)
    1.79 +  else()
    1.80      set(ENABLE_SHARED_TRUE "#")
    1.81      set(ENABLE_SHARED_FALSE "")
    1.82    endif()
    1.83 @@ -1281,7 +1281,7 @@
    1.84        VERSION ${LT_VERSION}
    1.85        SOVERSION ${LT_REVISION}
    1.86        OUTPUT_NAME "SDL2-${LT_RELEASE}")
    1.87 -  else(UNIX)
    1.88 +  else()
    1.89      set_target_properties(SDL2 PROPERTIES
    1.90        VERSION ${SDL_VERSION}
    1.91        SOVERSION ${LT_REVISION}
    1.92 @@ -1330,7 +1330,7 @@
    1.93    if(FREEBSD)
    1.94      # FreeBSD uses ${PREFIX}/libdata/pkgconfig
    1.95      install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig")
    1.96 -  else(FREEBSD)
    1.97 +  else()
    1.98      install(FILES ${SDL2_BINARY_DIR}/sdl2.pc
    1.99        DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
   1.100    endif()
     2.1 --- a/cmake/sdlchecks.cmake	Sat Dec 13 13:20:19 2014 -0800
     2.2 +++ b/cmake/sdlchecks.cmake	Sat Dec 13 02:33:52 2014 -0500
     2.3 @@ -39,7 +39,7 @@
     2.4          set(_DLLIB ${_LIBNAME})
     2.5          set(HAVE_DLOPEN TRUE)
     2.6          break()
     2.7 -      endif(DLOPEN_LIB)
     2.8 +      endif()
     2.9      endforeach()
    2.10    endif()
    2.11  
    2.12 @@ -63,7 +63,7 @@
    2.13      set(SOURCE_FILES ${SOURCE_FILES} ${DLOPEN_SOURCES})
    2.14      set(HAVE_SDL_LOADSO TRUE)
    2.15    endif()
    2.16 -endmacro(CheckDLOPEN)
    2.17 +endmacro()
    2.18  
    2.19  # Requires:
    2.20  # - n/a
    2.21 @@ -78,23 +78,23 @@
    2.22        check_c_source_compiles("
    2.23            #include <soundcard.h>
    2.24            int main() { int arg = SNDCTL_DSP_SETFRAGMENT; }" OSS_FOUND)
    2.25 -    endif(NOT OSS_FOUND)
    2.26 +    endif()
    2.27  
    2.28      if(OSS_FOUND)
    2.29        set(HAVE_OSS TRUE)
    2.30        file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c)
    2.31        if(OSS_HEADER_FILE STREQUAL "soundcard.h")
    2.32          set(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1)
    2.33 -      endif(OSS_HEADER_FILE STREQUAL "soundcard.h")
    2.34 +      endif()
    2.35        set(SDL_AUDIO_DRIVER_OSS 1)
    2.36        set(SOURCE_FILES ${SOURCE_FILES} ${OSS_SOURCES})
    2.37        if(NETBSD OR OPENBSD)
    2.38          list(APPEND EXTRA_LIBS ossaudio)
    2.39 -      endif(NETBSD OR OPENBSD)
    2.40 +      endif()
    2.41        set(HAVE_SDL_AUDIO TRUE)
    2.42 -    endif(OSS_FOUND)
    2.43 -  endif(OSS)
    2.44 -endmacro(CheckOSS)
    2.45 +    endif()
    2.46 +  endif()
    2.47 +endmacro()
    2.48  
    2.49  # Requires:
    2.50  # - n/a
    2.51 @@ -117,14 +117,14 @@
    2.52            FindLibraryAndSONAME("asound")
    2.53            set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${ASOUND_LIB_SONAME}\"")
    2.54            set(HAVE_ALSA_SHARED TRUE)
    2.55 -        endif(NOT HAVE_DLOPEN)
    2.56 -      else(ALSA_SHARED)
    2.57 +        endif()
    2.58 +      else()
    2.59          list(APPEND EXTRA_LIBS asound)
    2.60 -      endif(ALSA_SHARED)
    2.61 +      endif()
    2.62        set(HAVE_SDL_AUDIO TRUE)
    2.63 -    endif(HAVE_ASOUNDLIB_H)
    2.64 -  endif(ALSA)
    2.65 -endmacro(CheckALSA)
    2.66 +    endif()
    2.67 +  endif()
    2.68 +endmacro()
    2.69  
    2.70  # Requires:
    2.71  # - PkgCheckModules
    2.72 @@ -147,14 +147,14 @@
    2.73            FindLibraryAndSONAME("pulse-simple")
    2.74            set(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "\"${PULSE_SIMPLE_LIB_SONAME}\"")
    2.75            set(HAVE_PULSEAUDIO_SHARED TRUE)
    2.76 -        endif(NOT HAVE_DLOPEN)
    2.77 -      else(PULSEAUDIO_SHARED)
    2.78 +        endif()
    2.79 +      else()
    2.80          list(APPEND EXTRA_LDFLAGS ${PKG_PULSEAUDIO_LDFLAGS})
    2.81 -      endif(PULSEAUDIO_SHARED)
    2.82 +      endif()
    2.83        set(HAVE_SDL_AUDIO TRUE)
    2.84 -    endif(PKG_PULSEAUDIO_FOUND)
    2.85 -  endif(PULSEAUDIO)
    2.86 -endmacro(CheckPulseAudio)
    2.87 +    endif()
    2.88 +  endif()
    2.89 +endmacro()
    2.90  
    2.91  # Requires:
    2.92  # - PkgCheckModules
    2.93 @@ -177,14 +177,14 @@
    2.94            FindLibraryAndSONAME(esd)
    2.95            set(SDL_AUDIO_DRIVER_ESD_DYNAMIC "\"${ESD_LIB_SONAME}\"")
    2.96            set(HAVE_ESD_SHARED TRUE)
    2.97 -        endif(NOT HAVE_DLOPEN)
    2.98 -      else(ESD_SHARED)
    2.99 +        endif()
   2.100 +      else()
   2.101          list(APPEND EXTRA_LDFLAGS ${PKG_ESD_LDFLAGS})
   2.102 -      endif(ESD_SHARED)
   2.103 +      endif()
   2.104        set(HAVE_SDL_AUDIO TRUE)
   2.105 -    endif(PKG_ESD_FOUND)
   2.106 -  endif(ESD)
   2.107 -endmacro(CheckESD)
   2.108 +    endif()
   2.109 +  endif()
   2.110 +endmacro()
   2.111  
   2.112  # Requires:
   2.113  # - n/a
   2.114 @@ -212,14 +212,14 @@
   2.115            FindLibraryAndSONAME(artsc)
   2.116            set(SDL_AUDIO_DRIVER_ARTS_DYNAMIC "\"${ARTSC_LIB_SONAME}\"")
   2.117            set(HAVE_ARTS_SHARED TRUE)
   2.118 -        endif(NOT HAVE_DLOPEN)
   2.119 -      else(ARTS_SHARED)
   2.120 +        endif()
   2.121 +      else()
   2.122          list(APPEND EXTRA_LDFLAGS ${ARTS_LIBS})
   2.123 -      endif(ARTS_SHARED)
   2.124 +      endif()
   2.125        set(HAVE_SDL_AUDIO TRUE)
   2.126 -    endif(ARTS_CONFIG)
   2.127 -  endif(ARTS)
   2.128 -endmacro(CheckARTS)
   2.129 +    endif()
   2.130 +  endif()
   2.131 +endmacro()
   2.132  
   2.133  # Requires:
   2.134  # - n/a
   2.135 @@ -243,14 +243,14 @@
   2.136            FindLibraryAndSONAME("audio")
   2.137            set(SDL_AUDIO_DRIVER_NAS_DYNAMIC "\"${AUDIO_LIB_SONAME}\"")
   2.138            set(HAVE_NAS_SHARED TRUE)
   2.139 -        endif(NOT HAVE_DLOPEN)
   2.140 -      else(NAS_SHARED)
   2.141 +        endif()
   2.142 +      else()
   2.143          list(APPEND EXTRA_LIBS ${D_NAS_LIB})
   2.144 -      endif(NAS_SHARED)
   2.145 +      endif()
   2.146        set(HAVE_SDL_AUDIO TRUE)
   2.147 -    endif(HAVE_NAS_H AND D_NAS_LIB)
   2.148 -  endif(NAS)
   2.149 -endmacro(CheckNAS)
   2.150 +    endif()
   2.151 +  endif()
   2.152 +endmacro()
   2.153  
   2.154  # Requires:
   2.155  # - n/a
   2.156 @@ -274,14 +274,14 @@
   2.157            FindLibraryAndSONAME("sndio")
   2.158            set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${SNDIO_LIB_SONAME}\"")
   2.159            set(HAVE_SNDIO_SHARED TRUE)
   2.160 -        endif(NOT HAVE_DLOPEN)
   2.161 -      else(SNDIO_SHARED)
   2.162 +        endif()
   2.163 +      else()
   2.164          list(APPEND EXTRA_LIBS ${D_SNDIO_LIB})
   2.165 -      endif(SNDIO_SHARED)
   2.166 +      endif()
   2.167        set(HAVE_SDL_AUDIO TRUE)
   2.168 -    endif(HAVE_SNDIO_H AND D_SNDIO_LIB)
   2.169 -  endif(SNDIO)
   2.170 -endmacro(CheckSNDIO)
   2.171 +    endif()
   2.172 +  endif()
   2.173 +endmacro()
   2.174  
   2.175  # Requires:
   2.176  # - PkgCheckModules
   2.177 @@ -304,14 +304,14 @@
   2.178            FindLibraryAndSONAME("fusionsound")
   2.179            set(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "\"${FUSIONSOUND_LIB_SONAME}\"")
   2.180            set(HAVE_FUSIONSOUND_SHARED TRUE)
   2.181 -        endif(NOT HAVE_DLOPEN)
   2.182 -      else(FUSIONSOUND_SHARED)
   2.183 +        endif()
   2.184 +      else()
   2.185          list(APPEND EXTRA_LDFLAGS ${PKG_FUSIONSOUND_LDFLAGS})
   2.186 -      endif(FUSIONSOUND_SHARED)
   2.187 +      endif()
   2.188        set(HAVE_SDL_AUDIO TRUE)
   2.189 -    endif(PKG_FUSIONSOUND_FOUND)
   2.190 -  endif(FUSIONSOUND)
   2.191 -endmacro(CheckFusionSound)
   2.192 +    endif()
   2.193 +  endif()
   2.194 +endmacro()
   2.195  
   2.196  # Requires:
   2.197  # - n/a
   2.198 @@ -353,34 +353,34 @@
   2.199  
   2.200        if(APPLE)
   2.201          set(X11_SHARED OFF)
   2.202 -      endif(APPLE)
   2.203 +      endif()
   2.204  
   2.205        check_function_exists("shmat" HAVE_SHMAT)
   2.206        if(NOT HAVE_SHMAT)
   2.207          check_library_exists(ipc shmat "" HAVE_SHMAT)
   2.208          if(HAVE_SHMAT)
   2.209            list(APPEND EXTRA_LIBS ipc)
   2.210 -        endif(HAVE_SHMAT)
   2.211 +        endif()
   2.212          if(NOT HAVE_SHMAT)
   2.213            add_definitions(-DNO_SHARED_MEMORY)
   2.214            set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY")
   2.215 -        endif(NOT HAVE_SHMAT)
   2.216 -      endif(NOT HAVE_SHMAT)
   2.217 +        endif()
   2.218 +      endif()
   2.219  
   2.220        if(X11_SHARED)
   2.221          if(NOT HAVE_DLOPEN)
   2.222            message_warn("You must have SDL_LoadObject() support for dynamic X11 loading")
   2.223            set(HAVE_X11_SHARED FALSE)
   2.224 -        else(NOT HAVE_DLOPEN)
   2.225 +        else()
   2.226            set(HAVE_X11_SHARED TRUE)
   2.227          endif()
   2.228          if(HAVE_X11_SHARED)
   2.229            set(SDL_VIDEO_DRIVER_X11_DYNAMIC "\"${X11_LIB_SONAME}\"")
   2.230            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "\"${XEXT_LIB_SONAME}\"")
   2.231 -        else(HAVE_X11_SHARED)
   2.232 +        else()
   2.233            list(APPEND EXTRA_LIBS ${X11_LIB} ${XEXT_LIB})
   2.234 -        endif(HAVE_X11_SHARED)
   2.235 -      endif(X11_SHARED)
   2.236 +        endif()
   2.237 +      endif()
   2.238  
   2.239        set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}")
   2.240  
   2.241 @@ -394,7 +394,7 @@
   2.242            int main(int argc, char **argv) {}" HAVE_CONST_XEXT_ADDDISPLAY)
   2.243        if(HAVE_CONST_XEXT_ADDDISPLAY)
   2.244          set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1)
   2.245 -      endif(HAVE_CONST_XEXT_ADDDISPLAY)
   2.246 +      endif()
   2.247  
   2.248        check_c_source_compiles("
   2.249            #include <X11/Xlib.h>
   2.250 @@ -407,7 +407,7 @@
   2.251              XFreeEventData(display, cookie); }" HAVE_XGENERICEVENT)
   2.252        if(HAVE_XGENERICEVENT)
   2.253          set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1)
   2.254 -      endif(HAVE_XGENERICEVENT)
   2.255 +      endif()
   2.256  
   2.257        check_c_source_compiles("
   2.258            #include <X11/Xlibint.h>
   2.259 @@ -415,7 +415,7 @@
   2.260            int main(int argc, char **argv) {}" HAVE_CONST_XDATA32)
   2.261        if(HAVE_CONST_XDATA32)
   2.262          set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1)
   2.263 -      endif(HAVE_CONST_XDATA32)
   2.264 +      endif()
   2.265  
   2.266        check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM)
   2.267  
   2.268 @@ -423,29 +423,29 @@
   2.269          set(HAVE_VIDEO_X11_XCURSOR TRUE)
   2.270          if(HAVE_X11_SHARED AND XCURSOR_LIB)
   2.271            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB_SONAME}\"")
   2.272 -        else(HAVE_X11_SHARED AND XCURSOR_LIB)
   2.273 +        else()
   2.274            list(APPEND EXTRA_LIBS ${XCURSOR_LIB})
   2.275 -        endif(HAVE_X11_SHARED AND XCURSOR_LIB)
   2.276 +        endif()
   2.277          set(SDL_VIDEO_DRIVER_X11_XCURSOR 1)
   2.278 -      endif(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H)
   2.279 +      endif()
   2.280  
   2.281        if(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H)
   2.282          set(HAVE_VIDEO_X11_XINERAMA TRUE)
   2.283          if(HAVE_X11_SHARED AND XINERAMA_LIB)
   2.284            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "\"${XINERAMA_LIB_SONAME}\"")
   2.285 -        else(HAVE_X11_SHARED AND XINERAMA_LIB)
   2.286 +        else()
   2.287            list(APPEND EXTRA_LIBS ${XINERAMA_LIB})
   2.288 -        endif(HAVE_X11_SHARED AND XINERAMA_LIB)
   2.289 +        endif()
   2.290          set(SDL_VIDEO_DRIVER_X11_XINERAMA 1)
   2.291 -      endif(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H)
   2.292 +      endif()
   2.293  
   2.294        if(VIDEO_X11_XINPUT AND HAVE_XINPUT_H)
   2.295          set(HAVE_VIDEO_X11_XINPUT TRUE)
   2.296          if(HAVE_X11_SHARED AND XI_LIB)
   2.297            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB_SONAME}\"")
   2.298 -        else(HAVE_X11_SHARED AND XI_LIB)
   2.299 +        else()
   2.300            list(APPEND EXTRA_LIBS ${XI_LIB})
   2.301 -        endif(HAVE_X11_SHARED AND XI_LIB)
   2.302 +        endif()
   2.303          set(SDL_VIDEO_DRIVER_X11_XINPUT2 1)
   2.304  
   2.305          # Check for multitouch
   2.306 @@ -462,48 +462,48 @@
   2.307              int main(int argc, char **argv) {}" HAVE_XINPUT2_MULTITOUCH)
   2.308          if(HAVE_XINPUT2_MULTITOUCH)
   2.309            set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1)
   2.310 -        endif(HAVE_XINPUT2_MULTITOUCH)
   2.311 -      endif(VIDEO_X11_XINPUT AND HAVE_XINPUT_H)
   2.312 +        endif()
   2.313 +      endif()
   2.314  
   2.315        if(VIDEO_X11_XRANDR AND HAVE_XRANDR_H)
   2.316          if(HAVE_X11_SHARED AND XRANDR_LIB)
   2.317            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB_SONAME}\"")
   2.318 -        else(HAVE_X11_SHARED AND XRANDR_LIB)
   2.319 +        else()
   2.320            list(APPEND EXTRA_LIBS ${XRANDR_LIB})
   2.321 -        endif(HAVE_X11_SHARED AND XRANDR_LIB)
   2.322 +        endif()
   2.323          set(SDL_VIDEO_DRIVER_X11_XRANDR 1)
   2.324          set(HAVE_VIDEO_X11_XRANDR TRUE)
   2.325 -      endif(VIDEO_X11_XRANDR AND HAVE_XRANDR_H)
   2.326 +      endif()
   2.327  
   2.328        if(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H)
   2.329          if(HAVE_X11_SHARED AND XSS_LIB)
   2.330            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB_SONAME}\"")
   2.331 -        else(HAVE_X11_SHARED AND XSS_LIB)
   2.332 +        else()
   2.333            list(APPEND EXTRA_LIBS ${XSS_LIB})
   2.334 -        endif(HAVE_X11_SHARED AND XSS_LIB)
   2.335 +        endif()
   2.336          set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1)
   2.337          set(HAVE_VIDEO_X11_XSCRNSAVER TRUE)
   2.338 -      endif(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H)
   2.339 +      endif()
   2.340  
   2.341        if(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H)
   2.342          set(SDL_VIDEO_DRIVER_X11_XSHAPE 1)
   2.343          set(HAVE_VIDEO_X11_XSHAPE TRUE)
   2.344 -      endif(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H)
   2.345 +      endif()
   2.346  
   2.347        if(VIDEO_X11_XVM AND HAVE_XF86VM_H)
   2.348          if(HAVE_X11_SHARED AND XXF86VM_LIB)
   2.349            set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "\"${XXF86VM_LIB_SONAME}\"")
   2.350 -        else(HAVE_X11_SHARED AND XXF86VM_LIB)
   2.351 +        else()
   2.352            list(APPEND EXTRA_LIBS ${XXF86VM_LIB})
   2.353 -        endif(HAVE_X11_SHARED AND XXF86VM_LIB)
   2.354 +        endif()
   2.355          set(SDL_VIDEO_DRIVER_X11_XVIDMODE 1)
   2.356          set(HAVE_VIDEO_X11_XVM TRUE)
   2.357 -      endif(VIDEO_X11_XVM AND HAVE_XF86VM_H)
   2.358 +      endif()
   2.359  
   2.360        set(CMAKE_REQUIRED_LIBRARIES)
   2.361 -    endif(X11_LIB)
   2.362 -  endif(VIDEO_X11)
   2.363 -endmacro(CheckX11)
   2.364 +    endif()
   2.365 +  endif()
   2.366 +endmacro()
   2.367  
   2.368  macro(CheckMir)
   2.369  # !!! FIXME: hook up dynamic loading here.
   2.370 @@ -524,8 +524,8 @@
   2.371              list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CLFAGS} ${XKB_CLFLAGS})
   2.372              list(APPEND EXTRA_LDFLAGS ${MIR_TOOLKIT_LDFLAGS} ${EGL_LDLAGS} ${XKB_LDLAGS})
   2.373          endif (MIR_LIB AND MIR_TOOLKIT_FOUND AND EGL_FOUND AND XKB_FOUND)
   2.374 -    endif(VIDEO_MIR)
   2.375 -endmacro(CheckMir)
   2.376 +    endif()
   2.377 +endmacro()
   2.378  
   2.379  # Requires:
   2.380  # - EGL
   2.381 @@ -547,9 +547,9 @@
   2.382        file(GLOB WAYLAND_SOURCES ${SDL2_SOURCE_DIR}/src/video/wayland/*.c)
   2.383        set(SOURCE_FILES ${SOURCE_FILES} ${WAYLAND_SOURCES})
   2.384        set(SDL_VIDEO_DRIVER_WAYLAND 1)
   2.385 -    endif(WAYLAND_FOUND)
   2.386 -  endif(VIDEO_WAYLAND)
   2.387 -endmacro(CheckWayland)
   2.388 +    endif()
   2.389 +  endif()
   2.390 +endmacro()
   2.391  
   2.392  # Requires:
   2.393  # - n/a
   2.394 @@ -558,16 +558,16 @@
   2.395    if(VIDEO_COCOA)
   2.396      if(APPLE) # Apple always has Cocoa.
   2.397        set(HAVE_VIDEO_COCOA TRUE)
   2.398 -    endif(APPLE)
   2.399 +    endif()
   2.400      if(HAVE_VIDEO_COCOA)
   2.401        file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m)
   2.402        set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C)
   2.403        set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES})
   2.404        set(SDL_VIDEO_DRIVER_COCOA 1)
   2.405        set(HAVE_SDL_VIDEO TRUE)
   2.406 -    endif(HAVE_VIDEO_COCOA)
   2.407 -  endif(VIDEO_COCOA)
   2.408 -endmacro(CheckCOCOA)
   2.409 +    endif()
   2.410 +  endif()
   2.411 +endmacro()
   2.412  
   2.413  # Requires:
   2.414  # - PkgCheckModules
   2.415 @@ -591,14 +591,14 @@
   2.416            FindLibraryAndSONAME("directfb")
   2.417            set(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC "\"${DIRECTFB_LIB_SONAME}\"")
   2.418            set(HAVE_DIRECTFB_SHARED TRUE)
   2.419 -        endif(NOT HAVE_DLOPEN)
   2.420 -      else(DIRECTFB_SHARED)
   2.421 +        endif()
   2.422 +      else()
   2.423          list(APPEND EXTRA_LDFLAGS ${PKG_DIRECTFB_LDFLAGS})
   2.424 -      endif(DIRECTFB_SHARED)
   2.425 +      endif()
   2.426        set(HAVE_SDL_VIDEO TRUE)
   2.427 -    endif(PKG_DIRECTFB_FOUND)
   2.428 -  endif(VIDEO_DIRECTFB)
   2.429 -endmacro(CheckDirectFB)
   2.430 +    endif()
   2.431 +  endif()
   2.432 +endmacro()
   2.433  
   2.434  # Requires:
   2.435  # - n/a
   2.436 @@ -645,9 +645,9 @@
   2.437        set(SDL_VIDEO_OPENGL_GLX 1)
   2.438        set(SDL_VIDEO_RENDER_OGL 1)
   2.439        list(APPEND EXTRA_LIBS GL)
   2.440 -    endif(HAVE_VIDEO_OPENGL)
   2.441 -  endif(VIDEO_OPENGL)
   2.442 -endmacro(CheckOpenGLX11)
   2.443 +    endif()
   2.444 +  endif()
   2.445 +endmacro()
   2.446  
   2.447  # Requires:
   2.448  # - nada
   2.449 @@ -659,7 +659,7 @@
   2.450          int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGL_EGL)
   2.451      if(HAVE_VIDEO_OPENGL_EGL)
   2.452          set(SDL_VIDEO_OPENGL_EGL 1)
   2.453 -    endif(HAVE_VIDEO_OPENGL_EGL) 
   2.454 +    endif()
   2.455      check_c_source_compiles("
   2.456        #include <GLES/gl.h>
   2.457        #include <GLES/glext.h>
   2.458 @@ -668,7 +668,7 @@
   2.459          set(HAVE_VIDEO_OPENGLES TRUE)
   2.460          set(SDL_VIDEO_OPENGL_ES 1)
   2.461          set(SDL_VIDEO_RENDER_OGL_ES 1)
   2.462 -    endif(HAVE_VIDEO_OPENGLES_V1)
   2.463 +    endif()
   2.464      check_c_source_compiles("
   2.465        #include <GLES2/gl2.h>
   2.466        #include <GLES2/gl2ext.h>
   2.467 @@ -677,10 +677,10 @@
   2.468          set(HAVE_VIDEO_OPENGLES TRUE)
   2.469          set(SDL_VIDEO_OPENGL_ES2 1)
   2.470          set(SDL_VIDEO_RENDER_OGL_ES2 1)
   2.471 -    endif(HAVE_VIDEO_OPENGLES_V2)
   2.472 +    endif()
   2.473  
   2.474 -  endif(VIDEO_OPENGLES)
   2.475 -endmacro(CheckOpenGLESX11)
   2.476 +  endif()
   2.477 +endmacro()
   2.478  
   2.479  # Rquires:
   2.480  # - nada
   2.481 @@ -729,7 +729,7 @@
   2.482      else()
   2.483        set(PTHREAD_CFLAGS "-D_REENTRANT")
   2.484        set(PTHREAD_LDFLAGS "-lpthread")
   2.485 -    endif(LINUX)
   2.486 +    endif()
   2.487  
   2.488      # Run some tests
   2.489      set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}")
   2.490 @@ -756,7 +756,7 @@
   2.491          }" HAVE_RECURSIVE_MUTEXES)
   2.492        if(HAVE_RECURSIVE_MUTEXES)
   2.493          set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1)
   2.494 -      else(HAVE_RECURSIVE_MUTEXES)
   2.495 +      else()
   2.496          check_c_source_compiles("
   2.497              #include <pthread.h>
   2.498              int main(int argc, char **argv) {
   2.499 @@ -766,8 +766,8 @@
   2.500              }" HAVE_RECURSIVE_MUTEXES_NP)
   2.501          if(HAVE_RECURSIVE_MUTEXES_NP)
   2.502            set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1)
   2.503 -        endif(HAVE_RECURSIVE_MUTEXES_NP)
   2.504 -      endif(HAVE_RECURSIVE_MUTEXES)
   2.505 +        endif()
   2.506 +      endif()
   2.507  
   2.508        if(PTHREADS_SEM)
   2.509          check_c_source_compiles("#include <pthread.h>
   2.510 @@ -781,8 +781,8 @@
   2.511                    sem_timedwait(NULL, NULL);
   2.512                    return 0;
   2.513                }" HAVE_SEM_TIMEDWAIT)
   2.514 -        endif(HAVE_PTHREADS_SEM)
   2.515 -      endif(PTHREADS_SEM)
   2.516 +        endif()
   2.517 +      endif()
   2.518  
   2.519        check_c_source_compiles("
   2.520            #include <pthread.h>
   2.521 @@ -801,14 +801,14 @@
   2.522        if(HAVE_PTHREADS_SEM)
   2.523          set(SOURCE_FILES ${SOURCE_FILES}
   2.524              ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syssem.c)
   2.525 -      else(HAVE_PTHREADS_SEM)
   2.526 +      else()
   2.527          set(SOURCE_FILES ${SOURCE_FILES}
   2.528              ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syssem.c)
   2.529 -      endif(HAVE_PTHREADS_SEM)
   2.530 +      endif()
   2.531        set(HAVE_SDL_THREADS TRUE)
   2.532 -    endif(HAVE_PTHREADS)
   2.533 -  endif(PTHREADS)
   2.534 -endmacro(CheckPTHREAD)
   2.535 +    endif()
   2.536 +  endif()
   2.537 +endmacro()
   2.538  
   2.539  # Requires
   2.540  # - nada
   2.541 @@ -822,27 +822,27 @@
   2.542      check_include_file(usbhid.h HAVE_USBHID_H)
   2.543      if(HAVE_USBHID_H)
   2.544        set(USB_CFLAGS "-DHAVE_USBHID_H")
   2.545 -    endif(HAVE_USBHID_H)
   2.546 +    endif()
   2.547  
   2.548      check_include_file(libusbhid.h HAVE_LIBUSBHID_H)
   2.549      if(HAVE_LIBUSBHID_H)
   2.550        set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSBHID_H")
   2.551 -    endif(HAVE_LIBUSBHID_H)
   2.552 +    endif()
   2.553      set(USB_LIBS ${USB_LIBS} usbhid)
   2.554 -  else(LIBUSBHID)
   2.555 +  else()
   2.556      check_include_file(usb.h HAVE_USB_H)
   2.557      if(HAVE_USB_H)
   2.558        set(USB_CFLAGS "-DHAVE_USB_H")
   2.559 -    endif(HAVE_USB_H)
   2.560 +    endif()
   2.561      check_include_file(libusb.h HAVE_LIBUSB_H)
   2.562      if(HAVE_LIBUSB_H)
   2.563        set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSB_H")
   2.564 -    endif(HAVE_LIBUSB_H)
   2.565 +    endif()
   2.566      check_library_exists(usb hid_init "" LIBUSB)
   2.567      if(LIBUSB)
   2.568        set(USB_LIBS ${USB_LIBS} usb)
   2.569 -    endif(LIBUSB)
   2.570 -  endif(LIBUSBHID)
   2.571 +    endif()
   2.572 +  endif()
   2.573  
   2.574    set(CMAKE_REQUIRED_FLAGS "${USB_CFLAGS}")
   2.575    set(CMAKE_REQUIRED_LIBRARIES "${USB_LIBS}")
   2.576 @@ -898,7 +898,7 @@
   2.577            }" HAVE_USBHID_UCR_DATA)
   2.578      if(HAVE_USBHID_UCR_DATA)
   2.579        set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_UCR_DATA")
   2.580 -    endif(HAVE_USBHID_UCR_DATA)
   2.581 +    endif()
   2.582  
   2.583      check_c_source_compiles("
   2.584            #include <sys/types.h>
   2.585 @@ -926,7 +926,7 @@
   2.586            }" HAVE_USBHID_NEW)
   2.587      if(HAVE_USBHID_NEW)
   2.588        set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_NEW")
   2.589 -    endif(HAVE_USBHID_NEW)
   2.590 +    endif()
   2.591  
   2.592      check_c_source_compiles("
   2.593          #include <machine/joystick.h>
   2.594 @@ -936,7 +936,7 @@
   2.595          }" HAVE_MACHINE_JOYSTICK)
   2.596      if(HAVE_MACHINE_JOYSTICK)
   2.597        set(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1)
   2.598 -    endif(HAVE_MACHINE_JOYSTICK)
   2.599 +    endif()
   2.600      set(SDL_JOYSTICK_USBHID 1)
   2.601      file(GLOB BSD_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/bsd/*.c)
   2.602      set(SOURCE_FILES ${SOURCE_FILES} ${BSD_JOYSTICK_SOURCES})
   2.603 @@ -946,8 +946,8 @@
   2.604  
   2.605      set(CMAKE_REQUIRED_LIBRARIES)
   2.606      set(CMAKE_REQUIRED_FLAGS)
   2.607 -  endif(HAVE_USBHID)
   2.608 -endmacro(CheckUSBHID)
   2.609 +  endif()
   2.610 +endmacro()
   2.611  
   2.612  # Requires:
   2.613  # - n/a