Updated Xcode templates and cmake script

What's new in the templates:
 - Removed support for 32 bits and gcc
 - Removed useless code
 - Removed custom warnings settings – let Xcode decide with its default values
 - Set default target version to CMAKE_OSX_DEPLOYMENT_TARGET

What's new in cmake script:
 - Added cmake options for archs and deployment target
 - Added minimum requirements checking
This commit is contained in:
Marco Antognini 2014-04-15 18:44:55 +02:00
parent 0a5f38157f
commit 19012c66ea
4 changed files with 37 additions and 125 deletions

View file

@ -36,6 +36,12 @@ sfml_set_option(SFML_BUILD_EXAMPLES FALSE BOOL "TRUE to build the SFML examples,
# add an option for building the API documentation
sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
# set default CMAKE_OSX_ARCHITECTURES value to x86_64
sfml_set_option(CMAKE_OSX_ARCHITECTURES "x86_64" STRING "Build architectures for OS X")
# set default CMAKE_OSX_DEPLOYMENT_TARGET value to 10.7
sfml_set_option(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" STRING "Minimum OS version to target for deployment (at runtime)")
# Mac OS X specific options
if(SFML_OS_MACOSX)
# add an option to build frameworks instead of dylibs (release only)
@ -107,6 +113,12 @@ if(SFML_OS_MACOSX)
message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES should be 'x86_64' to support ARC")
return()
endif()
# make sure CMAKE_OSX_DEPLOYMENT_TARGET is >= 10.7
if (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.7")
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) should be 10.7 or better")
return()
endif()
endif()
if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
@ -118,8 +130,8 @@ if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
"tools/pkg-config/sfml-${sfml_module}.pc.in"
"tools/pkg-config/sfml-${sfml_module}.pc"
@ONLY)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/sfml-${sfml_module}.pc"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig")
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/sfml-${sfml_module}.pc"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig")
endforeach()
endif()
else()
@ -180,8 +192,8 @@ else()
POST_BUILD
COMMAND cp -r ${PROJECT_SOURCE_DIR}/include/SFML/* SFML.framework/Versions/${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/Headers)
# adapt install directory to allow distributing dylibs/frameworks in users frameworks/application bundle
# NOTE : it's not required to link agains SFML.framework
# adapt install directory to allow distributing dylibs/frameworks in user's frameworks/application bundle
# NOTE : it's not required to link against SFML.framework
set_target_properties(SFML PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@executable_path/../Frameworks")
@ -218,6 +230,12 @@ elseif(SFML_OS_MACOSX)
install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX})
if(SFML_INSTALL_XCODE4_TEMPLATES)
install(DIRECTORY tools/xcode/templates/SFML DESTINATION /Library/Developer/Xcode/Templates)
install(DIRECTORY tools/xcode/templates/SFML
DESTINATION /Library/Developer/Xcode/Templates
PATTERN "*.in" EXCLUDE)
configure_file(
"tools/xcode/templates/SFML/SFML Compiler.xctemplate/TemplateInfo.plist.in"
"/Library/Developer/Xcode/Templates/SFML/SFML Compiler.xctemplate/TemplateInfo.plist"
@ONLY)
endif()
endif()