(up-to-date as on August, 2011)
Here is it how to use SFML 2 on mac.
First download the last sources from the git repository (see github project page for more info). Follow the tutorial on CMake (
here) and choose Makefile (you may have some issues with right access with Xcode). build and install with «sudo make install». (SFML goes by default into /usr/local/ or /Library/Frameworks)
Now, if you want to use Makefile it's the same as on Linux.
If you're using Xcode 4 you can create very easily a new project with the SFML templates.
Otherwise, with Xcode 3 follow these steps :
> Create a new «command line tool» project with C++ selected.
> Double click on your target to open the target info.
> In «General» tab, click on the + in the left bottom.
> Scroll down to libsfml-* and choose the .dylib (not 2.0.dylib nor 2.0.0.dylib) for each module you will use. You can also use SFML frameworks. (Don't forget OpenGL framework if you use Graphics module)
> If you have some errors about include files not found, go to build tab, select «All Configuration» then search for «header search path» and add «/usr/local/include/». If you have not to add such search path please advise me.
If you encounter some «
sndfile.framework/sndfile, file was built for unsupported file format which is not the architecture being linked (i386)» errors, please refer to this
post.
If you got some crash with sf::String or sf::Text about some std::basic_string stuff add '-D_GLIBCXX_FULLY_DYNAMIC_STRING=1' to CMAKE_CXX_FLAGS (advanced option of cmake).
Some more details
here. Post quoted :
Frameworks are now available. BUILD_FRAMEWORKS can be set to TRUE to build SFML as frameworks. NB : frameworks are only available in release. There is no sfml-*-d.framework.
Cmake automatically installs the xcode 4 templates for you if INSTALL_XCODE4_TEMPLATES is set to TRUE.
The templates were updated to let you choose between frameworks and dylibs.
If you choose to create a application bundle (.app) SFML dylibs or SFML frameworks, and sndfile framework, are copied to your bundle so you can send it as-is to people when you build it for "archive".
Please refer to xcode/templates/readme.txt for more details.
Have fun! :wink:
If you need more information, don't hesitate to ask. ;-)