Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: installing sfml on a Mac computer  (Read 1445 times)

0 Members and 1 Guest are viewing this topic.

jonas

  • Newbie
  • *
  • Posts: 3
    • View Profile
installing sfml on a Mac computer
« on: September 13, 2011, 07:51:40 pm »
hello everyone,

i'm new here, and i like it to program with sfml and qt on my (old) windows computer, but i'm getting a Mac computer, and i asked myself how i could get sfml 2.0 working with QT creator, Xcode, or an other IDE. It actually doesn't matter with what IDE it works, i just want to be sure it works in a Mac. So, is there any tutorial in which it is explained step by step how i could get sfml 2.0 working with an IDE on a mac computer? I guess it's usual to use it with Xcode on a Mac, but it doesn't really matter. I'm already happy if it works on a Mac, so i wouldn't have to use my old windows computer. I'm busy with a project working with sfml in windows, so it would be just nice to know when i get a mac i will be abe to work on my mac on the same project...

So, if there's anyone can help me, go ahead :P
i love it to program with sfml and t, but still have problems installing it on a mac...

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
installing sfml on a Mac computer
« Reply #1 on: September 13, 2011, 08:06:05 pm »
Quote
So, is there any tutorial in which it is explained step by step how i could get sfml 2.0 working with an IDE on a mac computer?
No, at least not yet.

To install SFML 2.0 on your mac you must follow CMake tutorial as you do it on Windows. Make sure to select Makefile generator to compile and install SFML (it might not work with Xcode).

Some CMake options are not described in the tutorial but if you're at least a little bit familiar with Apple's OS you shouldn't have trouble. (Juste over the mouse on a variable in CMake gui to show the tooltip information.)

For example you can choose between compiling SFML as a framework library or as a dylib library.

Then you can use Xcode with the SFML templates (automatically installed by cmake if INSTALL_XCODE4_TEMPLATES has been set to true) to start a new project.

If you don't want to use these templates you can create a project your own project and then add the SFML dylibs/frameworks to the project (the same way you would have done it for any library : drag and drop it on you project). You don't need to add SFML.framework though. Only sfml-*.framework are required, or sfml-*[-d].dylib if you use dylibs instead of frameworks.

Explore Xcode IDE and have fun! If you have any specific question don't hesitate to ask on the forum. :wink:

PS : I never tested Qt on Mac with SFML but it should work.
SFML / OS X developer

jonas

  • Newbie
  • *
  • Posts: 3
    • View Profile
installing sfml on a Mac computer
« Reply #2 on: September 13, 2011, 08:13:36 pm »
ok, thank you for your answer first of all :) I've read it attentive and i think it should be a little bit easier right now :P But there's one more question: what's the difference between picking the framework or the dylib library? Like i've said i don't have the mac right now, so i don't really know the OS and Xcode, but maybe i'll get it when you'll explain it :)

Jonas.
i love it to program with sfml and t, but still have problems installing it on a mac...

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
installing sfml on a Mac computer
« Reply #3 on: September 13, 2011, 09:36:32 pm »
Quote
what's the difference between picking the framework or the dylib library?
There isn't much difference in fact.

If you ship your application as un bundle (.app) like most application are currently shipped, then it changes nothing at all because you can copy both dylibs and frameworks into your application. This make the installation process very easy for the end-user : she/he has only on action to make in order to install the application on her/his system. Copy/Paste yourApplication.app into her/his Application folder.

The "copy-frameworks-or-dylibs-to-your-app-bundle" phase is automatically created when you create a new project from the provided SFML templates in Xcode.

On the other hand, if you decide to ship your application as a simple ".exe" (there is no such extension on Mac - the executable name will be "yourApplication" on Mac and "yourApplication.exe" on Windows) then you have to install the dylibs/frameworks into specific repositories. This is the only difference : dylibs goes in /usr/local/lib and frameworks goes into /Library/Frameworks/ folder. That's it.

That's the general story. But with SFML there is another difference between frameworks and dylibs : you can compile SFML as a dylib library in both release and debug mode but only release mode is supported with frameworks.

Note that you can also build SFML as a static library (pretty much like it's done on Windows I think) but this is NOT recommended (if you're interested why this is not recommended I let you use Google search tools :wink: ).
SFML / OS X developer