Skip to content

Commit

Permalink
CMake: Replace "else(condition)" with "else()", etc.
Browse files Browse the repository at this point in the history
Bumped required CMake version to 2.8.

Thanks to the SDL/Emscripten porting team for this cleanup.
  • Loading branch information
icculus committed Dec 13, 2014
1 parent 708a43f commit a228b67
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 141 deletions.
22 changes: 11 additions & 11 deletions CMakeLists.txt
Expand Up @@ -2,7 +2,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there")
endif()

cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.8)
project(SDL2 C)
include(CheckFunctionExists)
include(CheckLibraryExists)
Expand Down Expand Up @@ -144,7 +144,7 @@ if("$ENV{CFLAGS}" STREQUAL "")
if(USE_GCC OR USE_CLANG)
set(CMAKE_C_FLAGS "-g -O3")
endif()
else("$ENV{CFLAGS}" STREQUAL "")
else()
set(CMAKE_C_FLAGS "$ENV{CFLAGS}")
list(APPEND EXTRA_CFLAGS "$ENV{CFLAGS}")
endif()
Expand All @@ -161,7 +161,7 @@ if(MSVC)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif()
endforeach(flag_var)
endforeach()
endif()
endif()

Expand Down Expand Up @@ -486,7 +486,7 @@ if(ASSEMBLY)
set(SDL_ASSEMBLY_ROUTINES 1)
endif()
# TODO:
#else(ASSEMBLY)
#else()
# if(USE_GCC OR USE_CLANG)
# list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx")
# endif()
Expand Down Expand Up @@ -518,7 +518,7 @@ if(LIBC)
set(HAVE_M_PI 1)
add_definitions(-D_USE_MATH_DEFINES) # needed for M_PI
set(STDC_HEADERS 1)
else(WINDOWS AND NOT MINGW)
else()
set(HAVE_LIBC TRUE)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
foreach(_HEADER
Expand Down Expand Up @@ -571,7 +571,7 @@ if(LIBC)

check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION)
endif()
else(LIBC)
else()
if(WINDOWS)
set(HAVE_STDARG_H 1)
set(HAVE_STDDEF_H 1)
Expand Down Expand Up @@ -752,7 +752,7 @@ if(UNIX AND NOT APPLE)
if(FOUND_CLOCK_GETTIME)
list(APPEND EXTRA_LIBS rt)
set(HAVE_CLOCK_GETTIME 1)
else(FOUND_CLOCK_GETTIME)
else()
check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME)
if(FOUND_CLOCK_GETTIME)
set(HAVE_CLOCK_GETTIME 1)
Expand Down Expand Up @@ -1193,14 +1193,14 @@ if(NOT WINDOWS OR CYGWIN)
if(SDL_STATIC)
set(ENABLE_STATIC_TRUE "")
set(ENABLE_STATIC_FALSE "#")
else(SDL_STATIC)
else()
set(ENABLE_STATIC_TRUE "#")
set(ENABLE_STATIC_FALSE "")
endif()
if(SDL_SHARED)
set(ENABLE_SHARED_TRUE "")
set(ENABLE_SHARED_FALSE "#")
else(SDL_SHARED)
else()
set(ENABLE_SHARED_TRUE "#")
set(ENABLE_SHARED_FALSE "")
endif()
Expand Down Expand Up @@ -1281,7 +1281,7 @@ if(SDL_SHARED)
VERSION ${LT_VERSION}
SOVERSION ${LT_REVISION}
OUTPUT_NAME "SDL2-${LT_RELEASE}")
else(UNIX)
else()
set_target_properties(SDL2 PROPERTIES
VERSION ${SDL_VERSION}
SOVERSION ${LT_REVISION}
Expand Down Expand Up @@ -1330,7 +1330,7 @@ if(NOT WINDOWS OR CYGWIN)
if(FREEBSD)
# FreeBSD uses ${PREFIX}/libdata/pkgconfig
install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig")
else(FREEBSD)
else()
install(FILES ${SDL2_BINARY_DIR}/sdl2.pc
DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
endif()
Expand Down

0 comments on commit a228b67

Please sign in to comment.