Added SFML_OS_ prefix to IOS and ANDROID variables

This commit is contained in:
Jonathan De Wachter 2013-10-12 15:26:46 +02:00
parent 00d3bf1e7f
commit f60ab60263
9 changed files with 36 additions and 25 deletions

View file

@ -2,6 +2,9 @@
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(SFML_OS_WINDOWS 1)
# don't use the OpenGL ES implementation on Windows
set(OPENGL_ES 0)
# detect the architecture (note: this test won't work for cross-compilation)
include(CheckTypeSize)
check_type_size(void* SIZEOF_VOID_PTR)
@ -16,14 +19,18 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(SFML_OS_UNIX 1)
if(ANDROID)
set(SFML_OS_ANDROID 1)
# use the OpenGL ES implementation on Android
set(OPENGL_ES 1)
set(SFML_OS_ANDROID 1)
else()
set(SFML_OS_LINUX 1)
# don't use the OpenGL ES implementation on Linux
set(OPENGL_ES 0)
endif()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(SFML_OS_FREEBSD 1)
# don't use the OpenGL ES implementation on FreeBSD
set(OPENGL_ES 0)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(IOS)
set(SFML_OS_IOS 1)
@ -39,7 +46,10 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# use the OpenGL ES implementation on iOS
set(OPENGL_ES 1)
else()
set(SFML_OS_MACOSX 1)
set(SFML_OS_MACOSX 1)
# don't use the OpenGL ES implementation on Mac OS X
set(OPENGL_ES 0)
# detect OS X version. (use '/usr/bin/sw_vers -productVersion' to extract V from '10.V.x'.)
EXEC_PROGRAM(/usr/bin/sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW)

View file

@ -41,7 +41,7 @@ macro(sfml_add_library target)
# set the version and soversion of the target (for compatible systems -- mostly Linuxes)
# except for Android which strips soversion suffixes
if(NOT ANDROID)
if(NOT SFML_OS_ANDROID)
set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR})
set_target_properties(${target} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
endif()
@ -93,13 +93,13 @@ macro(sfml_add_library target)
endif()
# enable automatic reference counting on iOS
if (IOS)
if (SFML_OS_IOS)
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
endif()
# sfml-activity library is our bootstrap activity and must not depend on stlport_shared
# (otherwise Android will fail to load it)
if (ANDROID)
if (SFML_OS_ANDROID)
if (${target} MATCHES "sfml-activity")
set_target_properties(${target} PROPERTIES COMPILE_FLAGS -fpermissive)
set_target_properties(${target} PROPERTIES LINK_FLAGS "-landroid -llog")