CMake : add support for ppc arch and 10.5 SDK

This commit is contained in:
Marco Antognini 2011-03-30 19:52:36 +02:00
parent 9d68277442
commit 0e37997734

View File

@ -28,7 +28,16 @@ set(BUILD_SHARED_LIBS TRUE CACHE BOOL "TRUE to build SFML as shared libraries, F
set(BUILD_EXAMPLES FALSE CACHE BOOL "TRUE to build the SFML examples, FALSE to ignore them") set(BUILD_EXAMPLES FALSE CACHE BOOL "TRUE to build the SFML examples, FALSE to ignore them")
# add an option for building the API documentation # add an option for building the API documentation
set(BUILD_DOC FALSE CACHE BOOL "TRUE to generate the API documentation, FALSE to ignore it") set(BUILD_DOC FALSE CACHE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
# Mac OS X specific options
if (MACOSX)
# add an option to compile ppc/ppc64
set(BUILD_PPC FALSE CACHE BOOL "TRUE to build SFML for ppc and ppc64, too, FALSE to only compile i386 and x86_64")
# add an option to build against 10.5 SDK
set(BUILD_LEOPARD FALSE CACHE BOOL "TRUE to build SFML for OS X 10.5, FALSE to compile for default SDK")
endif()
# define SFML_STATIC if the build type is not set to 'shared' # define SFML_STATIC if the build type is not set to 'shared'
if(NOT BUILD_SHARED_LIBS) if(NOT BUILD_SHARED_LIBS)
@ -55,7 +64,40 @@ if(COMPILER_MSVC)
endif() endif()
# disable the rpath stuff # disable the rpath stuff
set(CMAKE_SKIP_BUILD_RPATH TRUE) set(CMAKE_SKIP_BUILD_RPATH TRUE)
# Setup Mac OS X multi arch/SDK support.
if (MACOSX)
# compile for PPC ?
if (BUILD_PPC)
if (NOT CMAKE_OSX_ARCHITECTURES)
# Custom : ppc, ppc64, i386 and x86_64
set(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64")
else()
# We got some conflict with custom user settings ; let him know his on his own.
message("You set BUILD_PPC to TRUE but CMAKE_OSX_ARCHITECTURES is not empty.")
message("You're on your own : I won't change your settings.")
endif()
else()
if (NOT CMAKE_OSX_ARCHITECTURES)
# Default : i386 and x86_64
set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
else()
# We got some conflict with custom user settings ; let him know his on his own.
message("CMAKE_OSX_ARCHITECTURES is not empty.")
message("You're on your own : I won't change your settings.")
endif()
endif()
# use 10.5 SDK ?
if (BUILD_LEOPARD)
# Use 10.5 SDK : override default value
set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5")
else()
# Default SDK, let either the user or CMake decide which one to use.
endif()
endif()
# add the subdirectories # add the subdirectories
add_subdirectory(src/SFML) add_subdirectory(src/SFML)