mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-24 04:04:31 +08:00
CMake: Replace "else(condition)" with "else()", etc.
Bumped required CMake version to 2.8. Thanks to the SDL/Emscripten porting team for this cleanup.
This commit is contained in:
+11
-11
@@ -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)
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
@@ -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
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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()
|
||||
@@ -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}
|
||||
@@ -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()
|
||||
|
||||
+130
-130
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user