Updated Xcode templates

- The installation paths are no longer hard coded; cmake now configures them so that Frameworks and libs can be installed somewhere else.
- No longer copy sndfile.framework but instead copy the new dependencies of the audio module.
- No longer copy .DS_Store to the install directory.
This commit is contained in:
Marco Antognini 2014-10-08 11:08:04 +02:00 committed by Mario Liebisch
parent 599a16b1f2
commit e22bb627c7
2 changed files with 25 additions and 13 deletions

View File

@ -330,13 +330,17 @@ elseif(SFML_OS_MACOSX)
# install the Xcode templates if requested # install the Xcode templates if requested
if(SFML_INSTALL_XCODE_TEMPLATES) if(SFML_INSTALL_XCODE_TEMPLATES)
configure_file( # configure the templates plist files
"tools/xcode/templates/SFML/SFML Compiler.xctemplate/TemplateInfo.plist.in" foreach(TEMPLATE "SFML Compiler" "SFML App")
"${CMAKE_CURRENT_BINARY_DIR}/tools/xcode/templates/SFML/SFML Compiler.xctemplate/TemplateInfo.plist" configure_file(
@ONLY) "tools/xcode/templates/SFML/${TEMPLATE}.xctemplate/TemplateInfo.plist.in"
"${CMAKE_CURRENT_BINARY_DIR}/tools/xcode/templates/SFML/${TEMPLATE}.xctemplate/TemplateInfo.plist"
@ONLY)
endforeach()
install(DIRECTORY "tools/xcode/templates/SFML" "${CMAKE_CURRENT_BINARY_DIR}/tools/xcode/templates/SFML" install(DIRECTORY "tools/xcode/templates/SFML" "${CMAKE_CURRENT_BINARY_DIR}/tools/xcode/templates/SFML"
DESTINATION /Library/Developer/Xcode/Templates DESTINATION /Library/Developer/Xcode/Templates
PATTERN "*.in" EXCLUDE) PATTERN "*.in" EXCLUDE
PATTERN ".DS_Store" EXCLUDE)
endif() endif()
elseif(SFML_OS_IOS) elseif(SFML_OS_IOS)

View File

@ -145,6 +145,11 @@ subject to the following restrictions:
<string># This shell script simply copies required SFML dylibs/frameworks into the application bundle frameworks folder. <string># This shell script simply copies required SFML dylibs/frameworks into the application bundle frameworks folder.
# If you're using static libraries (which is not recommended) you should remove this script from your project. # If you're using static libraries (which is not recommended) you should remove this script from your project.
# SETTINGS
CMAKE_INSTALL_FRAMEWORK_PREFIX="@CMAKE_INSTALL_FRAMEWORK_PREFIX@"
CMAKE_INSTALL_LIB_PREFIX="@CMAKE_INSTALL_PREFIX@/lib"
FRAMEWORKS_FULL_PATH="$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/"
# Are we building a project that uses frameworks or dylibs? # Are we building a project that uses frameworks or dylibs?
case "$SFML_BINARY_TYPE" in case "$SFML_BINARY_TYPE" in
DYLIBS) DYLIBS)
@ -166,7 +171,7 @@ assert () # $1 is a boolean, $2...N is an error message
{ {
if [ $# -lt 2 ] if [ $# -lt 2 ]
then then
error "Internal error in assert : not enough args" error "Internal error in assert: not enough args"
fi fi
if [ $1 -ne 0 ] if [ $1 -ne 0 ]
@ -194,7 +199,7 @@ copy () # $1 is a source, $2 is a destination
require () # $1 is a SFML module like 'system' or 'audio' require () # $1 is a SFML module like 'system' or 'audio'
{ {
dest="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Contents/Frameworks" dest="$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/"
if [ -z "$1" ] if [ -z "$1" ]
then then
@ -207,14 +212,14 @@ require () # $1 is a SFML module like 'system' or 'audio'
# copy SFML libraries # copy SFML libraries
if [ "$frameworks" = "true" ] if [ "$frameworks" = "true" ]
then then
source="/Library/Frameworks/sfml-$1.framework" source="$CMAKE_INSTALL_FRAMEWORK_PREFIX/sfml-$1.framework"
target="sfml-$1.framework" target="sfml-$1.framework"
elif [ "$SFML_LINK_DYLIBS_SUFFIX" = "-d" ] elif [ "$SFML_LINK_DYLIBS_SUFFIX" = "-d" ]
then then
source="/usr/local/lib/libsfml-$1-d.dylib" source="$CMAKE_INSTALL_LIB_PREFIX/libsfml-$1-d.dylib"
target="`readlink $source`" target="`readlink $source`"
else else
source="/usr/local/lib/libsfml-$1.dylib" source="$CMAKE_INSTALL_LIB_PREFIX/libsfml-$1.dylib"
target="`readlink $source`" target="`readlink $source`"
fi fi
@ -223,12 +228,15 @@ require () # $1 is a SFML module like 'system' or 'audio'
# copy extra dependencies # copy extra dependencies
if [ "$1" = "audio" ] if [ "$1" = "audio" ]
then then
# copy sndfile framework too # copy "FLAC" "ogg" "vorbis" "vorbisenc" "vorbisfile" frameworks too
copy "/Library/Frameworks/sndfile.framework" "$dest/sndfile.framework" for f in "FLAC" "ogg" "vorbis" "vorbisenc" "vorbisfile"
do
copy "$CMAKE_INSTALL_FRAMEWORK_PREFIX/$f.framework" "$dest/$f.framework"
done
elif [ "$1" = "graphics" ] elif [ "$1" = "graphics" ]
then then
# copy freetype framework too # copy freetype framework too
copy "/Library/Frameworks/freetype.framework" "$dest/freetype.framework" copy "$CMAKE_INSTALL_FRAMEWORK_PREFIX/freetype.framework" "$dest/freetype.framework"
fi fi
fi fi
} }