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

Author Topic: Help building SFML using CMake and Xcode on OSX  (Read 1744 times)

0 Members and 1 Guest are viewing this topic.

The End

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Help building SFML using CMake and Xcode on OSX
« on: May 19, 2014, 04:23:13 pm »
Hi!

I would like to compile SFML with Xcode (and before that, CMake to make the Xcode project), using the files from the github repository. I want to do this because I would like to have retina support on my Mac, and it looks to be implemented already. I guess I could just wait for version 2.2, but I decided instead to follow this guide. Everything looked to be going well, and I was able to generate an Xcode project that I used to build the framework version of SFML for OSX. When I tried to use the Xcode 5 Template from this link Xcode was giving me over 30 errors. I figured I should probably build a new Xcode template to reflect the new version of SFML I had built. This didn't seem to have any effect, and I think I have narrowed the problem down to Xcode wanting a universal binary (32/64 bit), while I was just able to build a 64 bit version. In the guide it says you're supposed to use "i386;x86_64" under CMAKE_OSX_ARCHITECTURES, but this absolutely did not work for me. The only thing I was able to put was x86_64. Does anyone know what I am doing wrong or how to fix this? Any tips would be greatly appreciated! :)

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Help building SFML using CMake and Xcode on OSX
« Reply #1 on: May 19, 2014, 05:13:05 pm »
post your actual error.

but I'm pretty sure it's related to §C++11 and Mac OS X...

btw, if you compile + install SFML from github, you get also the last templates; don't use the one on the download page in that case.
SFML / OS X developer

The End

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Help building SFML using CMake and Xcode on OSX
« Reply #2 on: May 19, 2014, 06:20:00 pm »
"CMAKE_OSX_ARCHITECTURES should be 'x86_64'; SFML doesn't support 32 bit on Mac OS X." is the error I am getting when I try to enter i386;x86_64 in the corresponding field.

But I realized something I had done wrong earlier. It says in the guide that you should set both CMAKE_CXX_FLAGS and CMAKE_C_FLAGS to "-stdlib=libc++". And I couldn't find those fields in the CMake GUI, so I added them manually as strings, but I realized now that you find them under "Advanced". Stupid mistake, but I will leave this here in case anyone has the same problem.

After using CMake to generate the Xcode project (with x86_64), I cannot even use the Xcode project to build SFML now. I get 41 errors, and I think most of them are for "Undefined symbols for architecture x86_64".

Edit: I realize now that making an Xcode project is not recommended. I will try to figure out how to use a makefile instead. Excuse this mess ...
« Last Edit: May 19, 2014, 08:45:49 pm by Laurent »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Help building SFML using CMake and Xcode on OSX
« Reply #3 on: May 19, 2014, 10:47:25 pm »
"CMAKE_OSX_ARCHITECTURES should be 'x86_64'; SFML doesn't support 32 bit on Mac OS X." is the error I am getting when I try to enter i386;x86_64 in the corresponding field.
NB: the change that introduced this limitation will soon be rolled back.

Most of the issue you have are detailed in the tutorials. Please read them carefully. Only this way you can spare your precious time.
SFML / OS X developer

 

anything